diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-30 08:59:16 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-30 08:59:16 +0000 |
commit | a1f76cae297fbdddebc6e16b3a274686893565ff (patch) | |
tree | 6fe209baa581b08053a531b0bbe5ad17df8d2222 /lib | |
parent | ecebf2f2365a5d8e7c6629a39580d47d586a0e40 (diff) | |
download | ruby-a1f76cae297fbdddebc6e16b3a274686893565ff.tar.gz ruby-a1f76cae297fbdddebc6e16b3a274686893565ff.tar.xz ruby-a1f76cae297fbdddebc6e16b3a274686893565ff.zip |
* gem_prelude.rb (push_all_highest_version_gems_on_load_path):
simplified.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/installer.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/test_utilities.rb | 27 |
2 files changed, 8 insertions, 21 deletions
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index e9910876f..d6075dd0a 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -325,7 +325,7 @@ class Gem::Installer @spec.executables.each do |filename| filename.untaint - bin_path = File.expand_path File.join(@gem_dir, @spec.bindir, filename) + bin_path = File.expand_path("#{@spec.bindir}/#{filename}", @gem_dir) mode = File.stat(bin_path).mode | 0111 File.chmod mode, bin_path diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb index 85541c9fc..751c13441 100644 --- a/lib/rubygems/test_utilities.rb +++ b/lib/rubygems/test_utilities.rb @@ -102,30 +102,17 @@ end #-- # This class was added to flush out problems in Rubinius' IO implementation. -class TempIO - - @@count = 0 - +class TempIO < Tempfile def initialize(string = '') - @tempfile = Tempfile.new "TempIO-#{@@count += 1}" - @tempfile.binmode - @tempfile.write string - @tempfile.rewind - end - - def method_missing(meth, *args, &block) - @tempfile.send(meth, *args, &block) - end - - def respond_to?(meth) - @tempfile.respond_to? meth + super "TempIO" + binmode + write string + rewind end def string - @tempfile.flush - - Gem.read_binary @tempfile.path + flush + Gem.read_binary path end - end |