hamlit 3.0.3 → 4.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0739d31df6aecc4a332c868e258322fb77a8e6003d5aa2c5fee02468809f009b'
4
- data.tar.gz: 1917aeca307e771331e8e6d997ef58c90f106c2f4c002e35c4fb7fd424779db9
3
+ metadata.gz: 270c4930bb7c770a986b5e60edeb7608af33aab66927bd4b415e75591cd738a4
4
+ data.tar.gz: e9b8422cb06c0e427650c40e28774805e543cbcf291dbe37ba4327f34b7336fb
5
5
  SHA512:
6
- metadata.gz: 80000682f6fa89d6ceedd7137d3b1156bb9850707640bfdaf3330249c81251f6a036b3e175617d6e9b51e218d5f2cf12b551772c223e83bc6f7836afe260e62b
7
- data.tar.gz: 87b2fb79433a8c593d0dbd4d0df17f28f5b5d64c250833048d4f6eddeb729c9394aa13a541cad8f2436237dd7da2a218af06910e4d9886f3a6ed7322f62d5d1a
6
+ metadata.gz: 48e1d888420f14f434f9dde73d925bfbbd6727dc4ac2954b017bbd7f871b75225652ae4e8ac2f4163f17c2826fa7948a8d1a258b9adc0dbcec95fe6ea7cd577b
7
+ data.tar.gz: b2203d0c8c97956a5d3bf90b018aa5cda042d7621e56b3e6e7a2b122941bc8ec45a1dfed0826789aa77fb610bc2c407653226a704e3023b28523d2cca175333a
@@ -0,0 +1,50 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository_owner == 'k0kubun'
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ ruby: [ruby, jruby]
18
+ fail-fast: false
19
+
20
+ environment:
21
+ name: rubygems.org
22
+ url: https://rubygems.org/gems/hamlit
23
+
24
+ permissions:
25
+ contents: write
26
+ id-token: write
27
+
28
+ steps:
29
+ - name: Harden Runner
30
+ uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
31
+ with:
32
+ egress-policy: audit
33
+
34
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
35
+
36
+ - name: Set up Ruby
37
+ uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
38
+ with:
39
+ bundler-cache: true
40
+ ruby-version: ${{ matrix.ruby }}
41
+
42
+ - name: Publish to RubyGems
43
+ uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
44
+
45
+ - name: Create GitHub release
46
+ run: |
47
+ tag_name="$(git describe --tags --abbrev=0)"
48
+ gh release create "${tag_name}" --verify-tag --generate-notes
49
+ env:
50
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -17,12 +17,11 @@ jobs:
17
17
  fail-fast: false
18
18
  matrix:
19
19
  ruby:
20
- - '2.5'
21
- - '2.6'
22
- - '2.7'
23
- - '3.0'
20
+ - '3.2'
21
+ - '3.3'
22
+ - '3.4'
24
23
  - jruby
25
- - truffleruby-head
24
+ - truffleruby
26
25
  steps:
27
26
  - uses: actions/checkout@v2
28
27
  - run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev # nodejs for execjs, libxslt for TruffleRuby nokogiri
data/CHANGELOG.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file. This
4
- project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
5
- [keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).
3
+ ## 4.0.0
4
+
5
+ - Change default `attr_quote` from `'` to `"`
6
+ - Bump required Ruby version to 3.2
6
7
 
7
8
  ## [3.0.3](https://github.com/k0kubun/hamlit/compare/v3.0.2...v3.0.3) - 2022-11-07
8
9
 
data/Gemfile CHANGED
@@ -11,6 +11,9 @@ gemspec
11
11
  gem 'benchmark-ips', '2.3.0'
12
12
  gem 'maxitest'
13
13
  gem 'pry'
14
+ gem 'base64'
15
+ gem 'bigdecimal'
16
+ gem 'mutex_m'
14
17
 
15
18
  if /java/ === RUBY_PLATFORM # JRuby
16
19
  gem 'pandoc-ruby'
