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:
parent
65e5321adf
commit
84012757a7
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Reference in a new issue