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

ruby-changes:18566

From: nobu <ko1@a...>
Date: Tue, 18 Jan 2011 06:49:52 +0900 (JST)
Subject: [ruby-changes:18566] Ruby:r30589 (trunk): * lib/rubygems/source_index.rb (Gem#load_specification): read in

nobu	2011-01-18 06:49:40 +0900 (Tue, 18 Jan 2011)

  New Revision: 30589

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

  Log:
    * lib/rubygems/source_index.rb (Gem#load_specification): read in
      binary mode to get rid of failures caused by mismatch between
      default internal encoding and encoding comments.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30588)
+++ ChangeLog	(revision 30589)
@@ -1,3 +1,9 @@
+Tue Jan 18 06:49:38 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/rubygems/source_index.rb (Gem#load_specification): read in
+	  binary mode to get rid of failures caused by mismatch between
+	  default internal encoding and encoding comments.
+
 Tue Jan 18 04:42:44 2011  Aaron Patterson <aaron@t...>
 
 	* ext/psych/lib/psych/parser.rb (Mark): Adding a class to wrap
@@ -2,6 +8,6 @@
 	  marker information
-	
+
 	* ext/psych/parser.c (mark): Add a method to return the mark object
 	  for the parser
-	
+
 	* test/psych/test_parser.rb: tests for the Mark class.
@@ -163,7 +169,7 @@
 
 Wed Jan 12 16:25:12 2011  Yuki Sonoda (Yugui)  <yugui@y...>
 
-	* lib/net/http.rb (Net::HTTP#connect): makes it timeout during 
+	* lib/net/http.rb (Net::HTTP#connect): makes it timeout during
 	  SSL handshake too. [ruby-core:34203]
 	  Patch by Marc Slemko.
 
@@ -175,7 +181,7 @@
 
 Wed Jan 12 16:24:53 2011  Yuki Sonoda (Yugui)  <yugui@y...>
 
-	* ext/readline/extconf.rb: new checks for RL_PROMPT_START_IGNORE 
+	* ext/readline/extconf.rb: new checks for RL_PROMPT_START_IGNORE
 	  and RL_PROMPT_END_IGNORE. [ruby-core:34331]
 
 	* ext/readline/readline.c: enables USE_INSERT_IGNORE_ESCAPE only if
Index: lib/rubygems/source_index.rb
===================================================================
--- lib/rubygems/source_index.rb	(revision 30588)
+++ lib/rubygems/source_index.rb	(revision 30589)
@@ -85,11 +85,7 @@
     def load_specification(file_name)
       return nil unless file_name and File.exist? file_name
 
-      spec_code = if defined? Encoding then
-                    File.read file_name, :encoding => 'UTF-8'
-                  else
-                    File.read file_name
-                  end.untaint
+      spec_code = File.binread(file_name).untaint
 
       begin
         gemspec = eval spec_code, binding, file_name

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

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