diff options
Diffstat (limited to 'lib/rubygems/command.rb')
| -rw-r--r-- | lib/rubygems/command.rb | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb index 01deac6890..d38363f293 100644 --- a/lib/rubygems/command.rb +++ b/lib/rubygems/command.rb @@ -6,7 +6,7 @@ # See LICENSE.txt for permissions. #++ -require_relative "optparse" +require_relative "vendored_optparse" require_relative "requirement" require_relative "user_interaction" @@ -117,7 +117,7 @@ class Gem::Command # Unhandled arguments (gem names, files, etc.) are left in # <tt>options[:args]</tt>. - def initialize(command, summary=nil, defaults={}) + def initialize(command, summary = nil, defaults = {}) @command = command @summary = summary @program_name = "gem #{command}" @@ -190,7 +190,7 @@ class Gem::Command "Please specify at least one gem name (e.g. gem build GEMNAME)" end - args.select {|arg| arg !~ /^-/ } + args.reject {|arg| arg.start_with?("-") } end ## @@ -323,10 +323,6 @@ class Gem::Command elsif @when_invoked @when_invoked.call options else - if Gem.paths.auto_user_install && !options[:install_dir] && !options[:user_install] - self.ui.say "Defaulting to user installation because default installation directory (#{Gem.default_dir}) is not writable." - end - execute end ensure @@ -489,7 +485,7 @@ class Gem::Command @parser.separator nil @parser.separator " Description:" - formatted.split("\n").each do |line| + formatted.each_line do |line| @parser.separator " #{line.rstrip}" end end @@ -516,8 +512,8 @@ class Gem::Command @parser.separator nil @parser.separator " #{title}:" - content.split(/\n/).each do |line| - @parser.separator " #{line}" + content.each_line do |line| + @parser.separator " #{line.rstrip}" end end @@ -526,7 +522,7 @@ class Gem::Command @parser.separator nil @parser.separator " Summary:" - wrap(@summary, 80 - 4).split("\n").each do |line| + wrap(@summary, 80 - 4).each_line do |line| @parser.separator " #{line.strip}" end end @@ -654,9 +650,6 @@ RubyGems is a package manager for Ruby. gem help platforms gem platforms guide gem help <COMMAND> show help on COMMAND (e.g. 'gem help install') - gem server present a web page at - http://localhost:8808/ - with info about installed gems Further information: https://guides.rubygems.org HELP |
