okkez e$B$G$9!#e(B
lib/rubygems/command_manager.rb e$B$GDj5A$5$l$F$$$ke(B
Gem::CommandManager e$B%/%i%9$G$9$,!"%=!<%9%3!<%I$rFI$s$G$_$?8B$j$G$Oe(B
singleton e$B$K$7$?$+$C$?$N$8$c$J$$$+$H;W$&$N$G$9$,$$$+$,$G$7$g$&$+!)e(B
e$B85$N%3!<%I$@$He(B Gem::CommandManager.instance
e$B$GKh2s?7$7$$%$%s%9%?%s%9e(B
e$B$,@8@.$5$l$^$9!#e(B
e$B=$@5$K$"$o$;$F%F%9%H$b=$@5$7$F$_$^$7$?!#e(B
e$B$h$m$7$/$*4j$$$7$^$9!#e(B
Index: lib/rubygems/command_manager.rb
— lib/rubygems/command_manager.rb (revision 18866)
+++ lib/rubygems/command_manager.rb (working copy)
@@ -4,6 +4,7 @@
See LICENSE.txt for permissions.
#++
+require ‘singleton’
require ‘timeout’
require ‘rubygems/command’
require ‘rubygems/user_interaction’
@@ -15,12 +16,8 @@
sub-commands supported by the gem command.
class CommandManager
include UserInteraction
- include Singleton
-
Return the authoritative instance of the command manager.
-
def self.instance
-
@command_manager ||= CommandManager.new
-
end
-
Register all the subcommands supported by the gem command.
def initialize
@commands = {}
Index: test/rubygems/test_gem_command_manager.rb
===================================================================
— test/rubygems/test_gem_command_manager.rb (revision 18866)
+++ test/rubygems/test_gem_command_manager.rb (working copy)
@@ -25,7 +25,7 @@
def setup
super -
@command_manager = Gem::CommandManager.new
-
@command_manager = Gem::CommandManager.instance
end
def test_run_interrupt
Index: test/rubygems/functional.rb
— test/rubygems/functional.rb (revision 18866)
+++ test/rubygems/functional.rb (working copy)
@@ -47,7 +47,7 @@
end
def test_all_command_helps
- mgr = Gem::CommandManager.new
- mgr = Gem::CommandManager.instance
mgr.command_names.each do |cmdname|
gem_nossl “help #{cmdname}”
assert_match(/Usage: gem #{cmdname}/, @out,