Refactor benchmark and showing code
This commit is contained in:
parent
4f4fd9e962
commit
5a542ec527
|
@ -52,11 +52,13 @@ end
|
|||
|
||||
class Bench < Thor
|
||||
desc 'bench HAML', 'Benchmark haml template'
|
||||
option :show_code, type: :boolean, aliases: ['-c']
|
||||
def bench(file)
|
||||
puts "#{?= * 49}\n Compilation: #{file}\n#{?= * 49}"
|
||||
bench_compile(file)
|
||||
puts "#{?= * 49}\n Rendering: #{file}\n#{?= * 49}"
|
||||
bench_render(file)
|
||||
code(file) if options[:show_code]
|
||||
end
|
||||
|
||||
desc 'code HAML', 'Show compiled code'
|
||||
|
|
|
@ -4,13 +4,13 @@ build:
|
|||
- bundle-install
|
||||
- script:
|
||||
name: old_attributes.haml
|
||||
code: bin/bench benchmark/old_attributes.haml && bin/bench code benchmark/old_attributes.haml
|
||||
code: bin/bench bench -c benchmark/old_attributes.haml
|
||||
- script:
|
||||
name: attribute_builder.haml
|
||||
code: bin/bench benchmark/attribute_builder.haml && bin/bench code benchmark/attribute_builder.haml
|
||||
code: bin/bench bench -c benchmark/attribute_builder.haml
|
||||
- script:
|
||||
name: basic.haml
|
||||
code: bin/bench benchmark/basic.haml && bin/bench code benchmark/basic.haml
|
||||
code: bin/bench bench -c benchmark/basic.haml
|
||||
- script:
|
||||
name: minitest
|
||||
code: bundle exec rake test
|
||||
|
|
Loading…
Reference in New Issue