[前][次][番号順一覧][スレッド一覧]

ruby-changes:48606

From: hsbt <ko1@a...>
Date: Thu, 9 Nov 2017 09:42:24 +0900 (JST)
Subject: [ruby-changes:48606] hsbt:r60721 (trunk): Merge rubygems-2.7.2.

hsbt	2017-11-09 09:42:19 +0900 (Thu, 09 Nov 2017)

  New Revision: 60721

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60721

  Log:
    Merge rubygems-2.7.2.
    
      This version fixes some setup commands.
      https://github.com/rubygems/rubygems/blob/01e797f6aa045fd09df7813d0b5448e3667172a9/History.txt#L3

  Modified files:
    trunk/lib/rubygems/commands/setup_command.rb
    trunk/lib/rubygems.rb
Index: lib/rubygems/commands/setup_command.rb
===================================================================
--- lib/rubygems/commands/setup_command.rb	(revision 60720)
+++ lib/rubygems/commands/setup_command.rb	(revision 60721)
@@ -294,6 +294,8 @@ By default, this RubyGems will install g https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L294
       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 g https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L356
 
     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 g https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L439
     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}" https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L492
     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
 
Index: lib/rubygems.rb
===================================================================
--- lib/rubygems.rb	(revision 60720)
+++ lib/rubygems.rb	(revision 60721)
@@ -10,7 +10,7 @@ require 'rbconfig' https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L10
 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]