Parent

Methods

Object

Constants

BracketDirectives

Regex for removing bracket directives

Public Instance Methods

valid_syntax?(code, fname = 'parser_code') click to toggle source

Verifies that code is valid Ruby code. returns false if not

# File lib/Getopt/Declare.rb, line 31
def valid_syntax?(code, fname = 'parser_code')
  eval("BEGIN {return true}\n#{code}", nil, fname, 0)
rescue Exception
  false
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.