ruby-changes:45004
From: nobu <ko1@a...>
Date: Wed, 14 Dec 2016 17:26:01 +0900 (JST)
Subject: [ruby-changes:45004] nobu:r57077 (trunk): vcs.rb: no ext/date in vcs.rb
nobu 2016-12-14 17:25:56 +0900 (Wed, 14 Dec 2016) New Revision: 57077 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57077 Log: vcs.rb: no ext/date in vcs.rb * tool/vcs.rb (VCS::GIT#export_changelog): do not require date extension library so that miniruby can run. [ruby-core:78641] [Bug #13032] Modified files: trunk/tool/vcs.rb Index: tool/vcs.rb =================================================================== --- tool/vcs.rb (revision 57076) +++ tool/vcs.rb (revision 57077) @@ -1,6 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L1 # vcs require 'fileutils' -require 'time' # This library is used by several other tools/ scripts to detect the current # VCS in use (e.g. SVN, Git) or to interact with that VCS. @@ -446,7 +445,9 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L445 s.sub!(/^git-svn-id: .*@(\d+) .*\n+\z/, '') rev = $1 s.gsub!(/^ {8}/, '') if /^(?! {8}|$)/ !~ s - date = Time.strptime(time, "%Y-%m-%d %T %z").strftime("%a, %d %b %y") + if /\A(\d+)-(\d+)-(\d+)/ =~ time + date = Time.new($1.to_i, $2.to_i, $3.to_i).strftime("%a, %d %b %Y") + end w.puts "r#{rev} | #{author} | #{time} (#{date}) | #{s.count("\n")} lines\n\n" w.puts s, sep end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/