ruby-changes:45475
From: nobu <ko1@a...>
Date: Mon, 6 Feb 2017 11:35:53 +0900 (JST)
Subject: [ruby-changes:45475] nobu:r57548 (trunk): rdoc: suppress warnings in eval
nobu 2017-02-06 11:35:48 +0900 (Mon, 06 Feb 2017) New Revision: 57548 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57548 Log: 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. Modified files: trunk/lib/rdoc/markup/to_html.rb Index: lib/rdoc/markup/to_html.rb =================================================================== --- lib/rdoc/markup/to_html.rb (revision 57547) +++ lib/rdoc/markup/to_html.rb (revision 57548) @@ -383,9 +383,12 @@ class RDoc::Markup::ToHtml < RDoc::Marku https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markup/to_html.rb#L383 # 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 ## -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/