diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 480f23521f..be74a2cc73 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -192,7 +192,7 @@ class Version end def head? - @version == 'HEAD' + version == "HEAD" end def <=>(other) @@ -207,16 +207,18 @@ class Version alias_method :eql?, :== def hash - @version.hash + version.hash end def to_s - @version.dup + version.dup end alias_method :to_str, :to_s protected + attr_reader :version + def begins_with_numeric? tokens.first.numeric? end @@ -236,7 +238,7 @@ class Version end def tokenize - @version.scan(SCAN_PATTERN).map! do |token| + version.scan(SCAN_PATTERN).map! do |token| case token when /\A#{AlphaToken::PATTERN}\z/o then AlphaToken when /\A#{BetaToken::PATTERN}\z/o then BetaToken