Skip to content
Snippets Groups Projects
Commit 5ce4c2a3 authored by Jack Nagel's avatar Jack Nagel
Browse files

VCSDownloadStrategy: use REF_TYPES when extracting ref to use

parent 41e3b2ca
No related branches found
No related tags found
No related merge requests found
......@@ -43,12 +43,13 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
def initialize name, resource
super
@ref_type, @ref = destructure_spec_hash(resource.specs)
@ref_type, @ref = extract_ref(resource.specs)
@clone = HOMEBREW_CACHE/cache_filename
end
def destructure_spec_hash(spec)
spec.each { |o| return o }
def extract_ref(specs)
key = REF_TYPES.find { |type| specs.key?(type) }
return key, specs[key]
end
def cache_filename(tag=cache_tag)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment