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

ruby-changes:18575

From: ryan <ko1@a...>
Date: Wed, 19 Jan 2011 07:38:41 +0900 (JST)
Subject: [ruby-changes:18575] Ruby:r30598 (trunk): Reverting nobu's rubygems patch. It needs: 1) to have a test, 2) to be UTF8, and 3) to work on 1.8 (see Gem.read_binary). (It should also be submitted to the rubygems repo or tracker)

ryan	2011-01-19 07:38:34 +0900 (Wed, 19 Jan 2011)

  New Revision: 30598

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

  Log:
    Reverting nobu's rubygems patch. It needs: 1) to have a test, 2) to be UTF8, and 3) to work on 1.8 (see Gem.read_binary). (It should also be submitted to the rubygems repo or tracker)

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30597)
+++ ChangeLog	(revision 30598)
@@ -24,12 +24,6 @@
 
 	* eval_intern.h: parenthesize macro arguments.
 
-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
Index: lib/rubygems/source_index.rb
===================================================================
--- lib/rubygems/source_index.rb	(revision 30597)
+++ lib/rubygems/source_index.rb	(revision 30598)
@@ -85,7 +85,11 @@
     def load_specification(file_name)
       return nil unless file_name and File.exist? file_name
 
-      spec_code = File.binread(file_name).untaint
+      spec_code = if defined? Encoding then
+                    File.read file_name, :encoding => 'UTF-8'
+                  else
+                    File.read file_name
+                  end.untaint
 
       begin
         gemspec = eval spec_code, binding, file_name

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

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