From fd41a38470e1ba2ee1857eae08fe909ef34b9b2d Mon Sep 17 00:00:00 2001 From: nagachika Date: Sun, 10 Sep 2017 05:10:55 +0000 Subject: lib/rubygems: bump up RubyGems version to 2.6.12. [Backport #13842] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems.rb | 3 ++- lib/rubygems/commands/open_command.rb | 2 +- lib/rubygems/commands/query_command.rb | 2 +- lib/rubygems/commands/sources_command.rb | 2 +- lib/rubygems/dependency_list.rb | 2 +- lib/rubygems/installer.rb | 9 ++++++++- lib/rubygems/platform.rb | 2 +- lib/rubygems/security.rb | 2 +- lib/rubygems/server.rb | 2 +- lib/rubygems/specification.rb | 2 +- lib/rubygems/test_case.rb | 5 ++++- 11 files changed, 22 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 5cd1a4c47a..bc5bf9b4c2 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -10,7 +10,7 @@ require 'rbconfig' require 'thread' module Gem - VERSION = "2.6.11" + VERSION = "2.6.12" end # Must be first since it unloads the prelude from 1.9.2 @@ -234,6 +234,7 @@ module Gem def self.finish_resolve(request_set=Gem::RequestSet.new) request_set.import Gem::Specification.unresolved_deps.values + request_set.import Gem.loaded_specs.values.map {|s| Gem::Dependency.new(s.name, s.version) } request_set.resolve_current.each do |s| s.full_spec.activate diff --git a/lib/rubygems/commands/open_command.rb b/lib/rubygems/commands/open_command.rb index a89b7421e3..059635e835 100644 --- a/lib/rubygems/commands/open_command.rb +++ b/lib/rubygems/commands/open_command.rb @@ -72,7 +72,7 @@ class Gem::Commands::OpenCommand < Gem::Command end def spec_for name - spec = Gem::Specification.find_all_by_name(name, @version).last + spec = Gem::Specification.find_all_by_name(name, @version).first return spec if spec diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb index f25d120b88..70f8127292 100644 --- a/lib/rubygems/commands/query_command.rb +++ b/lib/rubygems/commands/query_command.rb @@ -86,7 +86,7 @@ is too hard to use. name = Array(options[:name]) else args = options[:args].to_a - name = options[:exact] ? args : args.map{|arg| /#{arg}/i } + name = options[:exact] ? args.map{|arg| /\A#{Regexp.escape(arg)}\Z/ } : args.map{|arg| /#{arg}/i } end prerelease = options[:prerelease] diff --git a/lib/rubygems/commands/sources_command.rb b/lib/rubygems/commands/sources_command.rb index 9832afd214..7e46963a4c 100644 --- a/lib/rubygems/commands/sources_command.rb +++ b/lib/rubygems/commands/sources_command.rb @@ -44,7 +44,7 @@ class Gem::Commands::SourcesCommand < Gem::Command source = Gem::Source.new source_uri begin - if Gem.sources.include? source_uri then + if Gem.sources.include? source then say "source #{source_uri} already present in the cache" else source.load_specs :released diff --git a/lib/rubygems/dependency_list.rb b/lib/rubygems/dependency_list.rb index 35fe7c4c1a..d8314eaf60 100644 --- a/lib/rubygems/dependency_list.rb +++ b/lib/rubygems/dependency_list.rb @@ -104,7 +104,7 @@ class Gem::DependencyList end def inspect # :nodoc: - "#<%s:0x%x %p>" % [self.class, object_id, map { |s| s.full_name }] + "%s %p>" % [super[0..-2], map { |s| s.full_name }] end ## diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index f4d3e728de..967543c2d1 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -214,7 +214,7 @@ class Gem::Installer ruby_executable = true existing = io.read.slice(%r{ - ^( + ^\s*( gem \s | load \s Gem\.bin_path\( | load \s Gem\.activate_bin_path\( @@ -701,6 +701,8 @@ class Gem::Installer # Return the text for an application file. def app_script_text(bin_file_name) + # note that the `load` lines cannot be indented, as old RG versions match + # against the beginning of the line return <<-TEXT #{shebang bin_file_name} # @@ -723,7 +725,12 @@ if ARGV.first end end +if Gem.respond_to?(:activate_bin_path) load Gem.activate_bin_path('#{spec.name}', '#{bin_file_name}', version) +else +gem #{spec.name.dump}, version +load Gem.bin_path(#{spec.name.dump}, #{bin_file_name.dump}, version) +end TEXT end diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb index d22d91ae54..2dd9ed5782 100644 --- a/lib/rubygems/platform.rb +++ b/lib/rubygems/platform.rb @@ -112,7 +112,7 @@ class Gem::Platform end def inspect - "#<%s:0x%x @cpu=%p, @os=%p, @version=%p>" % [self.class, object_id, *to_a] + "%s @cpu=%p, @os=%p, @version=%p>" % [super[0..-2], *to_a] end def to_a diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb index 119d6d56f7..6963ca156f 100644 --- a/lib/rubygems/security.rb +++ b/lib/rubygems/security.rb @@ -455,7 +455,7 @@ module Gem::Security ## # Creates a new key pair of the specified +length+ and +algorithm+. The - # default is a 2048 bit RSA key. + # default is a 3072 bit RSA key. def self.create_key length = KEY_LENGTH, algorithm = KEY_ALGORITHM algorithm.new length diff --git a/lib/rubygems/server.rb b/lib/rubygems/server.rb index 81df0e608e..df4eb566d3 100644 --- a/lib/rubygems/server.rb +++ b/lib/rubygems/server.rb @@ -657,7 +657,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; } "only_one_executable" => true, "full_name" => "rubygems-#{Gem::VERSION}", "has_deps" => false, - "homepage" => "http://docs.rubygems.org/", + "homepage" => "http://guides.rubygems.org/", "name" => 'rubygems', "ri_installed" => true, "summary" => "RubyGems itself", diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index a2f289d162..500f0af768 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -2105,7 +2105,7 @@ class Gem::Specification < Gem::BasicSpecification if $DEBUG super else - "#<#{self.class}:0x#{__id__.to_s(16)} #{full_name}>" + "#{super[0..-2]} #{full_name}>" end end diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 86b68e1efb..4e48f1eb4c 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -484,7 +484,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase system @git, 'add', gemspec system @git, 'commit', '-a', '-m', 'a non-empty commit message', '--quiet' - head = Gem::Util.popen('git', 'rev-parse', 'master').strip + head = Gem::Util.popen(@git, 'rev-parse', 'master').strip end return name, git_spec.version, directory, head @@ -1498,6 +1498,8 @@ end begin gem 'rdoc' require 'rdoc' + + require 'rubygems/rdoc' rescue LoadError, Gem::LoadError end @@ -1514,3 +1516,4 @@ tmpdirs << (ENV['GEM_PATH'] = Dir.mktmpdir("path")) pid = $$ END {tmpdirs.each {|dir| Dir.rmdir(dir)} if $$ == pid} Gem.clear_paths +Gem.loaded_specs.clear -- cgit v1.2.3