mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Add code viewer
This commit is contained in:
parent
3cf278d626
commit
97909bf329
1 changed files with 11 additions and 0 deletions
11
bin/bench
11
bin/bench
|
@ -59,6 +59,17 @@ class Bench < Thor
|
|||
bench_render(file)
|
||||
end
|
||||
|
||||
desc 'code HAML', 'Show compiled code'
|
||||
def code(file)
|
||||
haml = File.read(file)
|
||||
puts "#{?= * 49}\n Haml Source: #{file}\n#{?= * 49}"
|
||||
puts Haml::Engine.new(haml).precompiled
|
||||
puts "\n#{?= * 49}\n Faml Source: #{file}\n#{?= * 49}"
|
||||
puts Faml::Engine.new.call(haml)
|
||||
puts "\n#{?= * 49}\n Hamlit Source: #{file}\n#{?= * 49}"
|
||||
puts Hamlit::Engine.new.call(haml)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def bench_compile(file)
|
||||
|
|
Loading…
Add table
Reference in a new issue