diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 21:29:41 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 21:29:41 +0000 |
commit | 95683e5cb2d1ab8351402b09ef853dcdf875bf8d () | |
tree | 44500dba22e9aa94ecc5d4fd348512d0fb236501 /lib/rubygems/commands | |
parent | 81629f05312cc4df2193a17f13c581eda174d9af (diff) |
* lib/rubygems: Update to RubyGems 2.2.0.preview.1
This brings several new features to RubyGems summarized here: https://.com/rubygems/rubygems/blob/v2.2.0.preview.1/History.txt * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/rubygems/commands/list_command.rb | 8 | ||||
-rw-r--r-- | lib/rubygems/commands/pristine_command.rb | 15 | ||||
-rw-r--r-- | lib/rubygems/commands/push_command.rb | 13 | ||||
-rw-r--r-- | lib/rubygems/commands/query_command.rb | 46 | ||||
-rw-r--r-- | lib/rubygems/commands/search_command.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/commands/uninstall_command.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/commands/update_command.rb | 3 | ||||
-rw-r--r-- | lib/rubygems/commands/which_command.rb | 8 |
8 files changed, 62 insertions, 43 deletions
@@ -33,13 +33,7 @@ To search for remote gems use the search command. end def usage # :nodoc: - "#{program_name} [STRING]" - end - - def execute - string = get_one_optional_argument || '' - options[:name] = /^#{string}/i - super end end @@ -12,6 +12,7 @@ class Gem::Commands::PristineCommand < Gem::Command 'Restores installed gems to pristine condition from files located in the gem cache', :version => Gem::Requirement.default, :extensions => true, :all => false add_option('--all', @@ -23,7 +24,8 @@ class Gem::Commands::PristineCommand < Gem::Command add_option('--[no-]extensions', 'Restore gems with extensions', 'in addition to regular gems') do |value, options| - options[:extensions] = value end add_option('--only-executables', @@ -62,6 +64,9 @@ If the cached gem cannot be found it will be downloaded. If --no-extensions is provided pristine will not attempt to restore a gem with an extension. EOF end @@ -72,6 +77,14 @@ with an extension. def execute specs = if options[:all] then Gem::Specification.map else get_all_gem_names.map do |gem_name| Gem::Specification.find_all_by_name gem_name, options[:version] @@ -69,13 +69,18 @@ You can upgrade or downgrade to the latest release version with: terminate_interaction 1 end unless @host then - if gem_data = Gem::Package.new(name) then - @host = gem_data.spec.metadata['default_gem_server'] - end end - args << @host if @host say "Pushing gem to #{@host || Gem.host}..." @@ -72,16 +72,26 @@ is too hard to use. def execute exit_code = 0 - name = options[:name] prerelease = options[:prerelease] unless options[:installed].nil? then - if name.source.empty? then alert_error "You must specify a gem name" exit_code |= 4 else - installed = installed? name, options[:version] installed = !installed unless options[:installed] if installed then @@ -95,6 +105,22 @@ is too hard to use. terminate_interaction exit_code end req = Gem::Requirement.default # TODO: deprecate for real dep = Gem::Deprecate.skip_during { Gem::Dependency.new name, req } @@ -105,11 +131,7 @@ is too hard to use. alert_warning "prereleases are always shown locally" end - if ui.outs.tty? or both? then - say - say "*** LOCAL GEMS ***" - say - end specs = Gem::Specification.find_all { |s| s.name =~ name and req =~ s.version @@ -123,11 +145,7 @@ is too hard to use. end if remote? then - if ui.outs.tty? or both? then - say - say "*** REMOTE GEMS ***" - say - end fetcher = Gem::SpecFetcher.fetcher @@ -155,8 +173,6 @@ is too hard to use. end end - private - ## # Check if gem +name+ version +version+ is installed. @@ -36,11 +36,5 @@ To list local gems use the list command. "#{program_name} [STRING]" end - def execute - string = get_one_optional_argument - options[:name] = /#{string}/i - super - end - end @@ -15,7 +15,7 @@ class Gem::Commands::UninstallCommand < Gem::Command def initialize super 'uninstall', 'Uninstall gems from the local repository', :version => Gem::Requirement.default, :user_install => true, - :install_dir => Gem.dir, :check_dev => false add_option('-a', '--[no-]all', 'Uninstall all matching versions' @@ -84,7 +84,6 @@ class Gem::Commands::UninstallCommand < Gem::Command def defaults_str # :nodoc: "--version '#{Gem::Requirement.default}' --no-force " + - "--install-dir #{Gem.dir}\n" + "--user-install" end @@ -104,8 +103,7 @@ that is a dependency of an existing gem. You can use the def execute if options[:all] and not options[:args].empty? then - alert_error 'Gem names and --all may not be used together' - terminate_interaction 1 elsif options[:all] then uninstall_all else @@ -244,6 +244,9 @@ command to remove old versions. args << '--no-rdoc' unless options[:document].include? 'rdoc' args << '--no-ri' unless options[:document].include? 'ri' args << '--no-format-executable' if options[:no_format_executable] args end @@ -45,9 +45,9 @@ requiring to see why it does not behave as you expect. if spec then if options[:search_gems_first] then - dirs = gem_paths(spec) + $LOAD_PATH else - dirs = $LOAD_PATH + gem_paths(spec) end end @@ -81,10 +81,6 @@ requiring to see why it does not behave as you expect. result end - def gem_paths(spec) - spec.require_paths.collect { |d| File.join spec.full_gem_path, d } - end - def usage # :nodoc: "#{program_name} FILE [FILE ...]" end |