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

ruby-changes:61106

From: David <ko1@a...>
Date: Fri, 8 May 2020 14:14:20 +0900 (JST)
Subject: [ruby-changes:61106] 1090456370 (master): [rubygems/rubygems] Move helper methods to private section of the test file

https://git.ruby-lang.org/ruby.git/commit/?id=1090456370

From 1090456370639100cc74983945a51fcc73c54869 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Mon, 27 Apr 2020 19:19:35 +0200
Subject: [rubygems/rubygems] Move helper methods to private section of the
 test file

https://github.com/rubygems/rubygems/commit/b85db66e2d

diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index 72f6a21..cd5c3db 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -79,30 +79,6 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L79
     end
   end
 
-  def gem_install(name)
-    gem = util_spec name do |s|
-      s.executables = [name]
-      s.files = %W[bin/#{name}]
-    end
-    write_file File.join @tempdir, 'bin', name do |f|
-      f.puts '#!/usr/bin/ruby'
-    end
-    install_gem gem
-    File.join @gemhome, 'bin', name
-  end
-
-  def gem_install_with_plugin(name)
-    gem = util_spec name do |s|
-      s.files = %W[lib/rubygems_plugin.rb]
-    end
-    write_file File.join @tempdir, 'lib', 'rubygems_plugin.rb' do |f|
-      f.puts "require '#{gem.plugins.first}'"
-    end
-    install_gem gem
-
-    File.join Gem.plugindir, "#{name}_plugin.rb"
-  end
-
   def test_execute_regenerate_binstubs
     gem_bin_path = gem_install 'a'
     write_file gem_bin_path do |io|
@@ -389,6 +365,30 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L365
 
   private
 
+  def gem_install(name)
+    gem = util_spec name do |s|
+      s.executables = [name]
+      s.files = %W[bin/#{name}]
+    end
+    write_file File.join @tempdir, 'bin', name do |f|
+      f.puts '#!/usr/bin/ruby'
+    end
+    install_gem gem
+    File.join @gemhome, 'bin', name
+  end
+
+  def gem_install_with_plugin(name)
+    gem = util_spec name do |s|
+      s.files = %W[lib/rubygems_plugin.rb]
+    end
+    write_file File.join @tempdir, 'lib', 'rubygems_plugin.rb' do |f|
+      f.puts "require '#{gem.plugins.first}'"
+    end
+    install_gem gem
+
+    File.join Gem.plugindir, "#{name}_plugin.rb"
+  end
+
   def default_gem_bin_path
     gem_exec = sprintf Gem.default_exec_format, 'gem'
     File.join @install_dir, 'bin', gem_exec
-- 
cgit v0.10.2


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

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