Avoid the need to defensively flatten tags array

This commit is contained in:
Jack Nagel 2013-10-15 13:26:23 -05:00
parent 31e0bf61fa
commit 3df31557c8
2 changed files with 1 additions and 2 deletions

View File

@ -76,7 +76,7 @@ class DependencyCollector
elsif (tag = tags.first) && LANGUAGE_MODULES.include?(tag)
# Next line only for legacy support of `depends_on 'module' => :python`
# 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)
else
Dependency.new(spec, tags)

View File

@ -34,7 +34,6 @@ class PythonDependency < Requirement
end
def initialize(default_version="2.6", tags=[])
tags = [tags].flatten
# Extract the min_version if given. Default to default_version else
if /(\d+\.)*\d+/ === tags.first.to_s
@min_version = PythonVersion.new(tags.shift)