aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/command_manager.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-22 08:24:42 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-22 08:24:42 +0000
commit372dcece3f69989d133f720468f1e24aa1133cda (patch)
treec173ca48a23ce18afa44feb15bf68d2dd14ac619 /lib/rubygems/command_manager.rb
parentd0e5a34ac7c34e70c145024a0fed8f6042814f29 (diff)
downloadruby-372dcece3f69989d133f720468f1e24aa1133cda.tar.gz
Update to RubyGems 1.3.7.pre.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/command_manager.rb')
-rw-r--r--lib/rubygems/command_manager.rb24
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb
index 11344f1fb6..176e6a0bb4 100644
--- a/lib/rubygems/command_manager.rb
+++ b/lib/rubygems/command_manager.rb
@@ -75,10 +75,10 @@ class Gem::CommandManager
end
##
- # Register the command object.
+ # Register the Symbol +command+ as a gem command.
- def register_command(command_obj)
- @commands[command_obj] = false
+ def register_command(command)
+ @commands[command] = false
end
##
@@ -123,7 +123,7 @@ class Gem::CommandManager
say Gem::Command::HELP
terminate_interaction(0)
when '-v', '--version'
- say Gem::RubyGemsVersion
+ say Gem::VERSION
terminate_interaction(0)
when /^-/
alert_error "Invalid option: #{args[0]}. See 'gem --help'."
@@ -161,15 +161,19 @@ class Gem::CommandManager
retried = false
begin
- commands.const_get(const_name)
+ commands.const_get const_name
rescue NameError
- if retried then
- raise
- else
- retried = true
+ raise if retried
+
+ retried = true
+ begin
require "rubygems/commands/#{command_name}_command"
- retry
+ rescue Exception => e
+ alert_error "Loading command: #{command_name} (#{e.class})\n #{e}"
+ ui.errs.puts "\t#{e.backtrace.join "\n\t"}" if
+ Gem.configuration.backtrace
end
+ retry
end.new
end