mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
b83787b1ce
commit
be980dd9fa
Notes:
git
2020-09-28 14:54:57 +09:00
2 changed files with 18 additions and 1 deletions
|
@ -15,6 +15,12 @@ class Gem::Commands::CleanupCommand < Gem::Command
|
||||||
options[:dryrun] = true
|
options[:dryrun] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_option('-n', '-d', '--dryrun',
|
||||||
|
'Do not uninstall gems') do |value, options|
|
||||||
|
options[:dryrun] = true
|
||||||
|
end
|
||||||
|
deprecate_option('--dryrun', extra_msg: 'Use --dry-run instead')
|
||||||
|
|
||||||
add_option('-D', '--[no-]check-development',
|
add_option('-D', '--[no-]check-development',
|
||||||
'Check development dependencies while uninstalling',
|
'Check development dependencies while uninstalling',
|
||||||
'(default: true)') do |value, options|
|
'(default: true)') do |value, options|
|
||||||
|
@ -41,7 +47,7 @@ class Gem::Commands::CleanupCommand < Gem::Command
|
||||||
end
|
end
|
||||||
|
|
||||||
def defaults_str # :nodoc:
|
def defaults_str # :nodoc:
|
||||||
"--no-dryrun"
|
"--no-dry-run"
|
||||||
end
|
end
|
||||||
|
|
||||||
def description # :nodoc:
|
def description # :nodoc:
|
||||||
|
|
|
@ -26,6 +26,17 @@ class TestGemCommandsCleanupCommand < Gem::TestCase
|
||||||
assert @cmd.options[:dryrun]
|
assert @cmd.options[:dryrun]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_handle_options_deprecated_dry_run
|
||||||
|
use_ui @ui do
|
||||||
|
@cmd.handle_options %w[--dryrun]
|
||||||
|
assert @cmd.options[:dryrun]
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_equal \
|
||||||
|
"WARNING: The \"--dryrun\" option has been deprecated and will be removed in future versions of Rubygems. Use --dry-run instead\n",
|
||||||
|
@ui.error
|
||||||
|
end
|
||||||
|
|
||||||
def test_handle_options_n
|
def test_handle_options_n
|
||||||
@cmd.handle_options %w[-n]
|
@cmd.handle_options %w[-n]
|
||||||
assert @cmd.options[:dryrun]
|
assert @cmd.options[:dryrun]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue