diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-26 20:24:51 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-26 20:24:51 +0000 |
commit | e487a7f53cffbadf0bf15ff169c9cb5898503250 () | |
tree | eaa80eb4ced6fcdcc8b327d1cc5e47f66703fd1b /lib/rubygems/commands | |
parent | cddd93a57568966b416e300529bdffc0c7e87b51 (diff) |
* lib/rubygems: Import RubyGems 2.1.0 Release Candidate
* test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
24 files changed, 294 insertions, 32 deletions
@@ -15,6 +15,25 @@ class Gem::Commands::BuildCommand < Gem::Command "GEMSPEC_FILE gemspec file name to build a gem for" end def usage # :nodoc: "#{program_name} GEMSPEC_FILE" end @@ -79,6 +79,13 @@ class Gem::Commands::CheckCommand < Gem::Command '--gems --alien' end def usage # :nodoc: "#{program_name} [OPTIONS] [GEMNAME ...]" end @@ -6,7 +6,7 @@ class Gem::Commands::CleanupCommand < Gem::Command def initialize super 'cleanup', - 'Clean up old versions of installed gems in the local repository', :force => false, :install_dir => Gem.dir add_option('-n', '-d', '--dryrun', @@ -33,11 +33,11 @@ class Gem::Commands::CleanupCommand < Gem::Command def description # :nodoc: <<-EOF -The cleanup command removes old gems from GEM_HOME. If an older version is -installed elsewhere in GEM_PATH the cleanup command won't touch it. -Older gems that are required to satisify the dependencies of gems -are not removed. EOF end @@ -45,6 +45,14 @@ class Gem::Commands::ContentsCommand < Gem::Command "--no-lib-only --prefix" end def usage # :nodoc: "#{program_name} GEMNAME [GEMNAME ...]" end @@ -38,6 +38,17 @@ class Gem::Commands::DependencyCommand < Gem::Command "--local --version '#{Gem::Requirement.default}' --no-reverse-dependencies" end def usage # :nodoc: "#{program_name} GEMNAME" end @@ -21,6 +21,9 @@ class Gem::Commands::EnvironmentCommand < Gem::Command def description # :nodoc: <<-EOF The RubyGems environment can be controlled through command line arguments, gemrc files, environment variables and built-in defaults. @@ -28,6 +28,16 @@ class Gem::Commands::FetchCommand < Gem::Command "--version '#{Gem::Requirement.default}'" end def usage # :nodoc: "#{program_name} GEMNAME [GEMNAME ...]" end @@ -8,7 +8,7 @@ require 'rubygems/commands/query_command' class Gem::Commands::ListCommand < Gem::Commands::QueryCommand def initialize - super 'list', 'Display gems whose name starts with STRING' remove_option('--name-matches') end @@ -21,6 +21,17 @@ class Gem::Commands::ListCommand < Gem::Commands::QueryCommand "--local --no-details" end def usage # :nodoc: "#{program_name} [STRING]" end @@ -10,6 +10,12 @@ class Gem::Commands::MirrorCommand < Gem::Command end end def execute alert_error "Install the rubygems-mirror gem for the mirror command" end @@ -15,6 +15,15 @@ class Gem::Commands::OutdatedCommand < Gem::Command add_platform_option end def execute Gem::Specification.outdated_and_latest_version.each do |spec, remote_version| say "#{spec.name} (#{spec.version} < #{remote_version})" @@ -7,7 +7,14 @@ class Gem::Commands::OwnerCommand < Gem::Command include Gem::GemcutterUtilities def description # :nodoc: - 'Manage gem owners on RubyGems.org.' end def arguments # :nodoc: @@ -19,7 +26,7 @@ class Gem::Commands::OwnerCommand < Gem::Command end def initialize - super 'owner', description add_proxy_option add_key_option defaults.merge! :add => [], :remove => [] @@ -21,7 +21,8 @@ class Gem::Commands::PristineCommand < Gem::Command end add_option('--[no-]extensions', - 'Restore gems with extensions') do |value, options| options[:extensions] = value end @@ -49,23 +50,23 @@ class Gem::Commands::PristineCommand < Gem::Command def description # :nodoc: <<-EOF -The pristine command compares the installed gems with the contents of the -cached gem and restores any files that don't match the cached gem's copy. -If you have made modifications to your installed gems, the pristine command -will revert them. After all the gem's files have been checked all bin stubs -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 def usage # :nodoc: - "#{program_name} [args]" end def execute @@ -8,7 +8,13 @@ class Gem::Commands::PushCommand < Gem::Command include Gem::GemcutterUtilities def description # :nodoc: - 'Push a gem up to RubyGems.org' end def arguments # :nodoc: @@ -20,7 +26,7 @@ class Gem::Commands::PushCommand < Gem::Command end def initialize - super 'push', description, :host => self.host add_proxy_option add_key_option @@ -61,6 +61,15 @@ class Gem::Commands::QueryCommand < Gem::Command "--local --name-matches // --no-details --versions --no-installed" end def execute exit_code = 0 @@ -45,8 +45,12 @@ class Gem::Commands::RdocCommand < Gem::Command def description # :nodoc: <<-DESC -The rdoc command builds RDoc and RI documentation for installed gems. Use ---overwrite to force rebuilding of documentation. DESC end @@ -4,7 +4,7 @@ require 'rubygems/commands/query_command' class Gem::Commands::SearchCommand < Gem::Commands::QueryCommand def initialize - super 'search', 'Display all gems whose name contains STRING' remove_option '--name-matches' @@ -19,6 +19,19 @@ class Gem::Commands::SearchCommand < Gem::Commands::QueryCommand "--remote --no-details" end def usage # :nodoc: "#{program_name} [STRING]" end @@ -97,6 +97,53 @@ Do you want to add this insecure source? '--list' end def list # :nodoc: say "*** CURRENT SOURCES ***" say @@ -50,6 +50,22 @@ FIELD name of gemspec field to show "--local --version '#{Gem::Requirement.default}' --yaml" end def usage # :nodoc: "#{program_name} [GEMFILE] [FIELD]" end @@ -5,6 +5,16 @@ class Gem::Commands::StaleCommand < Gem::Command super('stale', 'List gems along with access times') end def usage # :nodoc: "#{program_name}" end @@ -88,6 +88,16 @@ class Gem::Commands::UninstallCommand < Gem::Command "--user-install" end def usage # :nodoc: "#{program_name} GEMNAME [GEMNAME ...]" end @@ -104,15 +114,18 @@ class Gem::Commands::UninstallCommand < Gem::Command end def uninstall_all - install_dir = options[:install_dir] - dirs_to_be_emptied = Dir[File.join(install_dir, '*')] - dirs_to_be_emptied.delete_if { |dir| dir.end_with? 'build_info' } - dirs_to_be_emptied.each do |dir| - FileUtils.rm_rf Dir[File.join(dir, '*')] end - alert("Successfully uninstalled all gems in #{install_dir}") end def uninstall_specific @@ -34,6 +34,24 @@ class Gem::Commands::UnpackCommand < Gem::Command "--version '#{Gem::Requirement.default}'" end def usage # :nodoc: "#{program_name} GEMNAME" end @@ -52,6 +52,15 @@ class Gem::Commands::UpdateCommand < Gem::Command "--document --no-force --install-dir #{Gem.dir}" end def usage # :nodoc: "#{program_name} GEMNAME [GEMNAME ...]" end @@ -23,6 +23,17 @@ class Gem::Commands::WhichCommand < Gem::Command "--no-gems-first --no-all" end def execute found = false @@ -9,7 +9,21 @@ class Gem::Commands::YankCommand < Gem::Command include Gem::GemcutterUtilities def description # :nodoc: - 'Remove a specific gem version release from RubyGems.org' end def arguments # :nodoc: @@ -21,7 +35,7 @@ class Gem::Commands::YankCommand < Gem::Command end def initialize - super 'yank', description add_version_option("remove") add_platform_option("remove") |