slimi 0.7.2 → 0.7.4

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: 6c151d108a263b740aa9cf7f7ac6dba84741a722b1fdffcb1b6078c63a55a911
4
- data.tar.gz: fe127168b410730d5303deff0d50b43d42d805b9fcb16bce17c09fb00549c149
3
+ metadata.gz: ec5e4e452e6c31d6d7f6b65f3eb1f6989d502d470d60a75df53ae4478fcbd59a
4
+ data.tar.gz: 333f18dfbc10fe75b05c3c452bf633ed4f39188894af9754f08329c54511cffd
5
5
  SHA512:
6
- metadata.gz: fbffeb9d9bd5dd13b085503bc439a85b4832ae44bd8839d07fd879faf5e158b7f5b41f72f051e3963a73086e302a5f9f3cc2541c6a404b7acbed66dd225824d3
7
- data.tar.gz: 945f20409900cdd7fb7cff7a2517aae58a334d9528b6092d1a212b4715bc2dbf713650a25201b2bf8ba28f3f181d4e5cc635b1c759f9b0420e3c9dc6b4742ec2
6
+ metadata.gz: dbf98f16509584c552ce49786247f8c80bb3034f509d4528a5b4322ccef5a44a16c9416c8e44d42f9f89bbf5092b57dd21ac82523127335f02afc73448bc87d0
7
+ data.tar.gz: 428508b038f66abefb7eb90b19002cbba999e7bca5433b76c71e7a8a7be6e665f302b7085e4074ebe39c83ad444e21cf48f384b35e561eb752be628de30328ee
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.7.4 - 2023-03-22
6
+
7
+ ### Fixed
8
+
9
+ - Fix FrozenError on Embedded filter.
10
+
11
+ ## 0.7.3 - 2023-02-27
12
+
13
+ ### Fixed
14
+
15
+ - Fix parser bug that CR is included in some unrelated token.
16
+ - Fix wrong signature error on embedded filter.
17
+
5
18
  ## 0.7.2 - 2022-01-24
6
19
 
7
20
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- slimi (0.7.2)
4
+ slimi (0.7.4)
5
5
  temple
6
6
  thor
7
7
  tilt
@@ -9,77 +9,82 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionview (7.0.0)
13
- activesupport (= 7.0.0)
12
+ actionview (7.0.4.2)
13
+ activesupport (= 7.0.4.2)
14
14
  builder (~> 3.1)
15
15
  erubi (~> 1.4)
16
16
  rails-dom-testing (~> 2.0)
17
17
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
18
- activesupport (7.0.0)
18
+ activesupport (7.0.4.2)
19
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
20
  i18n (>= 1.6, < 2)
21
21
  minitest (>= 5.1)
22
22
  tzinfo (~> 2.0)
23
23
  ast (2.4.2)
24
24
  builder (3.2.4)
25
- concurrent-ruby (1.1.9)
25
+ concurrent-ruby (1.2.0)
26
26
  crass (1.0.6)
27
- diff-lcs (1.4.4)
28
- erubi (1.10.0)
29
- i18n (1.8.11)
27
+ diff-lcs (1.5.0)
28
+ erubi (1.12.0)
29
+ i18n (1.12.0)
30
30
  concurrent-ruby (~> 1.0)
31
- loofah (2.13.0)
31
+ json (2.6.3)
32
+ loofah (2.19.1)
32
33
  crass (~> 1.0.2)
33
34
  nokogiri (>= 1.5.9)
34
- minitest (5.15.0)
35
- nokogiri (1.12.5-x86_64-linux)
35
+ minitest (5.17.0)
36
+ nokogiri (1.14.2-x86_64-linux)
36
37
  racc (~> 1.4)
37
- parallel (1.21.0)
38
- parser (3.0.3.2)
38
+ parallel (1.22.1)
39
+ parser (3.2.1.0)
39
40
  ast (~> 2.4.1)
40
- racc (1.6.0)
41
+ racc (1.6.2)
41
42
  rails-dom-testing (2.0.3)
42
43
  activesupport (>= 4.2.0)
43
44
  nokogiri (>= 1.6)
44
- rails-html-sanitizer (1.4.2)
45
- loofah (~> 2.3)
46
- rainbow (3.0.0)
45
+ rails-html-sanitizer (1.5.0)
46
+ loofah (~> 2.19, >= 2.19.1)
47
+ rainbow (3.1.1)
47
48
  rake (13.0.6)
48
- regexp_parser (2.2.0)
49
+ regexp_parser (2.7.0)
49
50
  rexml (3.2.5)
