aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-06 02:35:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-06 02:35:48 +0000
commitfd89088b629c7f6025bea0665c1f1f99dc82bf79 (patch)
tree402ac73989a3abf2e1bc922cb8907380aa02581a /lib/rdoc
parent00f849b68280d983c196e8252551621837d79585 (diff)
downloadruby-fd89088b629c7f6025bea0665c1f1f99dc82bf79.tar.gz
rdoc: suppress warnings in eval
* lib/rdoc/markup/to_html.rb (RDoc::Markup::ToHtml): the argument text may contain warnings, which are useless to check if parseable. merge rdoc/rdoc#440. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/markup/to_html.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/rdoc/markup/to_html.rb b/lib/rdoc/markup/to_html.rb
index 3bf66c2c31..aa5de7bf66 100644
--- a/lib/rdoc/markup/to_html.rb
+++ b/lib/rdoc/markup/to_html.rb
@@ -383,9 +383,12 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
# Returns true if text is valid ruby syntax
def parseable? text
+ verbose, $VERBOSE = $VERBOSE, nil
eval("BEGIN {return true}\n#{text}")
rescue SyntaxError
false
+ ensure
+ $VERBOSE = verbose
end
##