From 7fe22152fc28084f4395fece84ff6e5eb2d6b288 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 24 Jan 2021 16:16:47 +0900 Subject: [ruby/rdoc] Support other date formats in git-log https://github.com/ruby/rdoc/commit/ad8cf37d72 --- lib/rdoc/parser/changelog.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/rdoc') 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 -- cgit v1.2.3