summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-20 20:07:57 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-20 20:07:57 +0000
commit79db75dc4ece8475fc99b4f2d388192b0122d08b (patch)
tree83fb572fa9538b51a6e8579980f9b9e194fe49aa /lib
parentbf2b8c8925301bad569d321c412bbffc55c7bd39 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/commands/update_command.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
index be76c4c7cd..66aef49b4d 100644
--- a/lib/rubygems/commands/update_command.rb
+++ b/lib/rubygems/commands/update_command.rb
@@ -14,6 +14,8 @@ class Gem::Commands::UpdateCommand < Gem::Command
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::Command
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::Command
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}"