aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-06-14 18:37:26 -0500
committerJack Nagel2013-06-14 18:37:27 -0500
commitc947c674ab0d49ed55c19a5e57321c3190fbb3d3 (patch)
treec0c7a3d5bb236ba877f7789456c018e1f7f67e3e /Library
parentcadbcf33e322e8a099f5c3f56bd8f01ed669a987 (diff)
downloadhomebrew-c947c674ab0d49ed55c19a5e57321c3190fbb3d3.tar.bz2
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.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/requirements/python_dependency.rb4
-rw-r--r--Library/Homebrew/version.rb1
2 files changed, 2 insertions, 3 deletions
diff --git a/Library/Homebrew/requirements/python_dependency.rb b/Library/Homebrew/requirements/python_dependency.rb
index bd3cf1e85..c3753d813 100644
--- a/Library/Homebrew/requirements/python_dependency.rb
+++ b/Library/Homebrew/requirements/python_dependency.rb
@@ -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
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb
index d969f298c..07d042eb1 100644
--- a/Library/Homebrew/version.rb
+++ b/Library/Homebrew/version.rb
@@ -184,7 +184,6 @@ class Version
def tokens
@tokens ||= tokenize
end
- alias_method :to_a, :tokens
def tokenize
@version.scan(