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

ruby-changes:27292

From: drbrain <ko1@a...>
Date: Thu, 21 Feb 2013 05:08:08 +0900 (JST)
Subject: [ruby-changes:27292] drbrain:r39344 (ruby_2_0_0): Merge trunk revision: 39327

drbrain	2013-02-21 05:07:57 +0900 (Thu, 21 Feb 2013)

  New Revision: 39344

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39344

  Log:
    Merge trunk revision: 39327
    
    * lib/rubygems/commands/update_command.rb:  Create the installer after
      options are processed.  [ruby-trunk - Bug #7779]
    * test/rubygems/test_gem_commands_update_command.rb:  Test for the
      above.

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/lib/rubygems/commands/update_command.rb
    branches/ruby_2_0_0/test/rubygems/test_gem_commands_update_command.rb

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 39343)
+++ ruby_2_0_0/ChangeLog	(revision 39344)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Thu Feb 21 05:03:38 2013  Eric Hodel  <drbrain@s...>
+
+	* lib/rubygems/commands/update_command.rb:  Create the installer after
+	  options are processed.  [ruby-trunk - Bug #7779]
+	* test/rubygems/test_gem_commands_update_command.rb:  Test for the
+	  above.
+
 Thu Feb 21 04:54:14 2013  Eric Hodel  <drbrain@s...>
 
 	* lib/rubygems/installer.rb:  Use gsub instead of gsub! to avoid
Index: ruby_2_0_0/lib/rubygems/commands/update_command.rb
===================================================================
--- ruby_2_0_0/lib/rubygems/commands/update_command.rb	(revision 39343)
+++ ruby_2_0_0/lib/rubygems/commands/update_command.rb	(revision 39344)
@@ -14,6 +14,8 @@ class Gem::Commands::UpdateCommand < Gem https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/commands/update_command.rb#L14
   include Gem::LocalRemoteOptions
   include Gem::VersionOption
 
+  attr_reader :installer # :nodoc:
+
   def initialize
     super 'update', 'Update installed gems to the latest version',
       :document => %w[rdoc ri],
@@ -39,7 +41,7 @@ class Gem::Commands::UpdateCommand < Gem https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/commands/update_command.rb#L41
     add_prerelease_option "as update targets"
 
     @updated   = []
-    @installer = Gem::DependencyInstaller.new options
+    @installer = nil
   end
 
   def arguments # :nodoc:
@@ -85,6 +87,9 @@ class Gem::Commands::UpdateCommand < Gem https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rubygems/commands/update_command.rb#L87
 
   def update_gem name, version = Gem::Requirement.default
     return if @updated.any? { |spec| spec.name == name }
+
+    @installer ||= Gem::DependencyInstaller.new options
+
     success = false
 
     say "Updating #{name}"
Index: ruby_2_0_0/test/rubygems/test_gem_commands_update_command.rb
===================================================================
--- ruby_2_0_0/test/rubygems/test_gem_commands_update_command.rb	(revision 39343)
+++ ruby_2_0_0/test/rubygems/test_gem_commands_update_command.rb	(revision 39344)
@@ -355,6 +355,23 @@ class TestGemCommandsUpdateCommand < Gem https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rubygems/test_gem_commands_update_command.rb#L355
     assert_empty out
   end
 
+  def test_execute_user_install
+    util_clear_gems
+
+    Gem::Installer.new(@a1_path).install
+
+    @cmd.handle_options %w[--user-install]
+
+    use_ui @ui do
+      @cmd.execute
+    end
+
+    installer = @cmd.installer
+    user_install = installer.instance_variable_get :@user_install
+
+    assert user_install, 'user_install must be set on the installer'
+  end
+
   def test_handle_options_system
     @cmd.handle_options %w[--system]
 

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r39327


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

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