summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-17 21:49:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-17 21:49:40 +0000
commitf8cf213ba2789ecd8b477d4dcb40419a619e406a (patch)
tree16ee534d7ca6a50b6b92110fd06536168c8c0d4b /lib
parent0b38e9bc9d030539d1a2b70f7075a92b4c5b2213 (diff)
* 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
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/source_index.rb6
1 files changed, 1 insertions, 5 deletions
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