diff options
-rw-r--r-- | lib/rubygems/commands/help_command.rb | 10 | ||||
-rw-r--r-- | lib/rubygems/commands/list_command.rb | 10 | ||||
-rw-r--r-- | lib/rubygems/commands/owner_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/pristine_command.rb | 9 | ||||
-rw-r--r-- | lib/rubygems/commands/push_command.rb | 3 | ||||
-rw-r--r-- | lib/rubygems/commands/search_command.rb | 20 | ||||
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 58 | ||||
-rw-r--r-- | lib/rubygems/commands/specification_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/update_command.rb | 2 |
9 files changed, 75 insertions, 41 deletions
@@ -113,7 +113,15 @@ platform. format = "#{' ' * margin_width}%-#{desc_width}s%s" command_manager.command_names.each do |cmd_name| - summary = command_manager[cmd_name].summary summary = wrap(summary, summary_width).split "\n" out << sprintf(format, cmd_name, summary.shift) until summary.empty? do @@ -7,9 +7,8 @@ require 'rubygems/commands/query_command' class Gem::Commands::ListCommand < Gem::Commands::QueryCommand - def initialize(name = 'list', - summary = 'Display gems whose name starts with STRING') - super name, summary remove_option('--name-matches') end @@ -27,9 +26,8 @@ class Gem::Commands::ListCommand < Gem::Commands::QueryCommand end def execute - name = get_one_optional_argument || '' - options[:name] = /^#{name}/i - super end @@ -73,7 +73,7 @@ class Gem::Commands::OwnerCommand < Gem::Command request.add_field "Authorization", api_key end - with_response response rescue # ignore end @@ -10,7 +10,8 @@ class Gem::Commands::PristineCommand < Gem::Command def initialize super 'pristine', 'Restores installed gems to pristine condition from files located in the gem cache', - :version => Gem::Requirement.default, :extensions => true, :all => false add_option('--all', @@ -37,7 +38,7 @@ class Gem::Commands::PristineCommand < Gem::Command end def defaults_str # :nodoc: - "--all --extensions" end def description # :nodoc: @@ -52,8 +53,8 @@ for the gem are regenerated. If the cached gem cannot be found, you will need to use `gem install` to revert the gem. -If --no-extensions is provided pristine will not attempt to restore gems with -extensions. EOF end @@ -20,7 +20,8 @@ class Gem::Commands::PushCommand < Gem::Command end def initialize - super 'push', description add_proxy_option add_key_option @@ -1,17 +1,31 @@ require 'rubygems/command' -require 'rubygems/commands/list_command' -class Gem::Commands::SearchCommand < Gem::Commands::ListCommand def initialize super 'search', 'Display all gems whose name contains STRING' - @defaults[:domain] = :remote end def defaults_str # :nodoc: "--remote --no-details" end end @@ -159,29 +159,7 @@ By default, this RubyGems will install gem as: options[:previous_version] = Gem::Version.new(options[:previous_version]) - release_notes = File.join Dir.pwd, 'History.txt' - - release_notes = if File.exist? release_notes then - history = File.read release_notes - history = history.sub(/^# coding:.*?^=/m, '') - - text = history.split(HISTORY_HEADER) - text.shift # correct an off-by-one generated by split - version_lines = history.scan(HISTORY_HEADER) - versions = history.scan(VERSION_MATCHER).flatten.map { |x| Gem::Version.new(x) } - - history_string = "" - - until versions.length == 0 or versions.shift < options[:previous_version] - history_string += version_lines.shift + text.shift - end - - history_string - else - "Oh-no! Unable to find release notes!" - end - - say release_notes say say "-" * 78 @@ -458,6 +436,40 @@ abort "#{deprecation_message}" end end def uninstall_old_gemcutter require 'rubygems/uninstaller' @@ -28,7 +28,7 @@ class Gem::Commands::SpecificationCommand < Gem::Command options[:format] = :ruby end - add_option('--yaml', 'Output RUBY format') do |value, options| options[:format] = :yaml end @@ -94,7 +94,7 @@ class Gem::Commands::UpdateCommand < Gem::Command say "Updating #{name}" begin - @installer.install name, version success = true rescue Gem::InstallError => e alert_error "Error installing #{name}:\n\t#{e.message}" |