From af594f5166538d6d7f5c21d26ed824f03730c61a Mon Sep 17 00:00:00 2001 From: Ellen Marie Dash Date: Tue, 25 Mar 2025 18:19:56 -0400 Subject: [PATCH] [rubygems/rubygems] Have "gem exec" sort executable names in error message. This decouples `gem exec` behavior (and tests) from the sort order of the gemspec. https://github.com/rubygems/rubygems/commit/911cd29159 --- lib/rubygems/commands/exec_command.rb | 2 +- test/rubygems/test_gem_commands_exec_command.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rubygems/commands/exec_command.rb b/lib/rubygems/commands/exec_command.rb index 82f1734b58..c24ebbf711 100644 --- a/lib/rubygems/commands/exec_command.rb +++ b/lib/rubygems/commands/exec_command.rb @@ -216,7 +216,7 @@ to the same gem path as user-installed gems. if spec.executables.size > 1 alert_error "Ambiguous which executable from gem `#{executable}` should be run: " \ - "the options are #{spec.executables}, specify one via COMMAND, and use `-g` and `-v` to specify gem and version" + "the options are #{spec.executables.sort}, specify one via COMMAND, and use `-g` and `-v` to specify gem and version" terminate_interaction 1 end diff --git a/test/rubygems/test_gem_commands_exec_command.rb b/test/rubygems/test_gem_commands_exec_command.rb index 806a6b5424..db738b5e9f 100644 --- a/test/rubygems/test_gem_commands_exec_command.rb +++ b/test/rubygems/test_gem_commands_exec_command.rb @@ -374,7 +374,7 @@ class TestGemCommandsExecCommand < Gem::TestCase @cmd.invoke "a:2" end assert_equal 1, e.exit_code - assert_equal "ERROR: Ambiguous which executable from gem `a` should be run: the options are [\"foo\", \"bar\"], specify one via COMMAND, and use `-g` and `-v` to specify gem and version\n", @ui.error + assert_equal "ERROR: Ambiguous which executable from gem `a` should be run: the options are [\"bar\", \"foo\"], specify one via COMMAND, and use `-g` and `-v` to specify gem and version\n", @ui.error end end