diff --git a/lib/rubygems.rb b/lib/rubygems.rb index d3a1f7c7b5..f6fece60a6 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -121,7 +121,7 @@ class << Gem # -The RubyGems Team module Gem - VERSION = '1.8.24' + VERSION = '1.8.25' ## # Raised when RubyGems is unable to load or activate a gem. Contains the diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index 508ff84a0f..cf0fdd00d2 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -165,7 +165,7 @@ def install_executables(bin_dir) end dest_file = File.join bin_dir, bin_file_formatted - bin_tmp_file = File.join Dir.tmpdir, bin_file + bin_tmp_file = File.join Dir.tmpdir, "#{bin_file}.#{$$}" begin bin = File.readlines bin_file diff --git a/lib/rubygems/indexer.rb b/lib/rubygems/indexer.rb index e87e5a3632..ddd4435e90 100644 --- a/lib/rubygems/indexer.rb +++ b/lib/rubygems/indexer.rb @@ -584,6 +584,9 @@ def update_index specs = map_gems_to_specs updated_gems prerelease, released = specs.partition { |s| s.version.prerelease? } + Gem::Specification.dirs = [] + Gem::Specification.add_specs(*specs) + files = build_marshal_gemspecs Gem.time 'Updated indexes' do diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index 31fb1209c9..514316f099 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -435,7 +435,13 @@ def process_options def check_that_user_bin_dir_is_in_path user_bin_dir = @bin_dir || Gem.bindir(gem_home) user_bin_dir.gsub!(File::SEPARATOR, File::ALT_SEPARATOR) if File::ALT_SEPARATOR - unless ENV['PATH'].split(File::PATH_SEPARATOR).include? user_bin_dir then + path = ENV['PATH'] + if Gem.win_platform? then + path = path.downcase + user_bin_dir = user_bin_dir.downcase + end + + unless path.split(File::PATH_SEPARATOR).include? user_bin_dir then unless self.class.path_warning then alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables will not run." self.class.path_warning = true diff --git a/lib/rubygems/package/tar_input.rb b/lib/rubygems/package/tar_input.rb index 77b4d698da..5d799381ba 100644 --- a/lib/rubygems/package/tar_input.rb +++ b/lib/rubygems/package/tar_input.rb @@ -5,7 +5,6 @@ #-- require 'zlib' -Gem.load_yaml class Gem::Package::TarInput diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb index 7abff01c39..efde4fd191 100644 --- a/lib/rubygems/requirement.rb +++ b/lib/rubygems/requirement.rb @@ -135,6 +135,7 @@ def yaml_initialize(tag, vals) # :nodoc: instance_variable_set "@#{ivar}", val end + Gem.load_yaml fix_syck_default_key_in_requirements end diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 70a3fd09b4..1a0130ca68 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- #-- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. # All rights reserved. @@ -1720,7 +1721,9 @@ def ruby_code(obj) when Numeric then obj.inspect when true, false, nil then obj.inspect when Gem::Platform then "Gem::Platform.new(#{obj.to_a.inspect})" - when Gem::Requirement then "Gem::Requirement.new(#{obj.to_s.inspect})" + when Gem::Requirement then + list = obj.as_list + "Gem::Requirement.new(#{ruby_code(list.size == 1 ? obj.to_s : list)})" else raise Gem::Exception, "ruby_code case not handled: #{obj.class}" end end @@ -1946,6 +1949,7 @@ def to_yaml(opts = {}) # :nodoc: ast = builder.tree io = StringIO.new + io.set_encoding Encoding::UTF_8 if Object.const_defined? :Encoding Psych::Visitors::Emitter.new(io).accept(ast) diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 9fbdfca52e..3e5821a447 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -417,6 +417,11 @@ def util_build_gem(spec) end end + def util_remove_gem(spec) + FileUtils.rm_rf spec.cache_file + FileUtils.rm_rf spec.spec_file + end + ## # Removes all installed gems from +@gemhome+. diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb index 2ced9ccdfb..d215a817fb 100644 --- a/lib/rubygems/version.rb +++ b/lib/rubygems/version.rb @@ -187,7 +187,7 @@ def initialize version raise ArgumentError, "Malformed version number string #{version}" unless self.class.correct?(version) - @version = version.to_s + @version = version.to_s.dup @version.strip! end