[ruby/rubygems] Removed deprecated -C option from gem build

https://github.com/ruby/rubygems/commit/3471646d43
This commit is contained in:
Hiroshi SHIBATA 2025-11-17 11:17:19 +09:00 committed by git
parent 093dbbbd35
commit 02279f01ac
3 changed files with 1 additions and 18 deletions

View File

@ -25,13 +25,6 @@ class Gem::Commands::BuildCommand < Gem::Command
add_option "-o", "--output FILE", "output gem with the given filename" do |value, options|
options[:output] = value
end
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:

View File

@ -43,16 +43,6 @@ 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)

View File

@ -36,7 +36,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase
def test_gem_help_build
util_gem "build" do |out, err|
assert_match(/-C PATH *Run as if gem build was started in <PATH>/, out)
assert_match(/--platform PLATFORM\s+Specify the platform of gem to build/, out)
assert_equal "", err
end
end