From 84012757a7db4b24622b1499df2c2ae4b8cbf2ad Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 6 Feb 2017 02:35:48 +0000 Subject: 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 --- lib/rdoc/markup/to_html.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/rdoc/markup') 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 ## -- cgit v1.2.3