diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-08 04:45:42 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-08 04:45:42 +0000 |
commit | 78492e51d818c193eb0b2a2546c6016c07a46fcd (patch) | |
tree | b0a807515add3269df4340ac796867d8a442dab1 | |
parent | cbf33c59ded17f32783954a2226df63af9089504 (diff) |
merge revision(s) 27014:
* lib/date.rb (Date#>>): fixed. [ruby-core:28011]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@28204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/date.rb | 7 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,7 @@ +Tue Jun 8 13:40:04 2010 Tadayoshi Funaba <tadf@dotrb.org> + + * lib/date.rb (Date#>>): fixed. [ruby-core:28011] + Tue Jun 8 12:37:56 2010 NARUSE, Yui <naruse@ruby-lang.org> * io.c, eval.c, process.c: add linux to r26371's condition. diff --git a/lib/date.rb b/lib/date.rb index 19991d60b4..37c7630895 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -1,7 +1,7 @@ # # date.rb - date and time library # -# Author: Tadayoshi Funaba 1998-2008 +# Author: Tadayoshi Funaba 1998-2010 # # Documentation: William Webber <william@williamwebber.com> # @@ -1305,7 +1305,10 @@ class Date y, m = (year * 12 + (mon - 1) + n).divmod(12) m, = (m + 1) .divmod(1) d = mday - d -= 1 until jd2 = self.class.valid_civil?(y, m, d, fix_style) + until jd2 = self.class.valid_civil?(y, m, d, fix_style) + d -= 1 + raise ArgumentError, 'invalid date' unless d > 0 + end self + (jd2 - jd) end @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2010-06-08" #define RUBY_VERSION_CODE 187 #define RUBY_RELEASE_CODE 20100608 -#define RUBY_PATCHLEVEL 269 +#define RUBY_PATCHLEVEL 270 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 |