summaryrefslogtreecommitdiff
path: root/tool/vcs.rb
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-15 20:44:54 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-15 20:44:54 +0000
commit5559e75ea557217b5298a2000315e472b03725c8 (patch)
treebd74003c41c3274a2407ca59686cf552d34d9a2a /tool/vcs.rb
parent0e590199f9592fe6a513ecae18d0724f0e69260c (diff)
tool/vcs.rb: fix Ruby 1.8 compatibility
Symbol#to_proc is not standard in Ruby 1.8 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/vcs.rb')
-rw-r--r--tool/vcs.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb
index 0866131..8b99533 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -93,8 +93,9 @@ class VCS
if modified
/\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 }
begin
- modified = Time.new(*$~[1..6].map(&:to_i), ($7 ? "#{$7}:#{$8}" : "+00:00"))
+ modified = Time.new(*match, ($7 ? "#{$7}:#{$8}" : "+00:00"))
rescue ArgumentError
modified = Time.utc(*$~[1..6]) + $7.to_i * 3600 + $8.to_i * 60
end