Skip to content

Commit

Permalink
Add @ref_type and @ref needef for fossil.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Jul 12, 2018
1 parent 5dfa4de commit cba55c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/download_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def ohai(*args)
# 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

Expand Down
8 changes: 5 additions & 3 deletions Library/Homebrew/unpack_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def self.strategies
end
private_class_method :strategies

def self.detect(path)
def self.detect(path, ref_type: nil, ref: nil)
magic_number = if path.directory?
""
else
Expand All @@ -48,13 +48,15 @@ def self.detect(path)
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)
Expand Down

0 comments on commit cba55c8

Please sign in to comment.