Add @ref_type and @ref needef for fossil.
This commit is contained in:
parent
5dfa4ded43
commit
cba55c8fd4
@ -47,7 +47,7 @@ class AbstractDownloadStrategy
|
||||
# chdir into the newly-unpacked directory.
|
||||
# Unlike {Resource#stage}, this does not take a block.
|
||||
def stage
|
||||
UnpackStrategy.detect(cached_location)
|
||||
UnpackStrategy.detect(cached_location, ref_type: @ref_type, ref: @ref)
|
||||
.extract(basename: basename_without_params)
|
||||
end
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ class UnpackStrategy
|
||||
end
|
||||
private_class_method :strategies
|
||||
|
||||
def self.detect(path)
|
||||
def self.detect(path, ref_type: nil, ref: nil)
|
||||
magic_number = if path.directory?
|
||||
""
|
||||
else
|
||||
@ -48,13 +48,15 @@ class UnpackStrategy
|
||||
UncompressedUnpackStrategy
|
||||
end
|
||||
|
||||
strategy.new(path)
|
||||
strategy.new(path, ref_type: ref_type, ref: ref)
|
||||
end
|
||||
|
||||
attr_reader :path
|
||||
|
||||
def initialize(path)
|
||||
def initialize(path, ref_type: nil, ref: nil)
|
||||
@path = Pathname(path).expand_path
|
||||
@ref_type = ref_type
|
||||
@ref = ref
|
||||
end
|
||||
|
||||
def extract(to: nil, basename: nil)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user