summaryrefslogtreecommitdiff
path: root/ext/date/lib/date.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/lib/date.rb')
-rw-r--r--ext/date/lib/date.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/date/lib/date.rb b/ext/date/lib/date.rb
index 9170a99ae9..0cb763017f 100644
--- a/ext/date/lib/date.rb
+++ b/ext/date/lib/date.rb
@@ -4,10 +4,17 @@
require 'date_core'
class Date
+ VERSION = "3.5.1" # :nodoc:
- class Infinity < Numeric # :nodoc:
+ # call-seq:
+ # infinite? -> false
+ #
+ # Returns +false+
+ def infinite?
+ false
+ end
- include Comparable
+ class Infinity < Numeric # :nodoc:
def initialize(d=1) @d = d <=> 0 end
@@ -28,6 +35,8 @@ class Date
def <=>(other)
case other
when Infinity; return d <=> other.d
+ when Float::INFINITY; return d <=> 1
+ when -Float::INFINITY; return d <=> -1
when Numeric; return d
else
begin