mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
lib/date.rb: Backport #2707 [ruby-core:28011]; backport r27014 to fix problem with Date#>> and very small numbers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@28233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
13e40bdaa0
commit
44c8d6c4db
3 changed files with 12 additions and 5 deletions
|
|
@ -1,8 +1,11 @@
|
||||||
Wed June 9 01:05:00 Kirk Haines <khaines@ruby-lang.org>
|
Wed Jun 9 01:42:00 Kirk Haines <khaines@ruby-lang.org>
|
||||||
|
|
||||||
* lib/monitor.rb: Backport #2240 [ruby-core:26185]; backport r25420 to ensure that the scheduled thread is alive when a monitor is released.
|
* lib/date.rb: Backport #2707 [ruby-core:28011]; backport r27014 to fix problem with Date#>> and very small numbers.
|
||||||
* test/monitor/test_monitor.rb: Backport #2240 [ruby-core:26185]; added a test for the above functionality.
|
|
||||||
|
|
||||||
|
Wed Jun 9 01:05:00 Kirk Haines <khaines@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/monitor.rb: Backport #2240 [ruby-core:26185]; backport r25420 to ensure that the scheduled thread is alive when a monitor is released. r28232
|
||||||
|
* test/monitor/test_monitor.rb: Backport #2240 [ruby-core:26185]; added a test for the above functionality. r28232
|
||||||
|
|
||||||
Tue Jun 8 23:45:00 2010 Kirk Haines <khaines@ruby-lang.org>
|
Tue Jun 8 23:45:00 2010 Kirk Haines <khaines@ruby-lang.org>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1273,7 +1273,11 @@ class Date
|
||||||
y, m = (year * 12 + (mon - 1) + n).divmod(12)
|
y, m = (year * 12 + (mon - 1) + n).divmod(12)
|
||||||
m, = (m + 1) .divmod(1)
|
m, = (m + 1) .divmod(1)
|
||||||
d = mday
|
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)
|
self + (jd2 - jd)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#define RUBY_RELEASE_DATE "2010-06-09"
|
#define RUBY_RELEASE_DATE "2010-06-09"
|
||||||
#define RUBY_VERSION_CODE 186
|
#define RUBY_VERSION_CODE 186
|
||||||
#define RUBY_RELEASE_CODE 20100609
|
#define RUBY_RELEASE_CODE 20100609
|
||||||
#define RUBY_PATCHLEVEL 408
|
#define RUBY_PATCHLEVEL 409
|
||||||
|
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
#define RUBY_VERSION_MINOR 8
|
#define RUBY_VERSION_MINOR 8
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue