[前][次][番号順一覧][スレッド一覧]

ruby-changes:32779

From: naruse <ko1@a...>
Date: Thu, 6 Feb 2014 11:59:54 +0900 (JST)
Subject: [ruby-changes:32779] naruse:r44858 (ruby_2_1): * lib/rubygems: RubyGems 2.2.2 which contains the following bug fixes:

naruse	2014-02-06 11:59:36 +0900 (Thu, 06 Feb 2014)

  New Revision: 44858

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44858

  Log:
    * lib/rubygems: RubyGems 2.2.2 which contains the following bug fixes:
      http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.2.2+%2F+2014-02-05
      https://bugs.ruby-lang.org/issues/9489

  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/NEWS
    branches/ruby_2_1/lib/rubygems/available_set.rb
    branches/ruby_2_1/lib/rubygems/basic_specification.rb
    branches/ruby_2_1/lib/rubygems/commands/contents_command.rb
    branches/ruby_2_1/lib/rubygems/commands/generate_index_command.rb
    branches/ruby_2_1/lib/rubygems/commands/install_command.rb
    branches/ruby_2_1/lib/rubygems/commands/setup_command.rb
    branches/ruby_2_1/lib/rubygems/compatibility.rb
    branches/ruby_2_1/lib/rubygems/config_file.rb
    branches/ruby_2_1/lib/rubygems/defaults.rb
    branches/ruby_2_1/lib/rubygems/dependency_installer.rb
    branches/ruby_2_1/lib/rubygems/deprecate.rb
    branches/ruby_2_1/lib/rubygems/ext/ext_conf_builder.rb
    branches/ruby_2_1/lib/rubygems/installer.rb
    branches/ruby_2_1/lib/rubygems/package/tar_header.rb
    branches/ruby_2_1/lib/rubygems/platform.rb
    branches/ruby_2_1/lib/rubygems/rdoc.rb
    branches/ruby_2_1/lib/rubygems/remote_fetcher.rb
    branches/ruby_2_1/lib/rubygems/request.rb
    branches/ruby_2_1/lib/rubygems/request_set/lockfile.rb
    branches/ruby_2_1/lib/rubygems/request_set.rb
    branches/ruby_2_1/lib/rubygems/resolver/api_set.rb
    branches/ruby_2_1/lib/rubygems/resolver/best_set.rb
    branches/ruby_2_1/lib/rubygems/resolver/composed_set.rb
    branches/ruby_2_1/lib/rubygems/resolver/git_set.rb
    branches/ruby_2_1/lib/rubygems/resolver/index_set.rb
    branches/ruby_2_1/lib/rubygems/resolver/installer_set.rb
    branches/ruby_2_1/lib/rubygems/resolver/lock_set.rb
    branches/ruby_2_1/lib/rubygems/resolver/set.rb
    branches/ruby_2_1/lib/rubygems/resolver/vendor_set.rb
    branches/ruby_2_1/lib/rubygems/resolver.rb
    branches/ruby_2_1/lib/rubygems/security.rb
    branches/ruby_2_1/lib/rubygems/source/git.rb
    branches/ruby_2_1/lib/rubygems/specification.rb
    branches/ruby_2_1/lib/rubygems/test_case.rb
    branches/ruby_2_1/lib/rubygems/uninstaller.rb
    branches/ruby_2_1/lib/rubygems/version.rb
    branches/ruby_2_1/lib/rubygems.rb
    branches/ruby_2_1/test/rubygems/test_gem.rb
    branches/ruby_2_1/test/rubygems/test_gem_commands_contents_command.rb
    branches/ruby_2_1/test/rubygems/test_gem_commands_environment_command.rb
    branches/ruby_2_1/test/rubygems/test_gem_commands_install_command.rb
    branches/ruby_2_1/test/rubygems/test_gem_commands_update_command.rb
    branches/ruby_2_1/test/rubygems/test_gem_dependency_installer.rb
    branches/ruby_2_1/test/rubygems/test_gem_ext_ext_conf_builder.rb
    branches/ruby_2_1/test/rubygems/test_gem_installer.rb
    branches/ruby_2_1/test/rubygems/test_gem_package_tar_header.rb
    branches/ruby_2_1/test/rubygems/test_gem_platform.rb
    branches/ruby_2_1/test/rubygems/test_gem_remote_fetcher.rb
    branches/ruby_2_1/test/rubygems/test_gem_request.rb
    branches/ruby_2_1/test/rubygems/test_gem_request_set.rb
    branches/ruby_2_1/test/rubygems/test_gem_request_set_lockfile.rb
    branches/ruby_2_1/test/rubygems/test_gem_resolver.rb
    branches/ruby_2_1/test/rubygems/test_gem_resolver_api_set.rb
    branches/ruby_2_1/test/rubygems/test_gem_resolver_best_set.rb
    branches/ruby_2_1/test/rubygems/test_gem_resolver_git_set.rb
    branches/ruby_2_1/test/rubygems/test_gem_resolver_index_set.rb
    branches/ruby_2_1/test/rubygems/test_gem_resolver_installer_set.rb
    branches/ruby_2_1/test/rubygems/test_gem_source_git.rb
    branches/ruby_2_1/test/rubygems/test_gem_specification.rb
    branches/ruby_2_1/test/rubygems/test_gem_uninstaller.rb
    branches/ruby_2_1/test/rubygems/test_gem_version.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 44857)
