summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-12 15:51:31 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-12 15:51:31 +0000
commitce430673bef566cf11b58ed4c2b7887f0912717f (patch)
treef4ffa2655cb82bd0f4ca6b56c4b404ff0d5b0864 /lib
parent2eb7b57164da81ae8738395960941bbb145500ff (diff)
* lib/date.rb (Date#===): [ruby-core:35127]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/date.rb11
-rw-r--r--lib/date/delta.rb2
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/date.rb b/lib/date.rb
index 43814792f7..079a6059bb 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -1,7 +1,7 @@
#
# date.rb - date and time library
#
-# Author: Tadayoshi Funaba 1998-2010
+# Author: Tadayoshi Funaba 1998-2011
#
# Documentation: William Webber <william@williamwebber.com>
#
@@ -1103,7 +1103,7 @@ class Date
end
end;
end
- end
+ end # <<dummy
private :once
@@ -1399,8 +1399,11 @@ class Date
when Numeric; return jd == other
when Date; return jd == other.jd
else
- l, r = other.coerce(self)
- return l === r
+ begin
+ l, r = other.coerce(self)
+ return l === r
+ rescue NoMethodError
+ end
end
false
end
diff --git a/lib/date/delta.rb b/lib/date/delta.rb
index 51c857e78a..e524cbc324 100644
--- a/lib/date/delta.rb
+++ b/lib/date/delta.rb
@@ -231,7 +231,7 @@ class Date
@delta.real / (u * RUNITS['#{k}'])
end
end;
- end
+ end # <<dummy
alias_method :in_mins, :in_minutes
alias_method :in_secs, :in_seconds