50
- rspec (3.10.0)
51
- rspec-core (~> 3.10.0)
52
- rspec-expectations (~> 3.10.0)
53
- rspec-mocks (~> 3.10.0)
54
- rspec-core (3.10.1)
55
- rspec-support (~> 3.10.0)
56
- rspec-expectations (3.10.1)
51
+ rspec (3.12.0)
52
+ rspec-core (~> 3.12.0)
53
+ rspec-expectations (~> 3.12.0)
54
+ rspec-mocks (~> 3.12.0)
55
+ rspec-core (3.12.1)
56
+ rspec-support (~> 3.12.0)
57
+ rspec-expectations (3.12.2)
57
58
  diff-lcs (>= 1.2.0, < 2.0)
58
- rspec-support (~> 3.10.0)
59
- rspec-mocks (3.10.2)
59
+ rspec-support (~> 3.12.0)
60
+ rspec-mocks (3.12.3)
60
61
  diff-lcs (>= 1.2.0, < 2.0)
61
- rspec-support (~> 3.10.0)
62
- rspec-support (3.10.3)
63
- rubocop (1.23.0)
62
+ rspec-support (~> 3.12.0)
63
+ rspec-support (3.12.0)
64
+ rubocop (1.45.1)
65
+ json (~> 2.3)
64
66
  parallel (~> 1.10)
65
- parser (>= 3.0.0.0)
67
+ parser (>= 3.2.0.0)
66
68
  rainbow (>= 2.2.2, < 4.0)
67
69
  regexp_parser (>= 1.8, < 3.0)
68
- rexml
69
- rubocop-ast (>= 1.12.0, < 2.0)
70
+ rexml (>= 3.2.5, < 4.0)
71
+ rubocop-ast (>= 1.24.1, < 2.0)
70
72
  ruby-progressbar (~> 1.7)
71
- unicode-display_width (>= 1.4.0, < 3.0)
72
- rubocop-ast (1.15.0)
73
- parser (>= 3.0.1.1)
74
- rubocop-rspec (2.6.0)
75
- rubocop (~> 1.19)
73
+ unicode-display_width (>= 2.4.0, < 3.0)
74
+ rubocop-ast (1.26.0)
75
+ parser (>= 3.2.1.0)
76
+ rubocop-capybara (2.17.1)
77
+ rubocop (~> 1.41)
78
+ rubocop-rspec (2.18.1)
79
+ rubocop (~> 1.33)
80
+ rubocop-capybara (~> 2.17)
76
81
  ruby-progressbar (1.11.0)
77
- temple (0.8.2)
82
+ temple (0.10.0)
78
83
  thor (1.2.1)
79
- tilt (2.0.10)
80
- tzinfo (2.0.4)
84
+ tilt (2.1.0)
85
+ tzinfo (2.0.6)
81
86
  concurrent-ruby (~> 1.0)
82
- unicode-display_width (2.1.0)
87
+ unicode-display_width (2.4.2)
83
88
 
84
89
  PLATFORMS
85
90
  x86_64-linux
data/lib/slimi/cli.rb CHANGED
@@ -23,7 +23,7 @@ module Slimi
23
23
  def parse
24
24
  slim = $stdin.read
25
25
  expression = Parser.new.call(slim)
26
- pp expression
26
+ pp expression # rubocop:disable Lint/Debugger
27
27
  end
28
28
 
29
29
  desc 'render', 'Convert Slim into HTML'
@@ -7,12 +7,12 @@ module Slimi
7
7
  # @api private
8
8
  class TextCollector < Base
9
9
  def call(exp)
10
- @collected = ''
10
+ @collected = +''
11
11
  super(exp)
12
12
  @collected
13
13
  end
14
14
 
15
- def on_slimi_interpolate(text)
15
+ def on_slimi_interpolate(_, _, text)
16
16
  @collected << text
17
17
  nil
18
18
  end
@@ -36,7 +36,7 @@ module Slimi
36
36
  class OutputProtector < Base
37
37
  def call(exp)
38
38
  @protect = []
39
- @collected = ''
39
+ @collected = +''
40
40
  @tag = "%#{object_id.abs.to_s(36)}%"
41
41
  super(exp)
42
42
  @collected
data/lib/slimi/parser.rb CHANGED
@@ -138,7 +138,7 @@ module Slimi
138
138
  @stacks.last << tag
139
139
  @stacks.last << [:static, ' '] if with_trailing_white_space
140
140
 
141
- if @scanner.skip(/[ \t]*$/)
141
+ if @scanner.skip(/[ \t]*(?=\R|$)/)
142
142
  content = [:multi]
143
143
  tag << content
144
144
  @stacks << content
