diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-05 14:03:34 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-05 14:03:34 +0000 |
commit | 5fa7cdbde54bed9bda3f9de20d621989a19ddc3b () | |
tree | fdb4f26212caebd3f88b3869e2e5b4ca9106e51f /lib/time.rb | |
parent | 2d8841791facb07155c710d8a7db7b0bf8be0d21 (diff) |
Time.parse's "now" argument as nil works again.
* lib/time.rb (make_time): "now" argument as nil works again. This is broken since Ruby 2.2. Mathieu Jobin pointed a problem. https://.com/ruby/ruby/commit/e4b05d91eb0d48fd172abf015c493bb42d755d07#commitcomment-17421387 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/time.rb | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -254,14 +254,18 @@ class Time raise ArgumentError, "no time information in #{date.inspect}" end - off_year = year || now.year off = nil - off = zone_offset(zone, off_year) if zone - if off - now = now.getlocal(off) if now.utc_offset != off - else - now = now.getlocal end usec = nil |