diff options
Diffstat (limited to 'Library/Homebrew/version.rb')
| -rw-r--r-- | Library/Homebrew/version.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 520db6626..c0e5324ea 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -208,7 +208,7 @@ class Version end def <=>(other) - return unless Version === other + return unless other.is_a?(Version) return 0 if version == other.version return 1 if head? && !other.head? return -1 if !head? && other.head? @@ -386,7 +386,7 @@ class Version # e.g. http://mirrors.jenkins-ci.org/war/1.486/jenkins.war # e.g. https://github.com/foo/bar/releases/download/0.10.11/bar.phar - m = /\/(\d\.\d+(\.\d+)?)\//.match(spec_s) + m = %r{/(\d\.\d+(\.\d+)?)}.match(spec_s) return m.captures.first unless m.nil? # e.g. http://www.ijg.org/files/jpegsrc.v8d.tar.gz |
