diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-31 08:08:46 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-31 08:08:46 +0000 |
| commit | 2a67022c4fa43af0b0db2d482c688f3f12d37455 (patch) | |
| tree | 1a6f90a433512f1f5be08298ab8ccee9feb2d9ba /lib/time.rb | |
| parent | 5e650dd1c2176f0c7ed7d18f3e369e9fea72b125 (diff) | |
| download | ruby-2a67022c4fa43af0b0db2d482c688f3f12d37455.tar.gz ruby-2a67022c4fa43af0b0db2d482c688f3f12d37455.tar.xz ruby-2a67022c4fa43af0b0db2d482c688f3f12d37455.zip | |
* time.c (time_dup): duplicate the class of original time.
[ruby-core:09357]
* lib/time.rb (Time::make_time, Time::rfc2822, Time::httpdate):
should respect subclasses. [ruby-core:09357]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/time.rb')
| -rw-r--r-- | lib/time.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/time.rb b/lib/time.rb index b96c6e73d..f7a08e947 100644 --- a/lib/time.rb +++ b/lib/time.rb @@ -181,7 +181,7 @@ class Time t.localtime if !zone_utc?(zone) t else - Time.local(year, mon, day, hour, min, sec, usec) + self.local(year, mon, day, hour, min, sec, usec) end end private :make_time @@ -304,7 +304,7 @@ class Time year, mon, day, hour, min, sec = apply_offset(year, mon, day, hour, min, sec, zone_offset(zone)) - t = Time.utc(year, mon, day, hour, min, sec) + t = self.utc(year, mon, day, hour, min, sec) t.localtime if !zone_utc?(zone) t else @@ -331,14 +331,14 @@ class Time (\d{2}):(\d{2}):(\d{2})\x20 GMT \s*\z/ix =~ date - Time.rfc2822(date) + self.rfc2822(date) elsif /\A\s* (?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday),\x20 (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d)\x20 (\d\d):(\d\d):(\d\d)\x20 GMT \s*\z/ix =~ date - Time.parse(date) + self.parse(date) elsif /\A\s* (?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)\x20 (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\x20 @@ -346,7 +346,7 @@ class Time (\d\d):(\d\d):(\d\d)\x20 (\d{4}) \s*\z/ix =~ date - Time.utc($6.to_i, MonthValue[$1.upcase], $2.to_i, + self.utc($6.to_i, MonthValue[$1.upcase], $2.to_i, $3.to_i, $4.to_i, $5.to_i) else raise ArgumentError.new("not RFC 2616 compliant date: #{date.inspect}") |
