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

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.
parent ca10e500
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,10 @@ class PythonInstalled < Requirement
class PythonVersion < Version
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
def minor
to_a[1].to_s.to_i
tokens[1].to_s.to_i
end
end
......
......@@ -184,7 +184,6 @@ class Version
def tokens
@tokens ||= tokenize
end
alias_method :to_a, :tokens
def tokenize
@version.scan(
......
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