mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
tool/vcs.rb: fix Ruby 1.8 compatibility harder
Arguments after splat do not work under 1.8, either. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2c2bdb8b51
commit
9aeb74d0de
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Dec 16 08:53:12 2014 Eric Wong <e@80x24.org>
|
||||
|
||||
* tool/vcs.rb: fix Ruby 1.8 compatibility harder
|
||||
|
||||
Tue Dec 16 07:37:18 2014 Eric Wong <e@80x24.org>
|
||||
|
||||
* gc.c (GC_HEAP_FREE_SLOTS): move definition to match use order
|
||||
|
|
|
@ -94,8 +94,10 @@ class VCS
|
|||
/\A(\d+)-(\d+)-(\d+)\D(\d+):(\d+):(\d+(?:\.\d+)?)\s*(?:Z|([-+]\d\d)(\d\d))\z/ =~ modified or
|
||||
raise "unknown time format - #{modified}"
|
||||
match = $~[1..6].map { |x| x.to_i }
|
||||
off = $7 ? "#{$7}:#{$8}" : "+00:00"
|
||||
match << off
|
||||
begin
|
||||
modified = Time.new(*match, ($7 ? "#{$7}:#{$8}" : "+00:00"))
|
||||
modified = Time.new(*match)
|
||||
rescue ArgumentError
|
||||
modified = Time.utc(*$~[1..6]) + $7.to_i * 3600 + $8.to_i * 60
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue