I have a Ruby script that defines a class. I would like the script to execute the statement
BoolParser.generate :file_base=>'bool_parser'
only when the script is invoked as an executable, not when it is require
'd from irb (or passed on the command line via -r
). What can I wrap around the statement above to prevent it from executing whenever my Ruby file is loaded?