hamlit 2.15.0 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/bench.yml +24 -0
- data/.github/workflows/test.yml +2 -8
- data/CHANGELOG.md +71 -0
- data/Gemfile +0 -1
- data/README.md +17 -40
- data/REFERENCE.md +1 -75
- data/Rakefile +1 -6
- data/bin/bench +0 -6
- data/hamlit.gemspec +1 -2
- data/lib/hamlit/attribute_builder.rb +1 -1
- data/lib/hamlit/cli.rb +1 -0
- data/lib/hamlit/compiler/script_compiler.rb +3 -2
- data/lib/hamlit/compiler.rb +1 -1
- data/lib/hamlit/engine.rb +3 -1
- data/lib/hamlit/filters/tilt_base.rb +5 -1
- data/lib/hamlit/parser.rb +2 -0
- data/lib/hamlit/rails_template.rb +5 -2
- data/lib/hamlit/version.rb +1 -1
- metadata +7 -54
- data/benchmark/boolean_attribute.haml +0 -6
- data/benchmark/class_attribute.haml +0 -5
- data/benchmark/common_attribute.haml +0 -3
- data/benchmark/data_attribute.haml +0 -4
- data/benchmark/dynamic_attributes/boolean_attribute.haml +0 -4
- data/benchmark/dynamic_attributes/class_attribute.haml +0 -4
- data/benchmark/dynamic_attributes/common_attribute.haml +0 -2
- data/benchmark/dynamic_attributes/data_attribute.haml +0 -2
- data/benchmark/dynamic_attributes/id_attribute.haml +0 -2
- data/benchmark/dynamic_boolean_attribute.haml +0 -4
- data/benchmark/dynamic_merger/benchmark.rb +0 -25
- data/benchmark/dynamic_merger/hello.haml +0 -50
- data/benchmark/dynamic_merger/hello.string +0 -50
- data/benchmark/etc/attribute_builder.haml +0 -5
- data/benchmark/etc/real_sample.haml +0 -888
- data/benchmark/etc/real_sample.rb +0 -11
- data/benchmark/etc/static_analyzer.haml +0 -1
- data/benchmark/etc/string_interpolation.haml +0 -2
- data/benchmark/etc/tags.haml +0 -3
- data/benchmark/etc/tags_loop.haml +0 -2
- data/benchmark/ext/build_data.rb +0 -17
- data/benchmark/ext/build_id.rb +0 -13
- data/benchmark/graph/graph.key +0 -0
- data/benchmark/graph/graph.png +0 -0
- data/benchmark/id_attribute.haml +0 -3
- data/benchmark/plain.haml +0 -4
- data/benchmark/script.haml +0 -4
- data/benchmark/slim/LICENSE +0 -21
- data/benchmark/slim/context.rb +0 -11
- data/benchmark/slim/run-benchmarks.rb +0 -94
- data/benchmark/slim/view.erb +0 -23
- data/benchmark/slim/view.haml +0 -18
- data/benchmark/slim/view.slim +0 -17
- data/benchmark/utils/benchmark_ips_extension.rb +0 -43
@@ -1,25 +0,0 @@
|
|
1
|
-
# Original: https://github.com/amatsuda/string_template/blob/master/benchmark.rb
|
2
|
-
require 'benchmark_driver'
|
3
|
-
|
4
|
-
Benchmark.driver(repeat_count: 8) do |x|
|
5
|
-
x.prelude %{
|
6
|
-
require 'rails'
|
7
|
-
require 'action_view'
|
8
|
-
require 'string_template'
|
9
|
-
StringTemplate::Railtie.run_initializers
|
10
|
-
require 'hamlit'
|
11
|
-
Hamlit::Railtie.run_initializers
|
12
|
-
Hamlit::RailsTemplate.set_options(escape_html: false, generator: Temple::Generators::ArrayBuffer)
|
13
|
-
require 'action_view/base'
|
14
|
-
|
15
|
-
(view = Class.new(ActionView::Base).new(ActionView::LookupContext.new(''))).instance_variable_set(:@world, 'world!')
|
16
|
-
|
17
|
-
# compile template
|
18
|
-
hello = 'benchmark/dynamic_merger/hello'
|
19
|
-
view.render(template: hello, handlers: 'string')
|
20
|
-
view.render(template: hello, handlers: 'haml')
|
21
|
-
}
|
22
|
-
x.report 'string', %{ view.render(template: hello, handlers: 'string') }
|
23
|
-
x.report 'hamlit', %{ view.render(template: hello, handlers: 'haml') }
|
24
|
-
x.loop_count 100_000
|
25
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
hello, #{ @world }
|
2
|
-
hello, #{ @world }
|
3
|
-
hello, #{ @world }
|
4
|
-
hello, #{ @world }
|
5
|
-
hello, #{ @world }
|
6
|
-
hello, #{ @world }
|
7
|
-
hello, #{ @world }
|
8
|
-
hello, #{ @world }
|
9
|
-
hello, #{ @world }
|
10
|
-
hello, #{ @world }
|
11
|
-
hello, #{ @world }
|
12
|
-
hello, #{ @world }
|
13
|
-
hello, #{ @world }
|
14
|
-
hello, #{ @world }
|
15
|
-
hello, #{ @world }
|
16
|
-
hello, #{ @world }
|
17
|
-
hello, #{ @world }
|
18
|
-
hello, #{ @world }
|
19
|
-
hello, #{ @world }
|
20
|
-
hello, #{ @world }
|
21
|
-
hello, #{ @world }
|
22
|
-
hello, #{ @world }
|
23
|
-
hello, #{ @world }
|
24
|
-
hello, #{ @world }
|
25
|
-
hello, #{ @world }
|
26
|
-
hello, #{ @world }
|
27
|
-
hello, #{ @world }
|
28
|
-
hello, #{ @world }
|
29
|
-
hello, #{ @world }
|
30
|
-
hello, #{ @world }
|
31
|
-
hello, #{ @world }
|
32
|
-
hello, #{ @world }
|
33
|
-
hello, #{ @world }
|
34
|
-
hello, #{ @world }
|
35
|
-
hello, #{ @world }
|
36
|
-
hello, #{ @world }
|
37
|
-
hello, #{ @world }
|
38
|
-
hello, #{ @world }
|
39
|
-
hello, #{ @world }
|
40
|
-
hello, #{ @world }
|
41
|
-
hello, #{ @world }
|
42
|
-
hello, #{ @world }
|
43
|
-
hello, #{ @world }
|
44
|
-
hello, #{ @world }
|
45
|
-
hello, #{ @world }
|
46
|
-
hello, #{ @world }
|
47
|
-
hello, #{ @world }
|
48
|
-
hello, #{ @world }
|
49
|
-
hello, #{ @world }
|
50
|
-
hello, #{ @world }
|
@@ -1,50 +0,0 @@
|
|
1
|
-
hello, #{ @world }
|
2
|
-
hello, #{ @world }
|
3
|
-
hello, #{ @world }
|
4
|
-
hello, #{ @world }
|
5
|
-
hello, #{ @world }
|
6
|
-
hello, #{ @world }
|
7
|
-
hello, #{ @world }
|
8
|
-
hello, #{ @world }
|
9
|
-
hello, #{ @world }
|
10
|
-
hello, #{ @world }
|
11
|
-
hello, #{ @world }
|
12
|
-
hello, #{ @world }
|
13
|
-
hello, #{ @world }
|
14
|
-
hello, #{ @world }
|
15
|
-
hello, #{ @world }
|
16
|
-
hello, #{ @world }
|
17
|
-
hello, #{ @world }
|
18
|
-
hello, #{ @world }
|
19
|
-
hello, #{ @world }
|
20
|
-
hello, #{ @world }
|
21
|
-
hello, #{ @world }
|
22
|
-
hello, #{ @world }
|
23
|
-
hello, #{ @world }
|
24
|
-
hello, #{ @world }
|
25
|
-
hello, #{ @world }
|
26
|
-
hello, #{ @world }
|
27
|
-
hello, #{ @world }
|
28
|
-
hello, #{ @world }
|
29
|
-
hello, #{ @world }
|
30
|
-
hello, #{ @world }
|
31
|
-
hello, #{ @world }
|
32
|
-
hello, #{ @world }
|
33
|
-
hello, #{ @world }
|
34
|
-
hello, #{ @world }
|
35
|
-
hello, #{ @world }
|
36
|
-
hello, #{ @world }
|
37
|
-
hello, #{ @world }
|
38
|
-
hello, #{ @world }
|
39
|
-
hello, #{ @world }
|
40
|
-
hello, #{ @world }
|
41
|
-
hello, #{ @world }
|
42
|
-
hello, #{ @world }
|
43
|
-
hello, #{ @world }
|
44
|
-
hello, #{ @world }
|
45
|
-
hello, #{ @world }
|
46
|
-
hello, #{ @world }
|
47
|
-
hello, #{ @world }
|
48
|
-
hello, #{ @world }
|
49
|
-
hello, #{ @world }
|
50
|
-
hello, #{ @world }
|