ruby-changes:36775
From: normal <ko1@a...>
Date: Tue, 16 Dec 2014 09:08:22 +0900 (JST)
Subject: [ruby-changes:36775] normal:r48856 (trunk): tool/vcs.rb: fix Ruby 1.8 compatibility harder
normal 2014-12-16 09:08:14 +0900 (Tue, 16 Dec 2014) New Revision: 48856 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48856 Log: tool/vcs.rb: fix Ruby 1.8 compatibility harder Arguments after splat do not work under 1.8, either. Modified files: trunk/ChangeLog trunk/tool/vcs.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 48855) +++ ChangeLog (revision 48856) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Dec 16 08:53:12 2014 Eric Wong <e@8...> + + * tool/vcs.rb: fix Ruby 1.8 compatibility harder + Tue Dec 16 07:37:18 2014 Eric Wong <e@8...> * gc.c (GC_HEAP_FREE_SLOTS): move definition to match use order Index: tool/vcs.rb =================================================================== --- tool/vcs.rb (revision 48855) +++ tool/vcs.rb (revision 48856) @@ -94,8 +94,10 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L94 /\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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/