+++ ruby_2_1/ChangeLog	(revision 44858)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Thu Feb  6 11:27:39 2014  Eric Hodel  <drbrain@s...>
+
+	* lib/rubygems: RubyGems 2.2.2 which contains the following bug fixes:
+	  http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.2.2+%2F+2014-02-05
+	  https://bugs.ruby-lang.org/issues/9489
+
 Thu Feb  6 11:23:59 2014  Koichi Sasada  <ko1@a...>
 
 	* gc.c (ruby_gc_set_params): if RUBY_GC_OLDMALLOC_LIMIT is provided,
Index: ruby_2_1/lib/rubygems/basic_specification.rb
===================================================================
--- ruby_2_1/lib/rubygems/basic_specification.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/basic_specification.rb	(revision 44858)
@@ -207,6 +207,24 @@ class Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/basic_specification.rb#L207
   end
 
   ##
+  # Returns the paths to the source files for use with analysis and
+  # documentation tools.  These paths are relative to full_gem_path.
+
+  def source_paths
+    paths = raw_require_paths.dup
+
+    if @extensions then
+      ext_dirs = @extensions.map do |extension|
+        extension.split(File::SEPARATOR, 2).first
+      end.uniq
+
+      paths.concat ext_dirs
+    end
+
+    paths.uniq
+  end
+
+  ##
   # Return a Gem::Specification from this gem
 
   def to_spec
Index: ruby_2_1/lib/rubygems/rdoc.rb
===================================================================
--- ruby_2_1/lib/rubygems/rdoc.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/rdoc.rb	(revision 44858)
@@ -193,7 +193,7 @@ class Gem::RDoc # :nodoc: all https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/rdoc.rb#L193
     ::RDoc::Parser::C.reset
 
     args = @spec.rdoc_options
-    args.concat @spec.require_paths
+    args.concat @spec.source_paths
     args.concat @spec.extra_rdoc_files
 
     case config_args = Gem.configuration[:rdoc]
Index: ruby_2_1/lib/rubygems/available_set.rb
===================================================================
--- ruby_2_1/lib/rubygems/available_set.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/available_set.rb	(revision 44858)
@@ -4,9 +4,12 @@ class Gem::AvailableSet https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/available_set.rb#L4
 
   Tuple = Struct.new(:spec, :source)
 
+  attr_accessor :remote # :nodoc:
+
   def initialize
     @set = []
     @sorted = nil
+    @remote = true
   end
 
   attr_reader :set
Index: ruby_2_1/lib/rubygems/dependency_installer.rb
===================================================================
--- ruby_2_1/lib/rubygems/dependency_installer.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/dependency_installer.rb	(revision 44858)
@@ -419,6 +419,7 @@ class Gem::DependencyInstaller https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/dependency_installer.rb#L419
 
     request_set = as.to_request_set install_development_deps
     request_set.soft_missing = @force
