aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/download_strategy.rb
diff options
context:
space:
mode:
authorJack Nagel2014-12-09 19:59:16 -0500
committerJack Nagel2014-12-09 19:59:16 -0500
commitbb9aeffb1d8636a155a3a9161172f0c7f7ec8646 (patch)
tree5a583ef6b457ebc583cfaf66cb5b0c48df3527f3 /Library/Homebrew/download_strategy.rb
parentb2a6ebb6839ca5f08c27c08c5a20b68db201c8a3 (diff)
downloadhomebrew-bb9aeffb1d8636a155a3a9161172f0c7f7ec8646.tar.bz2
Provide access to the specs hash indirectly via a meta attribute
Diffstat (limited to 'Library/Homebrew/download_strategy.rb')
-rw-r--r--Library/Homebrew/download_strategy.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index dd0cbe0a7..be9f7187f 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -3,12 +3,13 @@ require 'utils/json'
class AbstractDownloadStrategy
include FileUtils
- attr_reader :name, :resource
+ attr_reader :meta, :name, :resource
def initialize name, resource
@name = name
@resource = resource
- @url = resource.url
+ @url = resource.url
+ @meta = resource.specs
end
def expand_safe_system_args args
@@ -87,7 +88,7 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
def initialize name, resource
super
- @ref_type, @ref = extract_ref(resource.specs)
+ @ref_type, @ref = extract_ref(meta)
@clone = HOMEBREW_CACHE.join(cache_filename)
end
@@ -517,7 +518,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
super
@ref_type ||= :branch
@ref ||= "master"
- @shallow = resource.specs.fetch(:shallow) { true }
+ @shallow = meta.fetch(:shallow) { true }
end
def stage