summaryrefslogtreecommitdiff
path: root/lib/rubygems/command_manager.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-14 08:59:02 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-14 08:59:02 +0000
commit269503b544247b5b3e30dbe60a0bab4f2ca00e4e (patch)
treea6d0a3a9b34017c4c84d997152a3aaf3086e1ce1 /lib/rubygems/command_manager.rb
parent2614d9ba2fb5ad171200cccc88f42fa659b527c6 (diff)
Revert r42938 "* lib/rubygems: Update to RubyGems 2.1.3"
It breaks build. http://u64.rubyci.org/~chkbuild/ruby-trunk/log/20130913T200302Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/command_manager.rb')
-rw-r--r--lib/rubygems/command_manager.rb77
1 files changed, 37 insertions, 40 deletions
diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb
index 2af5821..fdee064 100644
--- a/lib/rubygems/command_manager.rb
+++ b/lib/rubygems/command_manager.rb
@@ -33,6 +33,39 @@ class Gem::CommandManager
include Gem::UserInteraction
+ BUILTIN_COMMANDS = [ # :nodoc:
+ :build,
+ :cert,
+ :check,
+ :cleanup,
+ :contents,
+ :dependency,
+ :environment,
+ :fetch,
+ :generate_index,
+ :help,
+ :install,
+ :list,
+ :lock,
+ :mirror,
+ :outdated,
+ :owner,
+ :pristine,
+ :push,
+ :query,
+ :rdoc,
+ :search,
+ :server,
+ :sources,
+ :specification,
+ :stale,
+ :uninstall,
+ :unpack,
+ :update,
+ :which,
+ :yank,
+ ]
+
##
# Return the authoritative instance of the command manager.
@@ -61,36 +94,10 @@ class Gem::CommandManager
def initialize
require 'timeout'
@commands = {}
- register_command :build
- register_command :cert
- register_command :check
- register_command :cleanup
- register_command :contents
- register_command :dependency
- register_command :environment
- register_command :fetch
- register_command :generate_index
- register_command :help
- register_command :install
- register_command :list
- register_command :lock
- register_command :mirror
- register_command :outdated
- register_command :owner
- register_command :pristine
- register_command :push
- register_command :query
- register_command :rdoc
- register_command :search
- register_command :server
- register_command :sources
- register_command :specification
- register_command :stale
- register_command :uninstall
- register_command :unpack
- register_command :update
- register_command :which
- register_command :yank
+
+ BUILTIN_COMMANDS.each do |name|
+ register_command name
+ end
end
##
@@ -132,14 +139,6 @@ class Gem::CommandManager
alert_error "While executing gem ... (#{ex.class})\n #{ex.to_s}"
ui.backtrace ex
- if Gem.configuration.really_verbose and \
- ex.kind_of?(Gem::Exception) and ex.source_exception
- e = ex.source_exception
-
- ui.errs.puts "Because of: (#{e.class})\n #{e.to_s}"
- ui.backtrace e
- end
-
terminate_interaction(1)
rescue Interrupt
alert_error "Interrupted"
@@ -147,8 +146,6 @@ class Gem::CommandManager
end
def process_args(args, build_args=nil)
- args = args.to_str.split(/\s+/) if args.respond_to?(:to_str)
-
if args.empty? then
say Gem::Command::HELP
terminate_interaction 1