data/README.md CHANGED
@@ -10,7 +10,7 @@ Hamlit is a high performance [Haml](https://github.com/haml/haml) implementation
10
10
  **Hamlit's implementation was copied to Haml 6.**
11
11
  From Haml 6, you don't need to switch to Hamlit.
12
12
 
13
- Both Haml 6 and Hamlit are still maintained by [@k0kubun](https://github.com/k0kubun).
13
+ Both Haml 6 and Hamlit are still maintained by [k0kubun](https://github.com/k0kubun).
14
14
  While you don't need to immediately deprecate Hamlit, Haml 6 has more maintainers
15
15
  and you'd better start a new project with Haml rather than Hamlit,
16
16
  given no performance difference between them.
@@ -21,7 +21,7 @@ given no performance difference between them.
21
21
  Hamlit is another implementation of [Haml](https://github.com/haml/haml).
22
22
  With some [Hamlit's characteristics](REFERENCE.md#hamlits-characteristics) for performance,
23
23
  Hamlit is **1.94x times faster** than the original Haml 5 in [this benchmark](benchmark/run-benchmarks.rb),
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))
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.
25
25
 
26
26
  <img src="https://raw.githubusercontent.com/k0kubun/hamlit/afcc2b36c4861c2f764baa09afd9530ca25eeafa/benchmark/graph/graph.png" width="600x" alt="Hamlit Benchmark" />
27
27
 
data/hamlit.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.platform = 'java'
24
24
  else
25
25
  spec.extensions = ['ext/hamlit/extconf.rb']
26
- spec.required_ruby_version = '>= 2.1.0'
26
+ spec.required_ruby_version = '>= 3.2.0'
27
27
  end
28
28
 
29
29
  spec.add_dependency 'temple', '>= 0.8.2'
@@ -62,7 +62,7 @@ module Hamlit::AttributeBuilder
62
62
  when value.is_a?(String)
63
63
  classes += value.split(' ')
64
64
  when value.is_a?(Array)
65
- classes += value.select { |v| v }
65
+ classes += value.flatten.select { |v| v }
66
66
  when value
67
67
  classes << value.to_s
68
68
  end
data/lib/hamlit/engine.rb CHANGED
@@ -14,13 +14,13 @@ module Hamlit
14
14
  :buffer_class,
15
15
  generator: Temple::Generators::StringBuffer,
16
16
  format: :html,
17
- attr_quote: "'",
17
+ attr_quote: '"',
18
18
  escape_html: true,
19
19
  escape_attrs: true,
20
20
  autoclose: %w(area base basefont br col command embed frame
21
21
  hr img input isindex keygen link menuitem meta
22
22
  param source track wbr),
23
- filename: "",
23
+ filename: '',
24
24
  check_syntax: false,
25
25
  disable_capture: false,
26
26
  )
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hamlit
3
- VERSION = '3.0.3'
3
+ VERSION = '4.0.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hamlit
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2022-11-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: temple
@@ -244,7 +243,7 @@ extensions:
244
243
  extra_rdoc_files: []
245
244
  files:
246
245
  - ".github/FUNDING.yml"
247
- - ".github/workflows/bench.yml"
246
+ - ".github/workflows/release.yml"
248
247
  - ".github/workflows/test.yml"
249
248
  - ".gitignore"
250
249
  - CHANGELOG.md
@@ -331,7 +330,6 @@ homepage: https://github.com/k0kubun/hamlit
331
330
  licenses:
332
331
  - MIT
333
332
  metadata: {}
334
- post_install_message:
335
333
  rdoc_options: []
336
334
  require_paths:
337
335
  - lib
@@ -339,15 +337,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
339
337
  requirements:
340
338
  - - ">="
341
339
  - !ruby/object:Gem::Version
342
- version: 2.1.0
340
+ version: 3.2.0
343
341
  required_rubygems_version: !ruby/object:Gem::Requirement
344
342
  requirements:
345
343
  - - ">="
346
344
  - !ruby/object:Gem::Version
347
345
  version: '0'
348
346
  requirements: []
349
- rubygems_version: 3.3.7
350
- signing_key:
347
+ rubygems_version: 3.6.7
351
348
  specification_version: 4
352
349
  summary: High Performance Haml Implementation
353
350
  test_files: []
@@ -1,24 +0,0 @@
1
- name: bench
2
- on:
3
- push:
4
- branches:
5
- - master
6
- pull_request:
7
- types:
8
- - opened
9
- - synchronize
10
- - reopened
11
- schedule:
12
- - cron: "00 15 * * *" # 7:00 PST (-8), 8:00 PDT (-7)
13
- jobs:
14
- bench:
15
- runs-on: ubuntu-latest
16
- steps:
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
19
- - name: Set up Ruby
20
- uses: ruby/setup-ruby@v1
21
- with:
22
- ruby-version: '3.0'
23
- bundler-cache: true
24
- - run: bundle exec rake bench