diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-28 22:30:28 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-28 22:30:28 +0000 |
commit | e82802070a6b64c86a09731497ef9eafaebdee5c (patch) | |
tree | b11757bd1c2a1627bdd1ebe1c38beb747d67e837 /lib/rubygems/commands/cleanup_command.rb | |
parent | 89bfee6fd47d059ca2a95159eb964f37bdbb3f2c (diff) |
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
Diffstat (limited to 'lib/rubygems/commands/cleanup_command.rb')
-rw-r--r-- | lib/rubygems/commands/cleanup_command.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb index db1bf3a794..79c23c840d 100644 --- a/lib/rubygems/commands/cleanup_command.rb +++ b/lib/rubygems/commands/cleanup_command.rb @@ -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}" |