summaryrefslogtreecommitdiff
path: root/tool/vcs.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 06:26:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 06:26:26 +0000
commitf20f84d60a467c1bc8a0ca81fe2788fa4c8079f8 (patch)
treeaa2b5b381fe71da86f15d2fa812f52436c4baef5 /tool/vcs.rb
parent913ed016c1efa45afd78c6c56484bbdd0fde9454 (diff)
vcs.rb: make Time with proper offset
* tool/vcs.rb (get_revisions): use Time.new instead of Time.mktime which does not accept UTC offset, and offset manually for older versions than 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/vcs.rb')
-rw-r--r--tool/vcs.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb
index b3f3a31..49c7064 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -62,7 +62,11 @@ 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}"
- modified = Time.mktime(*($~[1..6] + [$7 ? "#{$7}:#{$8}" : "+00:00"]))
+ begin
+ modified = Time.new(*$~[1..6].map(&:to_i), ($7 ? "#{$7}:#{$8}" : "+00:00"))
+ rescue ArgumentError
+ modified = Time.utc(*$~[1..6]) + $7.to_i * 3600 + $8.to_i * 60
+ end
end
return last, changed, modified, *rest
end