Skip to content

Commit

Permalink
Merge pull request #440 from nobu/bug/warnings-in-eval
Browse files Browse the repository at this point in the history
Suppress warnings in eval
  • Loading branch information
Zachary Scott committed Feb 6, 2017
2 parents 7b660d0 + 1c5af02 commit 091e98e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rdoc/markup/to_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,12 @@ def list_end_for(list_type)
# 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

##
Expand Down

0 comments on commit 091e98e

Please sign in to comment.