summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-11 21:23:47 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-11 21:23:47 +0000
commitad558ae184116f7c3806c0f420f0ed6a864f9373 (patch)
tree5057211a56430eff023a68f99b14892edd13aeff /lib
parent6a2bd5fcb68568e4b5d8992c0107c7d4338fa958 (diff)
merges r30856 from trunk into ruby_1_9_2.
-- * lib/date.rb (Date#===): [ruby-core:35127] -- * test/date/test_date.rb (TestDate#test_coerce): test for [ruby-core:35127]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31516 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 e4773ef897..ebbc8b581e 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>
#
@@ -1110,7 +1110,7 @@ class Date
end
end;
end
- end
+ end # <<dummy
private :once
@@ -1392,8 +1392,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 eacfdefc62..d2ed5e86d3 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