diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-06 02:35:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-06 02:35:48 +0000 |
commit | fd89088b629c7f6025bea0665c1f1f99dc82bf79 (patch) | |
tree | 402ac73989a3abf2e1bc922cb8907380aa02581a /lib/rdoc | |
parent | 00f849b68280d983c196e8252551621837d79585 (diff) | |
download | ruby-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.rb | 3 |
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 ## |