aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-09 00:42:19 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-09 00:42:19 +0000
commit7c42cd124448b28c39837f120112f097456e7e69 (patch)
tree9b436121a1882ab89cd986c97d74f4605739434f
parent9a4e85ed3c905739a6cee1cfed5084a251273941 (diff)
downloadruby-7c42cd124448b28c39837f120112f097456e7e69.tar.gz
Merge rubygems-2.7.2.
This version fixes some setup commands. https://github.com/rubygems/rubygems/blob/01e797f6aa045fd09df7813d0b5448e3667172a9/History.txt#L3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/rubygems.rb2
-rw-r--r--lib/rubygems/commands/setup_command.rb24
2 files changed, 25 insertions, 1 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index c4c279e964..56290aa570 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -10,7 +10,7 @@ require 'rbconfig'
require 'thread'
module Gem
- VERSION = "2.7.1"
+ VERSION = "2.7.2"
end
# Must be first since it unloads the prelude from 1.9.2
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb
index 5f39b4c93c..93a46d4350 100644
--- a/lib/rubygems/commands/setup_command.rb
+++ b/lib/rubygems/commands/setup_command.rb
@@ -294,6 +294,8 @@ By default, this RubyGems will install gem as:
say "Installing #{tool}" if @verbose
lib_files = rb_files_in path
+ lib_files.concat(template_files) if tool == 'Bundler'
+
pem_files = pem_files_in path
Dir.chdir path do
@@ -354,6 +356,10 @@ By default, this RubyGems will install gem as:
mkdir_p Gem::Specification.default_specifications_dir
+ # Workaround for non-git environment.
+ gemspec = File.read('bundler/bundler.gemspec').gsub(/`git ls-files -z`/, "''")
+ File.open('bundler/bundler.gemspec', 'w'){|f| f.write gemspec }
+
bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
bundler_spec.files = Dir.chdir("bundler") { Dir["{*.md,{lib,exe,man}/**/*}"] }
bundler_spec.executables -= %w[bundler bundle_ruby]
@@ -433,6 +439,22 @@ By default, this RubyGems will install gem as:
end
end
+ # for installation of bundler as default gems
+ def template_files
+ Dir.chdir "bundler/lib" do
+ (Dir[File.join('bundler', 'templates', '**', '*')] + Dir[File.join('bundler', 'templates', '**', '.*')]).
+ select{|f| !File.directory?(f)}
+ end
+ end
+
+ # for cleanup old bundler files
+ def template_files_in dir
+ Dir.chdir dir do
+ (Dir[File.join('templates', '**', '*')] + Dir[File.join('templates', '**', '.*')]).
+ select{|f| !File.directory?(f)}
+ end
+ end
+
def remove_old_bin_files(bin_dir)
old_bin_files = {
'gem_mirror' => 'gem mirror',
@@ -470,8 +492,10 @@ abort "#{deprecation_message}"
lib_dirs[File.join(lib_dir, 'bundler')] = 'bundler/lib/bundler' if Gem::USE_BUNDLER_FOR_GEMDEPS
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/
old_lib_files = rb_files_in(old_lib_dir)
+ old_lib_files.concat(template_files_in(old_lib_dir)) if old_lib_dir =~ /bundler/
to_remove = old_lib_files - lib_files