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:
parent
65e5321adf
commit
84012757a7
@ -383,9 +383,12 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||||||
# Returns true if text is valid ruby syntax
|
# Returns true if text is valid ruby syntax
|
||||||
|
|
||||||
def parseable? text
|
def parseable? text
|
||||||
|
verbose, $VERBOSE = $VERBOSE, nil
|
||||||
eval("BEGIN {return true}\n#{text}")
|
eval("BEGIN {return true}\n#{text}")
|
||||||
rescue SyntaxError
|
rescue SyntaxError
|
||||||
false
|
false
|
||||||
|
ensure
|
||||||
|
$VERBOSE = verbose
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
Loading…
x
Reference in New Issue
Block a user