hamlit 2.15.1 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b60ad4fa07019d3e03bc5d521d624607f4dc1740ccaf73f1cee9de9826f38618
4
- data.tar.gz: 4d458ddca75c342e4f10f4cf8ccf8f660f0db230dcd8973f91bd37a3c5cf7ae9
3
+ metadata.gz: '0739d31df6aecc4a332c868e258322fb77a8e6003d5aa2c5fee02468809f009b'
4
+ data.tar.gz: 1917aeca307e771331e8e6d997ef58c90f106c2f4c002e35c4fb7fd424779db9
5
5
  SHA512:
6
- metadata.gz: 2bf9dda73fd3ad47f464a5c05327558f7f21afa2e5fa57e3c48ee726c3fcb93177a8fac9300889e7d42e3c5d0cc443a111fe9b2978d55504dbc92474488e0436
7
- data.tar.gz: 06a36cc3240044789e160583742950f3c579f9de273ccb0291cd825264da2ea8821b0152ef4aef5d3f4c888c37c3c318628c23bdf60b8042af865a85812efa81
6
+ metadata.gz: 80000682f6fa89d6ceedd7137d3b1156bb9850707640bfdaf3330249c81251f6a036b3e175617d6e9b51e218d5f2cf12b551772c223e83bc6f7836afe260e62b
7
+ data.tar.gz: 87b2fb79433a8c593d0dbd4d0df17f28f5b5d64c250833048d4f6eddeb729c9394aa13a541cad8f2436237dd7da2a218af06910e4d9886f3a6ed7322f62d5d1a
@@ -13,34 +13,12 @@ on:
13
13
  jobs:
14
14
  bench:
15
15
  runs-on: ubuntu-latest
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- include:
20
- - slim: 1
21
- - template: 'benchmark/boolean_attribute.haml,benchmark/class_attribute.haml,benchmark/id_attribute.haml,benchmark/data_attribute.haml,benchmark/common_attribute.haml'
22
- - template: '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'
23
- - template: 'benchmark/etc/attribute_builder.haml'
24
- - template: 'benchmark/etc/static_analyzer.haml'
25
- - template: 'benchmark/etc/string_interpolation.haml'
26
- - template: 'test/haml/templates/standard.haml'
27
- compile: 1
28
16
  steps:
29
17
  - uses: actions/checkout@v2
18
+ - run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev # nodejs for execjs, libxslt for TruffleRuby nokogiri
30
19
  - name: Set up Ruby
31
20
  uses: ruby/setup-ruby@v1
32
21
  with:
33
- ruby-version: 3.0
34
- - uses: actions/cache@v2
35
- with:
36
- path: vendor/bundle
37
- key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
38
- restore-keys: ${{ runner.os }}-gems-
39
- - run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev # nodejs for execjs, libxslt for TruffleRuby nokogiri
40
- - name: bundle install
41
- run: bundle config path vendor/bundle && bundle install -j$(nproc) --retry 3
22
+ ruby-version: '3.0'
23
+ bundler-cache: true
42
24
  - run: bundle exec rake bench
43
- env:
44
- SLIM_BENCH: ${{ matrix.slim }}
45
- TEMPLATE: ${{ matrix.template }}
46
- COMPILE: ${{ matrix.compile }}
@@ -25,16 +25,10 @@ jobs:
25
25
  - truffleruby-head
26
26
  steps:
27
27
  - uses: actions/checkout@v2
28
+ - run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev # nodejs for execjs, libxslt for TruffleRuby nokogiri
28
29
  - name: Set up Ruby
29
30
  uses: ruby/setup-ruby@v1
30
31
  with:
31
32
  ruby-version: ${{ matrix.ruby }}
32
- - uses: actions/cache@v2
33
- with:
34
- path: vendor/bundle
35
- key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
36
- restore-keys: ${{ runner.os }}-gems-
37
- - run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev # nodejs for execjs, libxslt for TruffleRuby nokogiri
38
- - name: bundle install
39
- run: bundle config path vendor/bundle && bundle install -j$(nproc) --retry 3
33
+ bundler-cache: true
40
34
  - run: bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -4,6 +4,70 @@ All notable changes to this project will be documented in this file. This
4
4
  project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
5
5
  [keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).
6
6
 
