Avoid the need to defensively flatten tags array
This commit is contained in:
parent
31e0bf61fa
commit
3df31557c8
@ -76,7 +76,7 @@ class DependencyCollector
|
|||||||
elsif (tag = tags.first) && LANGUAGE_MODULES.include?(tag)
|
elsif (tag = tags.first) && LANGUAGE_MODULES.include?(tag)
|
||||||
# Next line only for legacy support of `depends_on 'module' => :python`
|
# Next line only for legacy support of `depends_on 'module' => :python`
|
||||||
# It should be replaced by `depends_on :python => 'module'`
|
# It should be replaced by `depends_on :python => 'module'`
|
||||||
return PythonDependency.new("2", spec) if tag == :python
|
return PythonDependency.new("2", Array(spec)) if tag == :python
|
||||||
LanguageModuleDependency.new(tag, spec)
|
LanguageModuleDependency.new(tag, spec)
|
||||||
else
|
else
|
||||||
Dependency.new(spec, tags)
|
Dependency.new(spec, tags)
|
||||||
|
|||||||
@ -34,7 +34,6 @@ class PythonDependency < Requirement
|
|||||||
end
|
end
|
||||||
|
|
||||||
def initialize(default_version="2.6", tags=[])
|
def initialize(default_version="2.6", tags=[])
|
||||||
tags = [tags].flatten
|
|
||||||
# Extract the min_version if given. Default to default_version else
|
# Extract the min_version if given. Default to default_version else
|
||||||
if /(\d+\.)*\d+/ === tags.first.to_s
|
if /(\d+\.)*\d+/ === tags.first.to_s
|
||||||
@min_version = PythonVersion.new(tags.shift)
|
@min_version = PythonVersion.new(tags.shift)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user