aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-11-05 12:11:57 +0000
committerMike McQuaid2017-11-05 15:39:43 +0000
commit77e3e7e4d953f9e43694a5b7b104c364b963c93b (patch)
tree86fa05bb67dde6852758733fb405f27b3fe0fa81 /Library
parent389188ac4fcac42db3b4ef2e31557147890a861a (diff)
downloadbrew-77e3e7e4d953f9e43694a5b7b104c364b963c93b.tar.bz2
version: support to_i.
This is needed for existing MacOS::Xcode.version calls that relied on this returning a string. It mirrors similar behaviour for to_f.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/version.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb
index d43e0c665..c2635f18c 100644
--- a/Library/Homebrew/version.rb
+++ b/Library/Homebrew/version.rb
@@ -431,6 +431,10 @@ class Version
version.to_f
end
+ def to_i
+ version.to_i
+ end
+
def to_s
version.dup
end