7
+ ## [3.0.3](https://github.com/k0kubun/hamlit/compare/v3.0.2...v3.0.3) - 2022-11-07
8
+
9
+ ### Added
10
+
11
+ - Support sass-embedded [#196](https://github.com/k0kubun/hamlit/issues/196)
12
+ *Thanks to @ntkme*
13
+
14
+ ## [3.0.2](https://github.com/k0kubun/hamlit/compare/v3.0.1...v3.0.2) - 2022-10-13
15
+
16
+ ### Changed
17
+
18
+ - `Hamlit::Engine` and `Hamlit::Template` use StringBuffer instead of ArrayBuffer
19
+ - It seems more performant in many cases with recent Ruby versions.
20
+ - `Hamlit::RailsTemplate` is not affected.
21
+
22
+ ## [3.0.1](https://github.com/k0kubun/hamlit/compare/v3.0.0...v3.0.1) - 2022-08-18
23
+
24
+ ### Changed
25
+
26
+ - coffee-script is removed from development dependency
27
+ - It's not runtime dependency, so it shouldn't impact your application
28
+ - `:coffee` filter still works if you explicitly install coffee-script,
29
+ however, it's no longer maintained and possibly removed in the future.
30
+
31
+ ## [3.0.0](https://github.com/k0kubun/hamlit/compare/v2.16.2...v3.0.0) - 2022-08-07
32
+
33
+ ### Changed
34
+
35
+ - [**breaking**] Use `disable_capture: false` for non-Rails environments
36
+ - `:disable_capture` is an option introduced in v2.16.1. See its release notes for details.
37
+ - If you use Rails, it continues to use `disable_capture: true`, so you're not impacted by this change.
38
+
39
+ ## [2.16.2](https://github.com/k0kubun/hamlit/compare/v2.16.1...v2.16.2) - 2022-08-07
40
+
41
+ ### Fixed
42
+
43
+ - Fix an issue when `disable_capture: false` is set and a Ruby comment is put after `do`
44
+
45
+ ## [2.16.1](https://github.com/k0kubun/hamlit/compare/v2.16.0...v2.16.1) - 2022-08-07
46
+
47
+ ### Added
48
+
49
+ - Introduce `:disable_capture` option to capture a block
50
+ - Default: `disable_capture: true` (backward-compatible)
51
+ - For Rails, this must be `true` anyway to use Rails-native capturing.
52
+ - If you override the option like `disable_capture: false` in Hamlit::Template,
53
+ scripts starting with `=` (e.g. `= render do`) capture a block content.
54
+ - Scripts starting with `-` (e.g. `- users.each do`) are not impacted.
55
+
56
+ ## [2.16.0](https://github.com/k0kubun/hamlit/compare/v2.15.2...v2.16.0) - 2022-02-03
57
+
58
+ ### Added
59
+
60
+ - Raise an exception on a Haml-level syntax error with `hamlit compile -c`
61
+ [#189](https://github.com/k0kubun/hamlit/issues/189)
62
+ *Thanks to @dlwr*
63
+
64
+ ## [2.15.2](https://github.com/k0kubun/hamlit/compare/v2.15.1...v2.15.2) - 2022-01-04
65
+
66
+ ### Fixed
67
+
68
+ - Consider `playsinline` a boolean attribute [#187](https://github.com/k0kubun/hamlit/issues/187)
69
+ *Thanks to @ghiculescu*
70
+
7
71
  ## [2.15.1](https://github.com/k0kubun/hamlit/compare/v2.15.0...v2.15.1) - 2021-07-23
8
72
 
9
73
  ### Fixed
data/Gemfile CHANGED
@@ -18,7 +18,6 @@ else
18
18
  gem 'redcarpet'
19
19
 
20
20
  if RUBY_PLATFORM !~ /mswin|mingw/ && RUBY_ENGINE != 'truffleruby'
21
- gem 'faml'
22
21
  gem 'stackprof'
23
22
  end
24
23
  end
data/README.md CHANGED
@@ -5,12 +5,22 @@
5
5
 
6
6
  Hamlit is a high performance [Haml](https://github.com/haml/haml) implementation.
7
7
 
8
+ ## Project status
9
+
10
+ **Hamlit's implementation was copied to Haml 6.**
11
+ From Haml 6, you don't need to switch to Hamlit.
12
+
13
+ Both Haml 6 and Hamlit are still maintained by [@k0kubun](https://github.com/k0kubun).
14
+ While you don't need to immediately deprecate Hamlit, Haml 6 has more maintainers
15
+ and you'd better start a new project with Haml rather than Hamlit,
16
+ given no performance difference between them.
17
+
8
18
  ## Introduction
9
19
 
10
20
  ### What is Hamlit?
11
21
  Hamlit is another implementation of [Haml](https://github.com/haml/haml).
12
- With some [limitations](REFERENCE.md#limitations) by design for performance,
13
- Hamlit is **1.94x times faster** than original haml gem in [this benchmark](benchmark/slim/run-benchmarks.rb),
22
+ With some [Hamlit's characteristics](REFERENCE.md#hamlits-characteristics) for performance,
23
+ Hamlit is **1.94x times faster** than the original Haml 5 in [this benchmark](benchmark/run-benchmarks.rb),
14
24
  which is an HTML-escaped version of [slim-template/slim's one](https://github.com/slim-template/slim/blob/4.1.0/benchmarks/run-benchmarks.rb) for fairness. ([Result on Travis](https://travis-ci.org/github/k0kubun/hamlit/jobs/732178446))
15
25
 
16
26
  <img src="https://raw.githubusercontent.com/k0kubun/hamlit/afcc2b36c4861c2f764baa09afd9530ca25eeafa/benchmark/graph/graph.png" width="600x" alt="Hamlit Benchmark" />
@@ -23,11 +33,12 @@ which is an HTML-escaped version of [slim-template/slim's one](https://github.co
23
33
  haml v5.2.0: 127834.4 i/s - 1.94x slower
24
34
  ```
25
35
 
26
- ### Why is Hamlit faster?
36
+ ### Why is Hamlit fast?
27
37
 
28
38
  #### Less string concatenation by design
29
- As written in [limitations](REFERENCE.md#limitations), Hamlit drops some not-so-important features which require
30
- works on runtime. With the optimized language design, we can reduce the string concatenation
39
+ As written in [Hamlit's characteristics](REFERENCE.md#hamlits-characteristics),
40
+ Hamlit drops some not-so-important features which require works on runtime.
41
+ With the optimized language design, we can reduce the string concatenation
31
42
  to build attributes.
32
43
 
33
44
  #### Static analyzer
@@ -42,7 +53,7 @@ with C extension.
42
53
 
43
54
  ## Usage
44
55
 
45
- Hamlit currently supports Ruby 2.1 and higher. See [REFERENCE.md](REFERENCE.md) for detail features of Hamlit.
56
+ See [REFERENCE.md](REFERENCE.md) for details.
46
57
 
47
58
  ### Rails
48
59
 
@@ -97,40 +108,6 @@ $ hamlit render in.haml
97
108
 
98
109
  ## Contributing
99
110
 
100
- ### Test latest version
101
-
102
- ```rb
103
- # Gemfile
104
- gem 'hamlit', github: 'k0kubun/hamlit', submodules: true
105
- ```
106
-
107
- ### Development
108
-
109
- Contributions are welcomed. It'd be good to see
110
- [Temple's EXPRESSIONS.md](https://github.com/judofyr/temple/blob/v0.7.6/EXPRESSIONS.md)
111
- to learn Temple which is a template engine framework used in Hamlit.
112
-
113
- ```bash
114
- $ git clone --recursive https://github.com/k0kubun/hamlit
115
- $ cd hamlit
116
- $ bundle install
117
-
118
- # Run all tests
119
- $ bundle exec rake test
120
-
121
- # Run one test
122
- $ bundle exec ruby -Ilib:test -rtest_helper test/hamlit/line_number_test.rb -l 12
123
-
124
- # Show compiling/rendering result of some template
125
- $ bundle exec exe/hamlit compile in.haml
126
- $ bundle exec exe/hamlit render in.haml
127
-
128
- # Use rails app to debug Hamlit
129
- $ cd sample/rails
130
- $ bundle install
131
- $ bundle exec rails s
132
- ```
133
-
134
111
  ### Reporting an issue
135
112
 
136
113
  Please report an issue with following information:
data/REFERENCE.md CHANGED
@@ -5,81 +5,7 @@ See [Haml's tutorial](http://haml.info/tutorial.html) if you are not familiar wi
5
5
 
6
6
  [REFERENCE - Haml Documentation](http://haml.info/docs/yardoc/file.REFERENCE.html)
7
7
 
8
- ## Supported features
9
-
10
- See [Haml's reference](http://haml.info/docs/yardoc/file.REFERENCE.html)
11
- for full features in original implementation.
12
-
13
- - [ ] Using Haml
14
- - [x] Rails XSS Protection
15
- - [x] Ruby Module
16
- - [x] Options
17
- - [ ] Encodings
18
- - [x] Plain Text
19
- - [x] Escaping: \
20
- - [ ] HTML Elements
21
- - [x] Element Name: %
22
- - [ ] Attributes: `
23
- - [x] :class and :id Attributes
24
- - [x] HTML-style Attributes: ()
25
- - [x] Ruby 1.9-style Hashes
26
- - [ ] Attribute Methods
27
- - [x] Boolean Attributes
28
- - [x] HTML5 Custom Data Attributes
29
- - [x] Class and ID: . and #
30
- - Implicit Div Elements
31
- - [x] Empty (void) Tags: /
32
- - [x] Whitespace Removal: > and <
33
- - [x] Object Reference: []
34
- - [x] Doctype: !!!
35
- - [x] Comments
36
- - [x] HTML Comments: /
37
- - [x] Conditional Comments: /[]
38
- - [x] Haml Comments: -#
39
- - [x] Ruby Evaluation
40
- - [x] Inserting Ruby: =
41
- - [x] Running Ruby: -
42
- - [x] Ruby Blocks
43
- - [x] Whitespace Preservation: ~
44
- - [x] Ruby Interpolation: #{}
45
- - [x] Escaping HTML: &=
46
- - [x] Unescaping HTML: !=
47
- - [ ] Filters
48
- - [x] :cdata
49
- - [x] :coffee
50
- - [x] :css
51
- - [x] :erb
52
- - [x] :escaped
53
- - [x] :javascript
54
- - [x] :less
55
- - [x] :markdown
56
- - [ ] :maruku
57
- - [x] :plain
58
- - [x] :preserve
59
- - [x] :ruby
60
- - `haml_io` API is not supported. Use [hamlit-haml\_io.gem](https://github.com/hamlit/hamlit-haml_io) if you need.
61
- - [x] :sass
62
- - [x] :scss
63
- - [ ] :textile
64
- - [ ] Custom Filters
65
- - [x] Helper Methods
66
- - [x] preserve
67
- - [x] surround
68
- - [x] precede
69
- - [x] succeed
70
- - [x] Multiline: |
71
- - [x] Whitespace Preservation
72
- - [ ] Helpers
73
-
74
-
75
- ## Limitations
76
-
77
- ### No Haml buffer
78
- Hamlit uses `Array` as buffer for performance. So you can't touch Haml::Buffer from template when using Hamlit.
79
-
80
- ### Haml helpers are still in development
81
- At the same time, because some methods in `Haml::Helpers` require `Haml::Buffer`, they are not supported now.
82
- But some helpers are supported on Rails. Some of not-implemented methods are planned to be supported.
8
+ ## Hamlit's characteristics
83
9
 
84
10
  ### Limited attributes hyphenation
85
11
  In Haml, `%a{ foo: { bar: 'baz' } }` is rendered as `<a foo-bar='baz'></a>`, whatever foo is.
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- require 'bundler/setup'
2
1
  require 'bundler/gem_tasks'
3
2
 
4
3
  #
@@ -105,11 +104,7 @@ end
105
104
 
106
105
  desc 'bench task for CI'
107
106
  task bench: :compile do
108
- if ENV['SLIM_BENCH'] == '1'
109
- cmd = %w[bundle exec ruby benchmark/slim/run-benchmarks.rb]
110
- else
111
- cmd = ['bin/bench', 'bench', ('-c' if ENV['COMPILE'] == '1'), *ENV['TEMPLATE'].split(',')].compact
112
- end
107
+ cmd = %w[bundle exec ruby benchmark/run-benchmarks.rb]
113
108
  exit system(*cmd)
114
109
  end
115
110
 
data/bin/bench CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'bundler/setup'
4
4
  require 'hamlit'
5
- require 'faml'
6
5
  require 'thor'
7
6
  require 'benchmark/ips'
8
7
  require_relative '../benchmark/utils/benchmark_ips_extension'
@@ -26,7 +25,6 @@ class Bench < Thor
26
25
 
27
26
  Benchmark.ips do |x|
28
27
  x.report("haml v#{Haml::VERSION}") { Haml::Engine.new(haml, escape_html: true, escape_attrs: true).precompiled }
29
- x.report("faml v#{Faml::VERSION}") { Faml::Engine.new.call(haml) }
30
28
  x.report("hamlit v#{Hamlit::VERSION}") { Hamlit::Engine.new.call(haml) }
31
29
  x.compare!
32
30
  end
@@ -44,12 +42,10 @@ class Bench < Thor
44
42
  end
45
43
 
46
44
  Haml::Engine.new(haml, escape_html: true, escape_attrs: true).def_method(object, :haml)
47
- object.instance_eval "def faml; #{Faml::Engine.new.call(haml)}; end"
48
45
  object.instance_eval "def hamlit; #{Hamlit::Engine.new.call(haml)}; end"
49
46
 
50
47
  Benchmark.ips do |x|
51
48
  x.report("haml v#{Haml::VERSION}") { object.haml }
52
- x.report("faml v#{Faml::VERSION}") { object.faml }
53
49
  x.report("hamlit v#{Hamlit::VERSION}") { object.hamlit }
54
50
  x.compare!
55
51
  end
@@ -60,8 +56,6 @@ class Bench < Thor
60
56
  haml = File.read(file)
61
57
  puts "#{?= * 49}\n Haml Source: #{file}\n#{?= * 49}"
62
58
  puts Haml::Engine.new(haml, escape_html: true, escape_attrs: true).precompiled
63
- puts "\n#{?= * 49}\n Faml Source: #{file}\n#{?= * 49}"
64
- puts Faml::Engine.new.call(haml)
65
59
  puts "\n#{?= * 49}\n Hamlit Source: #{file}\n#{?= * 49}"
66
60
  puts Hamlit::Engine.new.call(haml)
67
61
  end
data/hamlit.gemspec CHANGED
@@ -32,7 +32,6 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  spec.add_development_dependency 'benchmark_driver'
34
34
  spec.add_development_dependency 'bundler'
35
- spec.add_development_dependency 'coffee-script'
36
35
  spec.add_development_dependency 'erubi'
37
36
  spec.add_development_dependency 'haml', '>= 5'
38
37
  spec.add_development_dependency 'less'
@@ -7,7 +7,7 @@ module Hamlit::AttributeBuilder
7
7
  defer reversed ismap seamless muted required
8
8
  autofocus novalidate formnovalidate open pubdate
9
9
  itemscope allowfullscreen default inert sortable
10
- truespeed typemustmatch download].freeze
10
+ truespeed typemustmatch download playsinline].freeze
11
11
 
12
12
  # Java extension is not implemented for JRuby yet.
13
13
  # TruffleRuby does not implement `rb_ary_sort_bang`, etc.
data/lib/hamlit/cli.rb CHANGED
@@ -106,6 +106,7 @@ module Hamlit
106
106
  Hamlit::Engine.options.to_h.merge(
107
107
  escape_attrs: options[:escape_attrs],
108
108
  escape_html: options[:escape_html],
109
+ check_syntax: options[:check],
109
110
  )
110
111
  end
111
112
 
@@ -6,8 +6,9 @@ require 'hamlit/string_splitter'
6
6
  module Hamlit
7
7
  class Compiler
8
8
  class ScriptCompiler
9
- def initialize(identity)
9
+ def initialize(identity, options)
10
10
  @identity = identity
11
+ @disable_capture = options[:disable_capture]
11
12
  end
12
13
 
13
14
  def compile(node, &block)
@@ -79,7 +80,7 @@ module Hamlit
79
80
  else
80
81
  [:multi,
81
82
  [:block, "#{var} = #{node.value[:text]}",
82
- [:multi, [:newline], yield(node)],
83
+ [:multi, [:newline], @disable_capture ? yield(node) : [:capture, Temple::Utils.unique_name, yield(node)]]
83
84
  ],
84
85
  ]
85
86
  end
@@ -16,7 +16,7 @@ module Hamlit
16
16
  @comment_compiler = CommentCompiler.new
17
17
  @doctype_compiler = DoctypeCompiler.new(options)
18
18
  @filter_compiler = Filters.new(options)
19
- @script_compiler = ScriptCompiler.new(identity)
19
+ @script_compiler = ScriptCompiler.new(identity, options)
20
20
  @silent_script_compiler = SilentScriptCompiler.new
21
21
  @tag_compiler = TagCompiler.new(identity, options)
22
22
  end
data/lib/hamlit/engine.rb CHANGED
@@ -12,7 +12,7 @@ module Hamlit
12
12
  class Engine < Temple::Engine
13
13
  define_options(
14
14
  :buffer_class,
15
- generator: Temple::Generators::ArrayBuffer,
15
+ generator: Temple::Generators::StringBuffer,
16
16
  format: :html,
17
17
  attr_quote: "'",
18
18
  escape_html: true,
@@ -21,6 +21,8 @@ module Hamlit
21
21
  hr img input isindex keygen link menuitem meta
22
22
  param source track wbr),
23
23
  filename: "",
24
+ check_syntax: false,
25
+ disable_capture: false,
24
26
  )
25
27
 
26
28
  use Parser
@@ -7,7 +7,11 @@ module Hamlit
7
7
  def self.render(name, source, indent_width: 0)
8
8
  text = ::Tilt["t.#{name}"].new { source }.render
9
9
  return text if indent_width == 0
10
- text.gsub!(/^/, ' ' * indent_width)
10
+ if text.frozen?
11
+ text.gsub(/^/, ' ' * indent_width)
12
+ else
13
+ text.gsub!(/^/, ' ' * indent_width)
14
+ end
11
15
  end
12
16
 
13
17
  def explicit_require?(needed_registration)
data/lib/hamlit/parser.rb CHANGED
@@ -20,6 +20,7 @@ module Hamlit
20
20
  autoclose
21
21
  escape_html
22
22
  escape_attrs
23
+ check_syntax
23
24
  ].freeze
24
25
 
25
26
  def initialize(options = {})
@@ -35,6 +36,7 @@ module Hamlit
35
36
  end
36
37
  HamlParser.new(HamlOptions.new(@options)).call(template)
37
38
  rescue ::Hamlit::HamlError => e
39
+ raise e if @options[:check_syntax]
38
40
  error_with_lineno(e)
39
41
  end
40
42
 
@@ -15,6 +15,7 @@ module Hamlit
15
15
  use_html_safe: true,
16
16
  streaming: true,
17
17
  buffer_class: 'ActionView::OutputBuffer',
18
+ disable_capture: true,
18
19
  }
19
20
  end
20
21
 
@@ -34,8 +35,10 @@ module Hamlit
34
35
  end
35
36
 
36
37
  if ActionView::Base.try(:annotate_rendered_view_with_filenames) && template.format == :html
37
- options[:preamble] = "<!-- BEGIN #{template.short_identifier} -->\n"
38
- options[:postamble] = "<!-- END #{template.short_identifier} -->\n"
38
+ options = options.merge(
39
+ preamble: "<!-- BEGIN #{template.short_identifier} -->\n",
40
+ postamble: "<!-- END #{template.short_identifier} -->\n",
41
+ )
39
42
  end
40
43
 
41
44
  Engine.new(options).call(source)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hamlit
3
- VERSION = '2.15.1'
3
+ VERSION = '3.0.3'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hamlit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.1
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-23 00:00:00.000000000 Z
11
+ date: 2022-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: temple
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: coffee-script
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: erubi
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -345,7 +331,7 @@ homepage: https://github.com/k0kubun/hamlit
345
331
  licenses:
346
332
  - MIT
347
333
  metadata: {}
348
- post_install_message:
334
+ post_install_message:
349
335
  rdoc_options: []
350
336
  require_paths:
351
337
  - lib
@@ -360,8 +346,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
360
346
  - !ruby/object:Gem::Version
361
347
  version: '0'
362
348
  requirements: []
363
- rubygems_version: 3.1.2
364
- signing_key:
349
+ rubygems_version: 3.3.7
350
+ signing_key:
365
351
  specification_version: 4
366
352
  summary: High Performance Haml Implementation
367
353
  test_files: []