+    request_set.remote = false unless consider_remote?
 
     installer_set = Gem::Resolver::InstallerSet.new @domain
     installer_set.always_install.concat request_set.always_install
Index: ruby_2_1/lib/rubygems/ext/ext_conf_builder.rb
===================================================================
--- ruby_2_1/lib/rubygems/ext/ext_conf_builder.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/ext/ext_conf_builder.rb	(revision 44858)
@@ -34,7 +34,11 @@ class Gem::Ext::ExtConfBuilder < Gem::Ex https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/ext/ext_conf_builder.rb#L34
         ENV["RUBYOPT"] = ["-r#{siteconf_path}", rubyopt].compact.join(' ')
         cmd = [Gem.ruby, File.basename(extension), *args].join ' '
 
-        run cmd, results
+        begin
+          run cmd, results
+        ensure
+          FileUtils.mv 'mkmf.log', dest_path if File.exist? 'mkmf.log'
+        end
 
         ENV["DESTDIR"] = nil
         ENV["RUBYOPT"] = rubyopt
Index: ruby_2_1/lib/rubygems/request_set.rb
===================================================================
--- ruby_2_1/lib/rubygems/request_set.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/request_set.rb	(revision 44858)
@@ -39,6 +39,11 @@ class Gem::RequestSet https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/request_set.rb#L39
   attr_accessor :ignore_dependencies
 
   ##
+  # When false no remote sets are used for resolving gems.
+
+  attr_accessor :remote
+
+  ##
   # Sets used for resolution
 
   attr_reader :sets # :nodoc:
@@ -71,6 +76,7 @@ class Gem::RequestSet https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/request_set.rb#L76
     @git_set             = nil
     @ignore_dependencies = false
     @install_dir         = Gem.dir
+    @remote              = true
     @requests            = []
     @sets                = []
     @soft_missing        = false
@@ -150,6 +156,7 @@ class Gem::RequestSet https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/request_set.rb#L156
     gemdeps = options[:gemdeps]
 
     @install_dir = options[:install_dir] || Gem.dir
+    @remote      = options[:domain] != :local
 
     load_gemdeps gemdeps, options[:without_groups]
 
@@ -235,6 +242,7 @@ class Gem::RequestSet https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/request_set.rb#L242
     @sets << @vendor_set
 
     set = Gem::Resolver.compose_sets(*@sets)
+    set.remote = @remote
 
     resolver = Gem::Resolver.new @dependencies, set
     resolver.development         = @development
Index: ruby_2_1/lib/rubygems/config_file.rb
===================================================================
--- ruby_2_1/lib/rubygems/config_file.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/config_file.rb	(revision 44858)
@@ -137,9 +137,10 @@ class Gem::ConfigFile https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/config_file.rb#L137
   attr_reader :ssl_verify_mode
 
   ##
-  # Path name of directory or file of openssl CA certificate, used for remote https connection
+  # Path name of directory or file of openssl CA certificate, used for remote
+  # https connection
 
-  attr_reader :ssl_ca_cert
+  attr_accessor :ssl_ca_cert
 
   ##
   # Path name of directory or file of openssl client certificate, used for remote https connection with client authentication
Index: ruby_2_1/lib/rubygems/compatibility.rb
===================================================================
--- ruby_2_1/lib/rubygems/compatibility.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/compatibility.rb	(revision 44858)
@@ -33,6 +33,8 @@ end https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/compatibility.rb#L33
 module Gem
   RubyGemsVersion = VERSION
 
