1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2017-02-06 02:35:48 +00:00
parent 65e5321adf
commit 84012757a7

View file

@ -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
##