diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-26 13:26:21 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-04-28 11:07:45 +0900 |
commit | d0a54673202458455244f79ed212a97727f0c7c7 (patch) | |
tree | 4d984b9e2675d906b3e336c7f951f03b11316546 /lib/rubygems/commands | |
parent | a15f7dd1fb1148c3d586238ee6907875f2e40379 (diff) |
Update rubygems with latest upstream changes
Closes: https://github.com/ruby/ruby/pull/2154
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r-- | lib/rubygems/commands/dependency_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 14 | ||||
-rw-r--r-- | lib/rubygems/commands/unpack_command.rb | 1 |
3 files changed, 9 insertions, 8 deletions
diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb index 8e198ac93a..00ab19bed4 100644 --- a/lib/rubygems/commands/dependency_command.rb +++ b/lib/rubygems/commands/dependency_command.rb @@ -208,7 +208,7 @@ use with other commands. def name_pattern(args) args << '' if args.empty? - if args.length == 1 and args.first =~ /\A\/(.*)\/(i)?\z/m + if args.length == 1 and args.first =~ /\A(.*)(i)?\z/m flags = $2 ? Regexp::IGNORECASE : nil Regexp.new $1, flags else diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index e3afc8cff8..f5e5236a06 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -319,7 +319,7 @@ By default, this RubyGems will install gem as: def install_lib(lib_dir) libs = { 'RubyGems' => 'lib' } - libs['Bundler'] = 'bundler/lib' if Gem::USE_BUNDLER_FOR_GEMDEPS + libs['Bundler'] = 'bundler/lib' libs.each do |tool, path| say "Installing #{tool}" if @verbose @@ -382,8 +382,6 @@ By default, this RubyGems will install gem as: end def install_default_bundler_gem(bin_dir) - return unless Gem::USE_BUNDLER_FOR_GEMDEPS - specs_dir = Gem::Specification.default_specifications_dir specs_dir = File.join(options[:destdir], specs_dir) unless Gem.win_platform? mkdir_p specs_dir, :mode => 0755 @@ -430,8 +428,12 @@ By default, this RubyGems will install gem as: Dir.chdir("bundler") do built_gem = Gem::Package.build(bundler_spec) - installer = Gem::Installer.at(built_gem, env_shebang: options[:env_shebang], install_as_default: true, bin_dir: bin_dir, wrappers: true) - installer.install + begin + installer = Gem::Installer.at(built_gem, env_shebang: options[:env_shebang], install_as_default: true, bin_dir: bin_dir, wrappers: true) + installer.install + ensure + FileUtils.rm_f built_gem + end end say "Bundler #{bundler_spec.version} installed" @@ -544,7 +546,7 @@ abort "#{deprecation_message}" def remove_old_lib_files(lib_dir) lib_dirs = { File.join(lib_dir, 'rubygems') => 'lib/rubygems' } - lib_dirs[File.join(lib_dir, 'bundler')] = 'bundler/lib/bundler' if Gem::USE_BUNDLER_FOR_GEMDEPS + lib_dirs[File.join(lib_dir, 'bundler')] = 'bundler/lib/bundler' lib_dirs.each do |old_lib_dir, new_lib_dir| lib_files = rb_files_in(new_lib_dir) lib_files.concat(template_files_in(new_lib_dir)) if new_lib_dir =~ /bundler/ diff --git a/lib/rubygems/commands/unpack_command.rb b/lib/rubygems/commands/unpack_command.rb index 4a1bd8a0d6..f7ffea3e95 100644 --- a/lib/rubygems/commands/unpack_command.rb +++ b/lib/rubygems/commands/unpack_command.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true require 'rubygems/command' -require 'rubygems/installer' require 'rubygems/version_option' require 'rubygems/security_option' require 'rubygems/remote_fetcher' |