[前][次][番号順一覧][スレッド一覧]

ruby-changes:31545

From: nobu <ko1@a...>
Date: Sun, 10 Nov 2013 01:37:50 +0900 (JST)
Subject: [ruby-changes:31545] nobu:r43624 (trunk): rbinstall.rb: fix for non-working directory

nobu	2013-11-10 01:37:46 +0900 (Sun, 10 Nov 2013)

  New Revision: 43624

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43624

  Log:
    rbinstall.rb: fix for non-working directory
    
    * tool/rbinstall.rb (Gem::Specification.last_date): skip if failed to
      get info from VCS, for example, in the case circumstance sharing working
      directory with another machine and run vcs tools cannot work.

  Modified files:
    trunk/tool/rbinstall.rb
    trunk/tool/vcs.rb
Index: tool/rbinstall.rb
===================================================================
--- tool/rbinstall.rb	(revision 43623)
+++ tool/rbinstall.rb	(revision 43624)
@@ -579,7 +579,8 @@ module Gem https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L579
 
     def self.last_date(path)
       return unless $vcs
-      return unless time = $vcs.get_revisions(path)[2]
+      time = $vcs.get_revisions(path)[2] rescue return
+      return unless time
       time.strftime("%Y-%m-%d")
     end
 
Index: tool/vcs.rb
===================================================================
--- tool/vcs.rb	(revision 43623)
+++ tool/vcs.rb	(revision 43624)
@@ -43,8 +43,8 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L43
   def get_revisions(path)
     path = relative_to(path)
     last, changed, modified, *rest = Dir.chdir(@srcdir) {self.class.get_revisions(path)}
-    last or raise "last revision not found"
-    changed or raise "changed revision not found"
+    last or raise VCS::NotFoundError, "last revision not found"
+    changed or raise VCS::NotFoundError, "changed revision not found"
     modified &&= Time.parse(modified)
     return last, changed, modified, *rest
   end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]