summaryrefslogtreecommitdiff
path: root/lib/rdoc/parser/changelog.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-24 16:16:47 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-25 18:33:31 +0900
commit7fe22152fc28084f4395fece84ff6e5eb2d6b288 (patch)
treea85c5ab1201d5aa596d03808c9c4a5c7672406f3 /lib/rdoc/parser/changelog.rb
parent5411fb8cffc6a2112b07243c7f4a4a87702f2af0 (diff)
[ruby/rdoc] Support other date formats in git-log
https://github.com/ruby/rdoc/commit/ad8cf37d72
Diffstat (limited to 'lib/rdoc/parser/changelog.rb')
-rw-r--r--lib/rdoc/parser/changelog.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rdoc/parser/changelog.rb b/lib/rdoc/parser/changelog.rb
index 9ef7678875..25123492cc 100644
--- a/lib/rdoc/parser/changelog.rb
+++ b/lib/rdoc/parser/changelog.rb
@@ -231,13 +231,13 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
# date = header["CommitDate"] || header["Date"]
date = header[/^ *(?:Author)?Date: +(.*)/, 1]
author = header[/^ *Author: +(.*)/, 1]
- if /(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+) *([-+]\d\d)(\d\d)/ =~
- (header[/^ *CommitDate: +(.*)/, 1] || date)
- time = Time.new($1, $2, $3, $4, $5, $6, "#{$7}:#{$8}")
+ begin
+ time = parse_date(header[/^ *CommitDate: +(.*)/, 1] || date)
@time_cache[entry_name] = time
author.sub!(/\s*<(.*)>/, '')
email = $1
entries << [entry_name, [author, email, date, entry_body]]
+ rescue ArgumentError
end
end