+  # TODO remove at RubyGems 3
+
   RbConfigPriorities = %w[
     MAJOR
     MINOR
@@ -45,7 +47,7 @@ module Gem https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/compatibility.rb#L47
   unless defined?(ConfigMap)
     ##
     # Configuration settings from ::RbConfig
-    ConfigMap = Hash.new do |cm, key|
+    ConfigMap = Hash.new do |cm, key| # TODO remove at RubyGems 3
       cm[key] = RbConfig::CONFIG[key.to_s]
     end
   else
Index: ruby_2_1/lib/rubygems/specification.rb
===================================================================
--- ruby_2_1/lib/rubygems/specification.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/specification.rb	(revision 44858)
@@ -241,6 +241,28 @@ class Gem::Specification < Gem::BasicSpe https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/specification.rb#L241
   attr_reader :summary
 
   ##
+  # Singular writer for #authors
+  #
+  # Usage:
+  #
+  #   spec.author = 'John Jones'
+
+  def author= o
+    self.authors = [o]
+  end
+
+  ##
+  # Sets the list of authors, ensuring it is an array.
+  #
+  # Usage:
+  #
+  #   spec.authors = ['John Jones', 'Mary Smith']
+
+  def authors= value
+    @authors = Array(value).flatten.grep(String)
+  end
+
+  ##
   # The platform this gem runs on.
   #
   # This is usually Gem::Platform::RUBY or Gem::Platform::CURRENT.
@@ -327,7 +349,7 @@ class Gem::Specification < Gem::BasicSpe https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/specification.rb#L349
               add_bindir(@executables),
               @extra_rdoc_files,
               @extensions,
-             ].flatten.sort.uniq.compact
+             ].flatten.uniq.compact.sort
   end
 
   ######################################################################
@@ -443,28 +465,6 @@ class Gem::Specification < Gem::BasicSpe https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/specification.rb#L465
   end
 
   ##
-  # Singular writer for #authors
-  #
-  # Usage:
-  #
-  #   spec.author = 'John Jones'
-
-  def author= o
-    self.authors = [o]
-  end
-
-  ##
-  # Sets the list of authors, ensuring it is an array.
-  #
-  # Usage:
-  #
-  #   spec.authors = ['John Jones', 'Mary Smith']
-
-  def authors= value
-    @authors = Array(value).flatten.grep(String)
-  end
-
-  ##
   # Executables included in the gem.
   #
   # For example, the rake gem has rake as an executable. You don specify the
Index: ruby_2_1/lib/rubygems/package/tar_header.rb
===================================================================
--- ruby_2_1/lib/rubygems/package/tar_header.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/package/tar_header.rb	(revision 44858)
@@ -134,7 +134,7 @@ class Gem::Package::TarHeader https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/package/tar_header.rb#L134
     vals[:gid] ||= 0
     vals[:mtime] ||= 0
     vals[:checksum] ||= ""
-    vals[:typeflag] ||= "0"
+    vals[:typeflag] = "0" if vals[:typeflag].nil? || vals[:typeflag].empty?
     vals[:magic] ||= "ustar"
     vals[:version] ||= "00"
     vals[:uname] ||= "wheel"
Index: ruby_2_1/lib/rubygems/source/git.rb
===================================================================
--- ruby_2_1/lib/rubygems/source/git.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/source/git.rb	(revision 44858)
@@ -24,6 +24,11 @@ class Gem::Source::Git < Gem::Source https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/source/git.rb#L24
   attr_reader :reference
 
   ##
+  # When false the cache for this repository will not be updated.
+
+  attr_accessor :remote
+
+  ##
   # The git repository this gem is sourced from.
 
   attr_reader :repository
@@ -53,6 +58,7 @@ class Gem::Source::Git < Gem::Source https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/source/git.rb#L58
     @reference       = reference
     @need_submodules = submodules
 
+    @remote   = true
     @root_dir = Gem.dir
     @git      = ENV['git'] || 'git'
   end
@@ -85,6 +91,8 @@ class Gem::Source::Git < Gem::Source https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/source/git.rb#L91
   def checkout # :nodoc:
     cache
 
+    return false unless File.exist? repo_cache_dir
+
     unless File.exist? install_dir then
       system @git, 'clone', '--quiet', '--no-checkout',
              repo_cache_dir, install_dir
@@ -107,6 +115,8 @@ class Gem::Source::Git < Gem::Source https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/source/git.rb#L115
   # Creates a local cache repository for the git gem.
 
   def cache # :nodoc:
+    return unless @remote
+
     if File.exist? repo_cache_dir then
       Dir.chdir repo_cache_dir do
         system @git, 'fetch', '--quiet', '--force', '--tags',