@@ -255,7 +255,7 @@ module Slimi
255
255
  attribute_delimiter_opening = @scanner[1]
256
256
  attribute_delimiter_closing = @attribute_delimiters[attribute_delimiter_opening]
257
257
  attribute_delimiter_closing_regexp = ::Regexp.escape(attribute_delimiter_closing)
258
- boolean_attribute_regexp = /#{@attribute_name_regexp}(?=(?:[ \t]|#{attribute_delimiter_closing_regexp}|$))/
258
+ boolean_attribute_regexp = /#{@attribute_name_regexp}(?=(?:[ \t]|#{attribute_delimiter_closing_regexp}|(?=\R|$)))/
259
259
  attribute_delimiter_closing_part_regexp = /[ \t]*#{attribute_delimiter_closing_regexp}/
260
260
  end
261
261
 
@@ -320,7 +320,7 @@ module Slimi
320
320
  opening_delimiter = @scanner.matched
321
321
  closing_delimiter = @ruby_attribute_delimiters[opening_delimiter]
322
322
  end
323
- if (character = @scanner.scan(/./))
323
+ if (character = @scanner.scan(/[^\r\n]/))
324
324
  attribute_value << character
325
325
  end
326
326
  end
@@ -361,9 +361,9 @@ module Slimi
361
361
 
362
362
  # @return [Boolean]
363
363
  def parse_slim_comment_block
364
- if @scanner.skip(%r{/.*})
365
- while !@scanner.eos? && (@scanner.match?(/[ \t]*$/) || peek_indent > @indents.last)
366
- @scanner.skip(/.*/)
364
+ if @scanner.skip(%r{/[^\r\n]*})
365
+ while !@scanner.eos? && (@scanner.match?(/[ \t]*(?=\R|$)/) || peek_indent > @indents.last)
366
+ @scanner.skip(/[^\r\n]*/)
367
367
  parse_line_ending
368
368
  end
369
369
  true
@@ -396,7 +396,7 @@ module Slimi
396
396
 
397
397
  # @return [Boolean]
398
398
  def parse_inline_html_inner
399
- if @scanner.match?(/<.*/)
399
+ if @scanner.match?(/<[^\r\n]*/)
400
400
  begin_ = @scanner.charpos
401
401
  value = @scanner.matched
402
402
  @scanner.pos += @scanner.matched_size
@@ -493,7 +493,7 @@ module Slimi
493
493
  else
494
494
  0
495
495
  end
496
- end.sum(0)
496
+ end.sum
497
497
  end
498
498
 
499
499
  # @return [Boolean]
@@ -533,7 +533,7 @@ module Slimi
533
533
 
534
534
  # @return [Array, nil] S-expression if found.
535
535
  def parse_interpolate_line
536
- return unless @scanner.match?(/.+/)
536
+ return unless @scanner.match?(/[^\r\n]+/)
537
537
 
538
538
  begin_ = @scanner.charpos
539
539
  value = @scanner.matched
@@ -546,12 +546,12 @@ module Slimi
546
546
  # @return [String]
547
547
  def parse_broken_lines
548
548
  result = +''
549
- result << @scanner.scan(/.*/)
549
+ result << @scanner.scan(/[^\r\n]*/)
550
550
  while result.end_with?(',') || result.end_with?('\\')
551
551
  syntax_error!(Errors::UnexpectedEosError) unless @scanner.scan(/\r?\n/)
552
552
 
553
553
  result << "\n"
554
- result << @scanner.scan(/.*/)
554
+ result << @scanner.scan(/[^\r\n]*/)
555
555
  end
556
556
  result
557
557
  end
data/lib/slimi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Slimi
4
- VERSION = '0.7.2'
4
+ VERSION = '0.7.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-24 00:00:00.000000000 Z
11
+ date: 2023-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: temple
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description:
55
+ description:
56
56
  email:
57
57
  - r7kamura@gmail.com
58
58
  executables:
@@ -103,7 +103,7 @@ metadata:
103
103
  source_code_uri: https://github.com/r7kamura/slimi
104
104
  changelog_uri: https://github.com/r7kamura/slimi/blob/main/CHANGELOG.md
105
105
  rubygems_mfa_required: 'true'
106
- post_install_message:
106
+ post_install_message:
107
107
  rdoc_options: []
108
108
  require_paths:
109
109
  - lib
@@ -118,8 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
- rubygems_version: 3.1.4
122
- signing_key:
121
+ rubygems_version: 3.3.26
122
+ signing_key:
123
123
  specification_version: 4
124
124
  summary: Yet another implementation for Slim template language.
125
125
  test_files: []