mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
Merge rubygems-2.7.3.
http://blog.rubygems.org/2017/11/28/2.7.3-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
89bfee6fd4
commit
e82802070a
9 changed files with 212 additions and 23 deletions
|
@ -82,11 +82,7 @@ class Gem::Commands::SetupCommand < Gem::Command
|
|||
|
||||
add_option '--[no-]regenerate-binstubs',
|
||||
'Regenerate gem binstubs' do |value, options|
|
||||
if value then
|
||||
options[:regenerate_binstubs] = true
|
||||
else
|
||||
options.delete(:regenerate_binstubs)
|
||||
end
|
||||
options[:regenerate_binstubs] = value
|
||||
end
|
||||
|
||||
@verbose = nil
|
||||
|
@ -156,7 +152,7 @@ By default, this RubyGems will install gem as:
|
|||
|
||||
say "RubyGems #{Gem::VERSION} installed"
|
||||
|
||||
regenerate_binstubs
|
||||
regenerate_binstubs if options[:regenerate_binstubs]
|
||||
|
||||
uninstall_old_gemcutter
|
||||
|
||||
|
@ -357,7 +353,7 @@ 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`/, "''")
|
||||
gemspec = File.open('bundler/bundler.gemspec', 'rb'){|f| f.read.gsub(/`git ls-files -z`/, "''") }
|
||||
File.open('bundler/bundler.gemspec', 'w'){|f| f.write gemspec }
|
||||
|
||||
bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
|
||||
|
@ -372,13 +368,24 @@ By default, this RubyGems will install gem as:
|
|||
|
||||
bundler_spec = Gem::Specification.load(default_spec_path)
|
||||
|
||||
Dir.entries(bundler_spec.gems_dir).
|
||||
select {|default_gem| default_gem.start_with?("bundler-") }.
|
||||
each {|default_gem| rm_r File.join(bundler_spec.gems_dir, default_gem) }
|
||||
if File.directory? bundler_spec.gems_dir
|
||||
Dir.entries(bundler_spec.gems_dir).
|
||||
select {|default_gem| File.basename(default_gem).match(/^bundler-#{Gem::Version::VERSION_PATTERN}$/) }.
|
||||
each {|default_gem| rm_r File.join(bundler_spec.gems_dir, default_gem) }
|
||||
end
|
||||
|
||||
mkdir_p bundler_spec.bin_dir
|
||||
bundler_spec.executables.each {|e| cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_spec.bin_dir, e) }
|
||||
|
||||
if Gem.win_platform?
|
||||
require 'rubygems/installer'
|
||||
|
||||
installer = Gem::Installer.for_spec bundler_spec
|
||||
bundler_spec.executables.each do |e|
|
||||
installer.generate_windows_script e, bundler_spec.bin_dir
|
||||
end
|
||||
end
|
||||
|
||||
say "Bundler #{bundler_spec.version} installed"
|
||||
end
|
||||
|
||||
|
@ -442,7 +449,7 @@ By default, this RubyGems will install gem as:
|
|||
# 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', '**', '.*')]).
|
||||
(Dir[File.join('bundler', 'templates', '**', '{*,.*}')]).
|
||||
select{|f| !File.directory?(f)}
|
||||
end
|
||||
end
|
||||
|
@ -450,7 +457,7 @@ By default, this RubyGems will install gem as:
|
|||
# for cleanup old bundler files
|
||||
def template_files_in dir
|
||||
Dir.chdir dir do
|
||||
(Dir[File.join('templates', '**', '*')] + Dir[File.join('templates', '**', '.*')]).
|
||||
(Dir[File.join('templates', '**', '{*,.*}')]).
|
||||
select{|f| !File.directory?(f)}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue