From a5b6d7bca84fce6e13c68e8753893c4697960e3a Mon Sep 17 00:00:00 2001 From: aycabta Date: Wed, 13 Nov 2019 15:10:05 +0900 Subject: Suppress warnings except for when last evaluation Co-authored-by: Kazuhiro NISHIYAMA --- lib/irb.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/irb.rb') diff --git a/lib/irb.rb b/lib/irb.rb index 97af046d05..2bf46aa227 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -766,7 +766,10 @@ module IRB # s-expression where the second selement of the top level array is an # array of parsed expressions. The first element of each expression is the # expression's type. - ASSIGNMENT_NODE_TYPES.include?(Ripper.sexp(line)&.dig(1,-1,0)) + verbose, $VERBOSE = $VERBOSE, nil + result = ASSIGNMENT_NODE_TYPES.include?(Ripper.sexp(line)&.dig(1,-1,0)) + $VERBOSE = verbose + result end ATTR_TTY = "\e[%sm" -- cgit v1.2.3