parseable?(text)
Returns true if text is valid ruby syntax
# File lib/rdoc/markup/to_html.rb, line 384 def parseable? text eval("BEGIN {return true}\n#{text}") rescue SyntaxError false end