From f8cf213ba2789ecd8b477d4dcb40419a619e406a Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 17 Jan 2011 21:49:40 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 14 ++++++++++---- lib/rubygems/source_index.rb | 6 +----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56706e596d..9fc4351776 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,17 @@ +Tue Jan 18 06:49:38 2011 Nobuyoshi Nakada + + * 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 * ext/psych/lib/psych/parser.rb (Mark): Adding a class to wrap 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. Tue Jan 18 02:46:55 2011 Aaron Patterson @@ -163,7 +169,7 @@ Wed Jan 12 19:09:29 2011 Tanaka Akira Wed Jan 12 16:25:12 2011 Yuki Sonoda (Yugui) - * 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:25:12 2011 Yuki Sonoda (Yugui) Wed Jan 12 16:24:53 2011 Yuki Sonoda (Yugui) - * 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 diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb index 4700fbbb89..20b27733fc 100644 --- a/lib/rubygems/source_index.rb +++ b/lib/rubygems/source_index.rb @@ -85,11 +85,7 @@ class Gem::SourceIndex 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