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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/bench.yml +24 -0
  3. data/.github/workflows/test.yml +2 -8
  4. data/CHANGELOG.md +71 -0
  5. data/Gemfile +0 -1
  6. data/README.md +17 -40
  7. data/REFERENCE.md +1 -75
  8. data/Rakefile +1 -6
  9. data/bin/bench +0 -6
  10. data/hamlit.gemspec +1 -2
  11. data/lib/hamlit/attribute_builder.rb +1 -1
  12. data/lib/hamlit/cli.rb +1 -0
  13. data/lib/hamlit/compiler/script_compiler.rb +3 -2
  14. data/lib/hamlit/compiler.rb +1 -1
  15. data/lib/hamlit/engine.rb +3 -1
  16. data/lib/hamlit/filters/tilt_base.rb +5 -1
  17. data/lib/hamlit/parser.rb +2 -0
  18. data/lib/hamlit/rails_template.rb +5 -2
  19. data/lib/hamlit/version.rb +1 -1
  20. metadata +7 -54
  21. data/benchmark/boolean_attribute.haml +0 -6
  22. data/benchmark/class_attribute.haml +0 -5
  23. data/benchmark/common_attribute.haml +0 -3
  24. data/benchmark/data_attribute.haml +0 -4
  25. data/benchmark/dynamic_attributes/boolean_attribute.haml +0 -4
  26. data/benchmark/dynamic_attributes/class_attribute.haml +0 -4
  27. data/benchmark/dynamic_attributes/common_attribute.haml +0 -2
  28. data/benchmark/dynamic_attributes/data_attribute.haml +0 -2
  29. data/benchmark/dynamic_attributes/id_attribute.haml +0 -2
  30. data/benchmark/dynamic_boolean_attribute.haml +0 -4
  31. data/benchmark/dynamic_merger/benchmark.rb +0 -25
  32. data/benchmark/dynamic_merger/hello.haml +0 -50
  33. data/benchmark/dynamic_merger/hello.string +0 -50
  34. data/benchmark/etc/attribute_builder.haml +0 -5
  35. data/benchmark/etc/real_sample.haml +0 -888
  36. data/benchmark/etc/real_sample.rb +0 -11
  37. data/benchmark/etc/static_analyzer.haml +0 -1
  38. data/benchmark/etc/string_interpolation.haml +0 -2
  39. data/benchmark/etc/tags.haml +0 -3
  40. data/benchmark/etc/tags_loop.haml +0 -2
  41. data/benchmark/ext/build_data.rb +0 -17
  42. data/benchmark/ext/build_id.rb +0 -13
  43. data/benchmark/graph/graph.key +0 -0
  44. data/benchmark/graph/graph.png +0 -0
  45. data/benchmark/id_attribute.haml +0 -3
  46. data/benchmark/plain.haml +0 -4
  47. data/benchmark/script.haml +0 -4
  48. data/benchmark/slim/LICENSE +0 -21
  49. data/benchmark/slim/context.rb +0 -11
  50. data/benchmark/slim/run-benchmarks.rb +0 -94
  51. data/benchmark/slim/view.erb +0 -23
  52. data/benchmark/slim/view.haml +0 -18
  53. data/benchmark/slim/view.slim +0 -17
  54. data/benchmark/utils/benchmark_ips_extension.rb +0 -43
@@ -1,2 +0,0 @@
1
- - hash = { data: { 'user' => { id: 1234, name: 'k0kubun' }, book_id: 5432 } }
2
- %div{ hash } data
@@ -1,2 +0,0 @@
1
- - hash = { id: %w[content active] }
2
- #book{ hash }
@@ -1,4 +0,0 @@
1
- - disabled = false
2
- %input{ disabled: disabled }
3
- - disabled = true
4
- %input{ disabled: disabled }
@@ -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 }
@@ -1,5 +0,0 @@
1
- - h = { 'user' => { id: 1234, name: 'eagletmt' }, book_id: 5432 }
2
- - c = %w[content active]
3
-
4
- %span.book{data: h, class: c}
5
- Book