From 6311282690fd2d82a720892bdcf4cec5177424ab Mon Sep 17 00:00:00 2001 From: Steve Shreeve Date: Wed, 11 Jan 2023 17:41:54 -0700 Subject: [PATCH] Allow alias warnings to be silenced Allow a user to silence the warning that certain methods cannot be aliased. The use case is for tools that use `irb` and are already aware of the warning, but deem it acceptable and just want to suppress it. Code would need to do the following to hush these warnings: ``` IRB::ExtendCommandBundle::HushAliasWarning = true ``` --- lib/irb/extend-command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irb/extend-command.rb b/lib/irb/extend-command.rb index 6446c48ef..9cbeb33a1 100644 --- a/lib/irb/extend-command.rb +++ b/lib/irb/extend-command.rb @@ -306,7 +306,7 @@ def install_alias_method(to, from, override = NO_OVERRIDE) end alias_method to, from } - else + elsif !defined?(HushAliasWarning) Kernel.print "irb: warn: can't alias #{to} from #{from}.\n" end end