diff options
author | Gustavo Ribeiro <[email protected]> | 2022-12-22 15:24:34 -0300 |
---|---|---|
committer | git <[email protected]> | 2022-12-26 19:08:55 +0000 |
commit | 08f6196bdac6b53df35caa5810839d28100d073c () | |
tree | ff4e37e1f03bf9d188d187165e6f24a1109d6f7a | |
parent | 28a17436503c3c4cb7a35b423a894b697cd80da9 (diff) |
[rubygems/rubygems] add global flag (-C) to change execution directory
https://.com/rubygems/rubygems/commit/312fc36711
-rw-r--r-- | lib/rubygems/command.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/command_manager.rb | 21 | ||||
-rw-r--r-- | test/rubygems/test_gem_command_manager.rb | 40 |
3 files changed, 62 insertions, 5 deletions
@@ -630,7 +630,11 @@ RubyGems is a package manager for Ruby. Usage: gem -h/--help gem -v/--version - gem command [arguments...] [options...] Examples: gem install rake @@ -175,14 +175,20 @@ class Gem::CommandManager when "-v", "--version" then say Gem::VERSION terminate_interaction 0 when /^-/ then alert_error clean_text("Invalid option: #{args.first}. See 'gem --help'.") terminate_interaction 1 else - cmd_name = args.shift.downcase - cmd = find_command cmd_name - cmd.deprecation_warning if cmd.deprecated? - cmd.invoke_with_build_args args, build_args end end @@ -237,4 +243,11 @@ class Gem::CommandManager ui.backtrace e end end end @@ -126,6 +126,46 @@ class TestGemCommandManager < Gem::TestCase @command_manager.unregister_command :crash end def test_process_args_bad_arg use_ui @ui do assert_raise Gem::MockGemUi::TermError do |