@@ -142,6 +152,8 @@ class Gem::Source::Git < Gem::Source https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/source/git.rb#L152
   # The directory where the git gem will be installed.
 
   def install_dir # :nodoc:
+    return unless File.exist? repo_cache_dir
+
     File.join base_dir, 'gems', "#{@name}-#{dir_shortref}"
   end
 
@@ -177,6 +189,8 @@ class Gem::Source::Git < Gem::Source https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/source/git.rb#L189
   def specs
     checkout
 
+    return [] unless install_dir
+
     Dir.chdir install_dir do
       Dir['{,*,*/*}.gemspec'].map do |spec_file|
         directory = File.dirname spec_file
Index: ruby_2_1/lib/rubygems/commands/generate_index_command.rb
===================================================================
--- ruby_2_1/lib/rubygems/commands/generate_index_command.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/commands/generate_index_command.rb	(revision 44858)
@@ -62,7 +62,7 @@ Marshal::MINOR_VERSION constants.  It is https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/commands/generate_index_command.rb#L62
   end
 
   def execute
-    # This is always true becasue it's the only way now.
+    # This is always true because it's the only way now.
     options[:build_modern] = true
 
     if not File.exist?(options[:directory]) or
Index: ruby_2_1/lib/rubygems/commands/contents_command.rb
===================================================================
--- ruby_2_1/lib/rubygems/commands/contents_command.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/commands/contents_command.rb	(revision 44858)
@@ -94,11 +94,11 @@ prefix or only the files that are requir https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/commands/contents_command.rb#L94
     spec.files.sort.map do |file|
       case file
       when /\A#{spec.bindir}\//
-        [Gem::ConfigMap[:bindir], $POSTMATCH]
+        [RbConfig::CONFIG['bindir'], $POSTMATCH]
       when /\.so\z/
-        [Gem::ConfigMap[:archdir], file]
+        [RbConfig::CONFIG['archdir'], file]
       else
-        [Gem::ConfigMap[:rubylibdir], file]
+        [RbConfig::CONFIG['rubylibdir'], file]
       end
     end
   end
Index: ruby_2_1/lib/rubygems/commands/setup_command.rb
===================================================================
--- ruby_2_1/lib/rubygems/commands/setup_command.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/commands/setup_command.rb	(revision 44858)
@@ -13,7 +13,7 @@ class Gem::Commands::SetupCommand < Gem: https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/commands/setup_command.rb#L13
 
     super 'setup', 'Install RubyGems',
           :format_executable => true, :document => %w[ri],
-          :site_or_vendor => :sitelibdir,
+          :site_or_vendor => 'sitelibdir',
           :destdir => '', :prefix => '', :previous_version => ''
 
     add_option '--previous-version=VERSION',
@@ -36,7 +36,7 @@ class Gem::Commands::SetupCommand < Gem: https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/commands/setup_command.rb#L36
 
     add_option '--[no-]vendor',
                'Install into vendorlibdir not sitelibdir' do |vendor, options|
-      options[:site_or_vendor] = vendor ? :vendorlibdir : :sitelibdir
+      options[:site_or_vendor] = vendor ? 'vendorlibdir' : 'sitelibdir'
     end
 
     add_option '--[no-]format-executable',
@@ -343,19 +343,19 @@ TEXT https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/commands/setup_command.rb#L343
     site_or_vendor = options[:site_or_vendor]
 
     if prefix.empty? then
-      lib_dir = Gem::ConfigMap[site_or_vendor]
-      bin_dir = Gem::ConfigMap[:bindir]
+      lib_dir = RbConfig::CONFIG[site_or_vendor]
+      bin_dir = RbConfig::CONFIG['bindir']
     else
       # Apple installed RubyGems into libdir, and RubyGems <= 1.1.0 gets
       # confused about installation location, so switch back to
       # sitelibdir/vendorlibdir.
       if defined?(APPLE_GEM_HOME) and
         # just in case Apple and RubyGems don't get this patched up proper.
