mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Add a --debug option to bin/haml.
This commit is contained in:
parent
71c0146626
commit
d9530e2328
1 changed files with 10 additions and 0 deletions
|
@ -235,6 +235,10 @@ END
|
||||||
opts.on('-I', '--load-path PATH', "Same as 'ruby -I'.") do |path|
|
opts.on('-I', '--load-path PATH', "Same as 'ruby -I'.") do |path|
|
||||||
@options[:load_paths] << path
|
@options[:load_paths] << path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on('--debug', "Print out the precompiled Ruby source.") do
|
||||||
|
@options[:debug] = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_result
|
def process_result
|
||||||
|
@ -254,6 +258,12 @@ END
|
||||||
|
|
||||||
@options[:load_paths].each {|p| $LOAD_PATH << p}
|
@options[:load_paths].each {|p| $LOAD_PATH << p}
|
||||||
@options[:requires].each {|f| require f}
|
@options[:requires].each {|f| require f}
|
||||||
|
|
||||||
|
if @options[:debug]
|
||||||
|
puts engine.precompiled
|
||||||
|
puts '=' * 100
|
||||||
|
end
|
||||||
|
|
||||||
result = engine.to_html
|
result = engine.to_html
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
raise e if @options[:trace]
|
raise e if @options[:trace]
|
||||||
|
|
Loading…
Add table
Reference in a new issue