mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Merge rubygems-2.7.3.
http://blog.rubygems.org/2017/11/28/2.7.3-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
89bfee6fd4
commit
e82802070a
9 changed files with 212 additions and 23 deletions
|
@ -8,13 +8,20 @@ class Gem::Commands::CleanupCommand < Gem::Command
|
|||
def initialize
|
||||
super 'cleanup',
|
||||
'Clean up old versions of installed gems',
|
||||
:force => false, :install_dir => Gem.dir
|
||||
:force => false, :install_dir => Gem.dir,
|
||||
:check_dev => true
|
||||
|
||||
add_option('-n', '-d', '--dryrun',
|
||||
'Do not uninstall gems') do |value, options|
|
||||
options[:dryrun] = true
|
||||
end
|
||||
|
||||
add_option('-D', '--[no-]check-development',
|
||||
'Check development dependencies while uninstalling',
|
||||
'(default: true)') do |value, options|
|
||||
options[:check_dev] = value
|
||||
end
|
||||
|
||||
@candidate_gems = nil
|
||||
@default_gems = []
|
||||
@full = nil
|
||||
|
@ -138,7 +145,7 @@ If no gems are named all gems in GEM_HOME are cleaned.
|
|||
end
|
||||
|
||||
def uninstall_dep spec
|
||||
return unless @full.ok_to_remove?(spec.full_name)
|
||||
return unless @full.ok_to_remove?(spec.full_name, options[:check_dev])
|
||||
|
||||
if options[:dryrun] then
|
||||
say "Dry Run Mode: Would uninstall #{spec.full_name}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue