diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-18 22:38:34 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-18 22:38:34 +0000 |
commit | d26fb035cae8d351dc238376722c980230dc5fbd (patch) | |
tree | 842002e3e615adff2c1272608f3d831639cdf51c /lib/rubygems/source_index.rb | |
parent | a525f4d5fbc4aae78ba20826360161db14af147b (diff) |
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)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/source_index.rb')
-rw-r--r-- | lib/rubygems/source_index.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb index 20b27733fc..4700fbbb89 100644 --- a/lib/rubygems/source_index.rb +++ b/lib/rubygems/source_index.rb @@ -85,7 +85,11 @@ class Gem::SourceIndex 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 |