diff --git a/lib/haml/exec.rb b/lib/haml/exec.rb index 6ca566a2..761c7a4e 100644 --- a/lib/haml/exec.rb +++ b/lib/haml/exec.rb @@ -235,6 +235,10 @@ END opts.on('-I', '--load-path PATH', "Same as 'ruby -I'.") do |path| @options[:load_paths] << path end + + opts.on('--debug', "Print out the precompiled Ruby source.") do + @options[:debug] = true + end end def process_result @@ -254,6 +258,12 @@ END @options[:load_paths].each {|p| $LOAD_PATH << p} @options[:requires].each {|f| require f} + + if @options[:debug] + puts engine.precompiled + puts '=' * 100 + end + result = engine.to_html rescue Exception => e raise e if @options[:trace]