summaryrefslogtreecommitdiff
path: root/lib/irb.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-11-13 15:10:05 +0900
committeraycabta <aycabta@gmail.com>2019-11-13 15:15:28 +0900
commita5b6d7bca84fce6e13c68e8753893c4697960e3a (patch)
treed31f7f82bdd78007b94f1cbb90a30e56550a610f /lib/irb.rb
parentc33d29fba5a04bd31242eb51e54d2ec198c34ba3 (diff)
Suppress warnings except for when last evaluation
Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
Diffstat (limited to 'lib/irb.rb')
-rw-r--r--lib/irb.rb5
1 files changed, 4 insertions, 1 deletions
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"