mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Provide access to the specs hash indirectly via a meta attribute
This commit is contained in:
parent
3e1cc70fb4
commit
1dc4fbdb0b
@ -3,12 +3,13 @@ require 'utils/json'
|
|||||||
class AbstractDownloadStrategy
|
class AbstractDownloadStrategy
|
||||||
include FileUtils
|
include FileUtils
|
||||||
|
|
||||||
attr_reader :name, :resource
|
attr_reader :meta, :name, :resource
|
||||||
|
|
||||||
def initialize name, resource
|
def initialize name, resource
|
||||||
@name = name
|
@name = name
|
||||||
@resource = resource
|
@resource = resource
|
||||||
@url = resource.url
|
@url = resource.url
|
||||||
|
@meta = resource.specs
|
||||||
end
|
end
|
||||||
|
|
||||||
def expand_safe_system_args args
|
def expand_safe_system_args args
|
||||||
@ -87,7 +88,7 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
|
|||||||
|
|
||||||
def initialize name, resource
|
def initialize name, resource
|
||||||
super
|
super
|
||||||
@ref_type, @ref = extract_ref(resource.specs)
|
@ref_type, @ref = extract_ref(meta)
|
||||||
@clone = HOMEBREW_CACHE.join(cache_filename)
|
@clone = HOMEBREW_CACHE.join(cache_filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -517,7 +518,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
|
|||||||
super
|
super
|
||||||
@ref_type ||= :branch
|
@ref_type ||= :branch
|
||||||
@ref ||= "master"
|
@ref ||= "master"
|
||||||
@shallow = resource.specs.fetch(:shallow) { true }
|
@shallow = meta.fetch(:shallow) { true }
|
||||||
end
|
end
|
||||||
|
|
||||||
def stage
|
def stage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user