-        (prefix == Gem::ConfigMap[:libdir] or
+        (prefix == RbConfig::CONFIG['libdir'] or
          # this one is important
-         prefix == File.join(Gem::ConfigMap[:libdir], 'ruby')) then
-         lib_dir = Gem::ConfigMap[site_or_vendor]
-         bin_dir = Gem::ConfigMap[:bindir]
+         prefix == File.join(RbConfig::CONFIG['libdir'], 'ruby')) then
+         lib_dir = RbConfig::CONFIG[site_or_vendor]
+         bin_dir = RbConfig::CONFIG['bindir']
       else
         lib_dir = File.join prefix, 'lib'
         bin_dir = File.join prefix, 'bin'
Index: ruby_2_1/lib/rubygems/commands/install_command.rb
===================================================================
--- ruby_2_1/lib/rubygems/commands/install_command.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/commands/install_command.rb	(revision 44858)
@@ -228,7 +228,18 @@ to write the specification by hand.  For https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/commands/install_command.rb#L228
   def install_gem_without_dependencies name, req # :nodoc:
     gem = nil
 
-    if remote? then
+    if local? then
+      if name =~ /\.gem$/ and File.file? name then
+        source = Gem::Source::SpecificFile.new name
+        spec = source.spec
+      else
+        source = Gem::Source::Local.new
+        spec = source.find_gem name, req
+      end
+      gem = source.download spec if spec
+    end
+
+    if remote? and not gem then
       dependency = Gem::Dependency.new name, req
       dependency.prerelease = options[:prerelease]
 
@@ -236,13 +247,6 @@ to write the specification by hand.  For https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/commands/install_command.rb#L247
       gem = fetcher.download_to_cache dependency
     end
 
-    if local? and not gem then
-      source = Gem::Source::Local.new
-      spec = source.find_gem name, req
-
-      gem = source.download spec
-    end
-
     inst = Gem::Installer.new gem, options
     inst.install
 
Index: ruby_2_1/lib/rubygems/request.rb
===================================================================
--- ruby_2_1/lib/rubygems/request.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/request.rb	(revision 44858)
@@ -48,15 +48,14 @@ class Gem::Request https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/request.rb#L48
       connection.key = OpenSSL::PKey::RSA.new pem
     end
 
+    store.set_default_paths
+    add_rubygems_trusted_certs(store)
     if Gem.configuration.ssl_ca_cert
       if File.directory? Gem.configuration.ssl_ca_cert
         store.add_path Gem.configuration.ssl_ca_cert
       else
         store.add_file Gem.configuration.ssl_ca_cert
       end
-    else
-      store.set_default_paths
-      add_rubygems_trusted_certs(store)
     end
     connection.cert_store = store
   rescue LoadError => e
@@ -106,7 +105,8 @@ class Gem::Request https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/request.rb#L105
     request = @request_class.new @uri.request_uri
 
     unless @uri.nil? || @uri.user.nil? || @uri.user.empty? then
-      request.basic_auth @uri.user, @uri.password
+      request.basic_auth Gem::UriFormatter.new(@uri.user).unescape,
+                         Gem::UriFormatter.new(@uri.password).unescape
     end
 
     request.add_field 'User-Agent', @user_agent
Index: ruby_2_1/lib/rubygems/deprecate.rb
===================================================================
--- ruby_2_1/lib/rubygems/deprecate.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/deprecate.rb	(revision 44858)
@@ -50,7 +50,7 @@ module Gem::Deprecate https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/deprecate.rb#L50
     class_eval {
       old = "_deprecated_#{name}"
       alias_method old, name
-      define_method name do |*args, &block| # TODO: really works on 1.8.7?
+      define_method name do |*args, &block|
         klass = self.kind_of? Module
         target = klass ? "#{self}." : "#{self.class}#"
         msg = [ "NOTE: #{target}#{name} is deprecated",
Index: ruby_2_1/lib/rubygems/request_set/lockfile.rb
===================================================================
--- ruby_2_1/lib/rubygems/request_set/lockfile.rb	(revision 44857)
+++ ruby_2_1/lib/rubygems/request_set/lockfile.rb	(revision 44858)
@@ -303,7 +303,12 @@ class Gem::RequestSet::Lockfile https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/rubygems/request_set/lockfile.rb#L303
         type, data, = get [:text, :requireme (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]