Show code on benchmark
This commit is contained in:
parent
eb68642b92
commit
22a1d8b3f5
|
@ -9,6 +9,7 @@ require 'hamlit1' if File.exist?('hamlit1')
|
||||||
|
|
||||||
class Bench < Thor
|
class Bench < Thor
|
||||||
class_option :with_hamlit1, type: :boolean, aliases: ['-w']
|
class_option :with_hamlit1, type: :boolean, aliases: ['-w']
|
||||||
|
class_option :show_template, type: :boolean, aliases: ['-t']
|
||||||
|
|
||||||
desc 'bench HAML', 'Benchmark haml template'
|
desc 'bench HAML', 'Benchmark haml template'
|
||||||
option :compile, type: :boolean, aliases: ['-c']
|
option :compile, type: :boolean, aliases: ['-c']
|
||||||
|
@ -37,6 +38,7 @@ class Bench < Thor
|
||||||
def render(file)
|
def render(file)
|
||||||
puts "#{?= * 49}\n Rendering: #{file}\n#{?= * 49}"
|
puts "#{?= * 49}\n Rendering: #{file}\n#{?= * 49}"
|
||||||
haml = File.read(file)
|
haml = File.read(file)
|
||||||
|
puts haml + "\n" if options[:show_template]
|
||||||
object = Object.new
|
object = Object.new
|
||||||
ruby_file = file.gsub(/\.haml\z/, '.rb')
|
ruby_file = file.gsub(/\.haml\z/, '.rb')
|
||||||
if File.exist?(ruby_file)
|
if File.exist?(ruby_file)
|
||||||
|
|
12
wercker.yml
12
wercker.yml
|
@ -14,22 +14,22 @@ build:
|
||||||
code: bin/clone
|
code: bin/clone
|
||||||
- script:
|
- script:
|
||||||
name: "[benchmark] static attributes"
|
name: "[benchmark] static attributes"
|
||||||
code: bin/bench bench -w benchmark/boolean_attribute.haml benchmark/class_attribute.haml benchmark/id_attribute.haml benchmark/data_attribute.haml benchmark/common_attribute.haml
|
code: bin/bench bench -w -t benchmark/boolean_attribute.haml benchmark/class_attribute.haml benchmark/id_attribute.haml benchmark/data_attribute.haml benchmark/common_attribute.haml
|
||||||
- script:
|
- script:
|
||||||
name: "[benchmark] dynamic attributes"
|
name: "[benchmark] dynamic attributes"
|
||||||
code: bin/bench bench -w benchmark/dynamic_attributes/boolean_attribute.haml benchmark/dynamic_attributes/class_attribute.haml benchmark/dynamic_attributes/id_attribute.haml benchmark/dynamic_attributes/data_attribute.haml benchmark/dynamic_attributes/common_attribute.haml
|
code: bin/bench bench -w -t benchmark/dynamic_attributes/boolean_attribute.haml benchmark/dynamic_attributes/class_attribute.haml benchmark/dynamic_attributes/id_attribute.haml benchmark/dynamic_attributes/data_attribute.haml benchmark/dynamic_attributes/common_attribute.haml
|
||||||
- script:
|
- script:
|
||||||
name: "[benchmark] plain text"
|
name: "[benchmark] plain text"
|
||||||
code: bin/bench bench -w benchmark/plain.haml
|
code: bin/bench bench -w -t benchmark/plain.haml
|
||||||
- script:
|
- script:
|
||||||
name: "[benchmark] script"
|
name: "[benchmark] script"
|
||||||
code: bin/bench bench -w benchmark/script.haml
|
code: bin/bench bench -w -t benchmark/script.haml
|
||||||
- script:
|
- script:
|
||||||
name: "[benchmark] attribute_builder bench by faml"
|
name: "[benchmark] attribute_builder bench by faml"
|
||||||
code: bin/bench bench -w benchmark/etc/attribute_builder.haml
|
code: bin/bench bench -w -t benchmark/etc/attribute_builder.haml
|
||||||
- script:
|
- script:
|
||||||
name: "[benchmark] slim-template/slim/benchmarks"
|
name: "[benchmark] slim-template/slim/benchmarks"
|
||||||
code: bundle exec ruby benchmark/slim/run-benchmarks.rb
|
code: bundle exec ruby benchmark/slim/run-benchmarks.rb
|
||||||
- script:
|
- script:
|
||||||
name: "[benchmark] static analyzer"
|
name: "[benchmark] static analyzer"
|
||||||
code: bin/bench bench -w benchmark/etc/static_analyzer.haml
|
code: bin/bench bench -w -t benchmark/etc/static_analyzer.haml
|
||||||
|
|
Loading…
Reference in New Issue