I'm not sure that you can grab the return value. Nevertheless, the exception that you report is related to the fact that Level 1 (=) can only be used for doctype=book
I am trying to implement fail-fast mode but I am really new in ruby and I need some advice :
How to abort processor (exception, exit, ...) ?
Where to write a function that will replace warn (helpers.rb) ?
How to access the command line options ?