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

ruby-changes:25924

From: drbrain <ko1@a...>
Date: Thu, 29 Nov 2012 16:18:34 +0900 (JST)
Subject: [ruby-changes:25924] drbrain:r37981 (trunk): * lib/rubygems/test_case.rb: Disable loading of keys and certificates

drbrain	2012-11-29 16:18:26 +0900 (Thu, 29 Nov 2012)

  New Revision: 37981

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

  Log:
    * lib/rubygems/test_case.rb:  Disable loading of keys and certificates
      outside rubygems or ruby tests as the files are not available (or
      necessary).

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/test_case.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37980)
+++ ChangeLog	(revision 37981)
@@ -1,3 +1,9 @@
+Thu Nov 29 16:18:14 2012  Eric Hodel  <drbrain@s...>
+
+	* lib/rubygems/test_case.rb:  Disable loading of keys and certificates
+	  outside rubygems or ruby tests as the files are not available (or
+          necessary).
+
 Thu Nov 29 16:14:41 2012  Koichi Sasada  <ko1@a...>
 
 	* vm_backtrace.c (rb_debug_inspector_open): use RARRAY_LENINT() for
Index: lib/rubygems/test_case.rb
===================================================================
--- lib/rubygems/test_case.rb	(revision 37980)
+++ lib/rubygems/test_case.rb	(revision 37981)
@@ -1006,9 +1006,18 @@
     File.expand_path "../../../test/rubygems/#{key_name}_key.pem", __FILE__
   end
 
-  PRIVATE_KEY = load_key 'private'
-  PUBLIC_KEY  = PRIVATE_KEY.public_key
+  # :stopdoc:
+  # only available in RubyGems tests
 
-  PUBLIC_CERT = load_cert 'public'
+  begin
+    PRIVATE_KEY = load_key 'private'
+    PUBLIC_KEY  = PRIVATE_KEY.public_key
 
+    PUBLIC_CERT = load_cert 'public'
+  rescue Errno::ENOENT
+    PRIVATE_KEY = nil
+    PUBLIC_KEY  = nil
+    PUBLIC_CERT = nil
+  end
+
 end

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

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