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/setup_command.rb | |
parent | a15f7dd1fb1148c3d586238ee6907875f2e40379 (diff) |
Update rubygems with latest upstream changes
Closes: https://github.com/ruby/ruby/pull/2154
Diffstat (limited to 'lib/rubygems/commands/setup_command.rb')
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 14 |
1 files changed, 8 insertions, 6 deletions
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/ |