summaryrefslogtreecommitdiff
path: root/lib/rubygems/command_manager.rb
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-01 03:45:05 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-01 03:45:05 +0000
commitd22130922e7842226d38d59680e4bbb48a28a5f0 (patch)
tree39594d3a14641dd5488a99a5e633239296fa5742 /lib/rubygems/command_manager.rb
parent4752539e3f3e563d559732c52424206bd6f12dbd (diff)
Import rubygems 1.8.5 (released @ 137c80f)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/command_manager.rb')
-rw-r--r--lib/rubygems/command_manager.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb
index 60d82c8..3665f31 100644
--- a/lib/rubygems/command_manager.rb
+++ b/lib/rubygems/command_manager.rb
@@ -44,6 +44,13 @@ class Gem::CommandManager
end
##
+ # Reset the authoritative instance of the command manager.
+
+ def self.reset
+ @command_manager = nil
+ end
+
+ ##
# Register all the subcommands supported by the gem command.
def initialize
@@ -87,6 +94,13 @@ class Gem::CommandManager
end
##
+ # Unregister the Symbol +command+ as a gem command.
+
+ def unregister_command(command)
+ @commands.delete command
+ end
+
+ ##
# Return the registered command from the command name.
def [](command_name)
@@ -166,7 +180,7 @@ class Gem::CommandManager
retried = false
begin
- commands.const_get const_name
+ commands.const_get(const_name).new
rescue NameError
raise if retried
@@ -179,7 +193,7 @@ class Gem::CommandManager
Gem.configuration.backtrace
end
retry
- end.new
+ end
end
end