forked from Homebrew/brew
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2815fb
commit 9bac107
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
class Version | ||
NULL = Class.new do | ||
include Comparable | ||
|
||
def <=>(_other) | ||
-1 | ||
end | ||
|
||
def eql?(_other) | ||
# Makes sure that the same instance of Version::NULL | ||
# will never equal itself; normally Comparable#== | ||
# will return true for this regardless of the return | ||
# value of #<=> | ||
false | ||
end | ||
|
||
def detected_from_url? | ||
false | ||
end | ||
|
||
def head? | ||
false | ||
end | ||
|
||
def null? | ||
true | ||
end | ||
|
||
def to_f | ||
Float::NAN | ||
end | ||
|
||
def to_s | ||
"" | ||
end | ||
alias_method :to_str, :to_s | ||
end.new | ||
end |