зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] deprecate gem build -C flag
https://github.com/rubygems/rubygems/commit/fac241d4ef
This commit is contained in:
Родитель
08f6196bda
Коммит
f5a035daf9
|
@ -26,6 +26,9 @@ class Gem::Commands::BuildCommand < Gem::Command
|
|||
add_option "-C PATH", "Run as if gem build was started in <PATH> instead of the current working directory." do |value, options|
|
||||
options[:build_path] = value
|
||||
end
|
||||
deprecate_option "-C",
|
||||
version: "4.0",
|
||||
extra_msg: "-C is a global flag now. Use `gem -C PATH build GEMSPEC_FILE [options]` instead"
|
||||
end
|
||||
|
||||
def arguments # :nodoc:
|
||||
|
|
|
@ -41,6 +41,16 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|||
assert_includes Gem.platforms, Gem::Platform.local
|
||||
end
|
||||
|
||||
def test_handle_deprecated_options
|
||||
use_ui @ui do
|
||||
@cmd.handle_options %w[-C ./test/dir]
|
||||
end
|
||||
|
||||
assert_equal "WARNING: The \"-C\" option has been deprecated and will be removed in Rubygems 4.0. " \
|
||||
"-C is a global flag now. Use `gem -C PATH build GEMSPEC_FILE [options]` instead\n",
|
||||
@ui.error
|
||||
end
|
||||
|
||||
def test_options_filename
|
||||
gemspec_file = File.join(@tempdir, @gem.spec_name)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче