Remove Version#to_a alias

Exposing this as "to_a" was a mistake, versions are not arrays and it
causes incorrect behavior when splatted or using Kernel#Array(). Use the
more correct name "tokens" instead.
This commit is contained in:
Jack Nagel 2013-06-14 18:37:26 -05:00
parent ca10e5005a
commit 113125d394
2 changed files with 2 additions and 3 deletions

View File

@ -24,10 +24,10 @@ class PythonInstalled < Requirement
class PythonVersion < Version class PythonVersion < Version
def major def major
to_a[0].to_s.to_i # Python's major.minor are always ints. tokens[0].to_s.to_i # Python's major.minor are always ints.
end end
def minor def minor
to_a[1].to_s.to_i tokens[1].to_s.to_i
end end
end end

View File

@ -184,7 +184,6 @@ class Version
def tokens def tokens
@tokens ||= tokenize @tokens ||= tokenize
end end
alias_method :to_a, :tokens
def tokenize def tokenize
@version.scan( @version.scan(