diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-09 21:38:59 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-09 21:38:59 +0000 |
commit | 31c94ffeb5f09d09ac2c86fc9e6614e38251a43d (patch) | |
tree | 10e44506238c7af3d7c9d822111996731726e38d /lib/rubygems/commands/update_command.rb | |
parent | a6afbaeb3be396c0fdea3b9077d9256c59edcfca (diff) | |
download | ruby-31c94ffeb5f09d09ac2c86fc9e6614e38251a43d.tar.gz |
Update to RubyGems 1.3.4 r2223
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/update_command.rb')
-rw-r--r-- | lib/rubygems/commands/update_command.rb | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb index 28d3a5d382..9974b2b54b 100644 --- a/lib/rubygems/commands/update_command.rb +++ b/lib/rubygems/commands/update_command.rb @@ -16,9 +16,9 @@ class Gem::Commands::UpdateCommand < Gem::Command super 'update', 'Update the named gems (or all installed gems) in the local repository', :generate_rdoc => true, - :generate_ri => true, - :force => false, - :test => false + :generate_ri => true, + :force => false, + :test => false add_install_update_options @@ -80,20 +80,27 @@ class Gem::Commands::UpdateCommand < Gem::Command gems_to_update.uniq.sort.each do |name| next if updated.any? { |spec| spec.name == name } + success = false say "Updating #{name}" - installer.install name + begin + installer.install name + success = true + rescue Gem::InstallError => e + alert_error "Error installing #{name}:\n\t#{e.message}" + success = false + end installer.installed_gems.each do |spec| updated << spec - say "Successfully installed #{spec.full_name}" + say "Successfully installed #{spec.full_name}" if success end end if gems_to_update.include? "rubygems-update" then Gem.source_index.refresh! - update_gems = Gem.source_index.search 'rubygems-update' + update_gems = Gem.source_index.find_name 'rubygems-update' latest_update_gem = update_gems.sort_by { |s| s.version }.last @@ -106,6 +113,20 @@ class Gem::Commands::UpdateCommand < Gem::Command say "Nothing to update" else say "Gems updated: #{updated.map { |spec| spec.name }.join ', '}" + + if options[:generate_ri] then + updated.each do |gem| + Gem::DocManager.new(gem, options[:rdoc_args]).generate_ri + end + + Gem::DocManager.update_ri_cache + end + + if options[:generate_rdoc] then + updated.each do |gem| + Gem::DocManager.new(gem, options[:rdoc_args]).generate_rdoc + end + end end end end |