ruby-changes:70076
From: Colby <ko1@a...>
Date: Mon, 6 Dec 2021 17:43:19 +0900 (JST)
Subject: [ruby-changes:70076] 9c0c66f721 (master): [rubygems/rubygems] add login & logout for the signin & signout commands respectively
https://git.ruby-lang.org/ruby.git/commit/?id=9c0c66f721 From 9c0c66f721d707bec88b1690fa12d5b231ae2314 Mon Sep 17 00:00:00 2001 From: Colby Swandale <me@c...> Date: Sat, 4 Dec 2021 18:25:43 +1100 Subject: [rubygems/rubygems] add login & logout for the signin & signout commands respectively https://github.com/rubygems/rubygems/commit/49b491970b --- lib/rubygems/command_manager.rb | 4 +++- test/rubygems/test_gem_command_manager.rb | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb index 39bf8bd30d1..03cdd6a4bb9 100644 --- a/lib/rubygems/command_manager.rb +++ b/lib/rubygems/command_manager.rb @@ -73,7 +73,9 @@ class Gem::CommandManager https://github.com/ruby/ruby/blob/trunk/lib/rubygems/command_manager.rb#L73 ].freeze ALIAS_COMMANDS = { - 'i' => 'install', + 'i' => 'install', + 'login' => 'signin', + 'logout' => 'signout', }.freeze ## diff --git a/test/rubygems/test_gem_command_manager.rb b/test/rubygems/test_gem_command_manager.rb index f6a82908b33..c2e11d20029 100644 --- a/test/rubygems/test_gem_command_manager.rb +++ b/test/rubygems/test_gem_command_manager.rb @@ -36,6 +36,18 @@ class TestGemCommandManager < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_command_manager.rb#L36 assert_kind_of Gem::Commands::InstallCommand, command end + def test_find_login_alias_command + command = @command_manager.find_command 'login' + + assert_kind_of Gem::Commands::SigninCommand, command + end + + def test_find_logout_alias_comamnd + command = @command_manager.find_command 'logout' + + assert_kind_of Gem::Commands::SignoutCommand, command + end + def test_find_command_ambiguous_exact ins_command = Class.new Gem::Commands.send :const_set, :InsCommand, ins_command -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/