rubocop-slim 0.2.2 → 0.2.4

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: 615a7a02efeebe4eb7aa61eff708e91e350af4b7ea7ccbabf9e92280fcdd930d
4
- data.tar.gz: 811f1ffbbdaeef6b6a53707b77b0d4ea8d34f568df965f73eccc5c09cadae571
3
+ metadata.gz: ab04cbc6e4180405af2c468a50832c0ba3be2db459d581ce1d84d1d9131ff0fe
4
+ data.tar.gz: efa8261463d5609a1b363216a83fb28aa57234f0eaf8fab30f68acf89f16924b
5
5
  SHA512:
6
- metadata.gz: ec5e1b391202975d5524d19ff384188387222829f7aa2dbc72d3e4d327e7a5e49522e1cab6d41c631f6eec5984c67340529b1ca9103d8cd7e28f892bb98e2974
7
- data.tar.gz: 38e99fb1eac0f504f113ac3b9f00253da9a248aff2a2f708802c900c17cf26cb5337922658cf8b50a0c9832711babc310637513b4d1e83c88d6389202acfcc98
6
+ metadata.gz: 2c76de6b75c20a5ce1cbf8eda415c04312ece5f108c9849fd470e2a5850ac5d9af66760f862266cf21a3b4538d71aa91dbb47e308ce6a59bceca03f4312dc2c8
7
+ data.tar.gz: 70b4253f59266644dbf3bfaf93a40f00347f105a168d3d051364509a0b68dc2377e96ac37a89a8f6fe9f12dbe6900b0982eed60b18599ff0efa8700b92da60ce
data/Gemfile.lock CHANGED
@@ -1,78 +1,91 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-slim (0.2.2)
4
+ rubocop-slim (0.2.4)
5
5
  rubocop (~> 1.45)
6
6
  slimi (~> 0.7)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.0.4.2)
11
+ activesupport (7.1.3.4)
12
+ base64
13
+ bigdecimal
12
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
+ connection_pool (>= 2.2.5)
16
+ drb
13
17
  i18n (>= 1.6, < 2)
14
18
  minitest (>= 5.1)
19
+ mutex_m
15
20
  tzinfo (~> 2.0)
16
21
  ast (2.4.2)
17
- concurrent-ruby (1.2.0)
18
- diff-lcs (1.5.0)
19
- i18n (1.12.0)
22
+ base64 (0.2.0)
23
+ bigdecimal (3.1.8)
24
+ concurrent-ruby (1.3.3)
25
+ connection_pool (2.4.1)
26
+ diff-lcs (1.5.1)
27
+ drb (2.2.1)
28
+ i18n (1.14.5)
20
29
  concurrent-ruby (~> 1.0)
21
- json (2.6.3)
22
- minitest (5.17.0)
23
- parallel (1.22.1)
24
- parser (3.2.0.0)
30
+ json (2.7.2)
31
+ language_server-protocol (3.17.0.3)
32
+ minitest (5.24.1)
33
+ mutex_m (0.2.0)
34
+ parallel (1.25.1)
35
+ parser (3.3.4.0)
25
36
  ast (~> 2.4.1)
37
+ racc
38
+ racc (1.8.0)
26
39
  rainbow (3.1.1)
27
- rake (13.0.6)
28
- regexp_parser (2.6.2)
29
- rexml (3.2.5)
30
- rspec (3.12.0)
31
- rspec-core (~> 3.12.0)
32
- rspec-expectations (~> 3.12.0)
33
- rspec-mocks (~> 3.12.0)
34
- rspec-core (3.12.1)
35
- rspec-support (~> 3.12.0)
36
- rspec-expectations (3.12.2)
40
+ rake (13.2.1)
41
+ regexp_parser (2.9.2)
42
+ rexml (3.3.2)
43
+ strscan
44
+ rspec (3.13.0)
45
+ rspec-core (~> 3.13.0)
46
+ rspec-expectations (~> 3.13.0)
47
+ rspec-mocks (~> 3.13.0)
48
+ rspec-core (3.13.0)
49
+ rspec-support (~> 3.13.0)
50
+ rspec-expectations (3.13.1)
37
51
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.12.0)
39
- rspec-mocks (3.12.3)
52
+ rspec-support (~> 3.13.0)
53
+ rspec-mocks (3.13.1)
40
54
  diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.12.0)
42
- rspec-support (3.12.0)
43
- rubocop (1.45.0)
55
+ rspec-support (~> 3.13.0)
56
+ rspec-support (3.13.1)
57
+ rubocop (1.65.0)
44
58
  json (~> 2.3)
59
+ language_server-protocol (>= 3.17.0)
45
60
  parallel (~> 1.10)
46
- parser (>= 3.2.0.0)
61
+ parser (>= 3.3.0.2)
47
62
  rainbow (>= 2.2.2, < 4.0)
48
- regexp_parser (>= 1.8, < 3.0)
63
+ regexp_parser (>= 2.4, < 3.0)
49
64
  rexml (>= 3.2.5, < 4.0)
50
- rubocop-ast (>= 1.24.1, < 2.0)
65
+ rubocop-ast (>= 1.31.1, < 2.0)
51
66
  ruby-progressbar (~> 1.7)
52
67
  unicode-display_width (>= 2.4.0, < 3.0)
53
- rubocop-ast (1.24.1)
54
- parser (>= 3.1.1.0)
55
- rubocop-capybara (2.17.0)
56
- rubocop (~> 1.41)
68
+ rubocop-ast (1.31.3)
69
+ parser (>= 3.3.1.0)
57
70
  rubocop-rake (0.6.0)
58
71
  rubocop (~> 1.0)
59
- rubocop-rspec (2.18.1)
60
- rubocop (~> 1.33)
61
- rubocop-capybara (~> 2.17)
62
- ruby-progressbar (1.11.0)
63
- sevencop (0.33.0)
72
+ rubocop-rspec (3.0.3)
73
+ rubocop (~> 1.61)
74
+ ruby-progressbar (1.13.0)
75
+ sevencop (0.43.1)
64
76
  activesupport
65
77
  rubocop
66
- slimi (0.7.2)
78
+ slimi (0.7.4)
67
79
  temple
68
80
  thor
69
81
  tilt
70
- temple (0.10.0)
71
- thor (1.2.1)
72
- tilt (2.0.11)
82
+ strscan (3.1.0)
83
+ temple (0.10.3)
84
+ thor (1.3.1)
85
+ tilt (2.4.0)
73
86
  tzinfo (2.0.6)
74
87
  concurrent-ruby (~> 1.0)
75
- unicode-display_width (2.4.2)
88
+ unicode-display_width (2.5.0)
76
89
 
77
90
  PLATFORMS
78
91
  x86_64-linux
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Slim
5
- VERSION = '0.2.2'
5
+ VERSION = '0.2.4'
6
6
  end
7
7
  end
@@ -30,10 +30,17 @@ module RuboCop
30
30
  match_data = @ruby_clip.code.match(REGEXP)
31
31
  if match_data
32
32
  offset = match_data[0].length
33
- parse("[#{@ruby_clip.code[offset..]}]").children.map do |child|
33
+ condition = @ruby_clip.code[offset..].sub(/[ \t]then(?:[ \t].*)?/, '')
34
+ parse(
35
+ <<~RUBY
36
+ [
37
+ #{condition}
38
+ ]
39
+ RUBY
40
+ ).children.map do |child|
34
41
  RubyClip.new(
35
42
  code: child.location.expression.source,
36
- offset: @ruby_clip.offset + offset + child.location.expression.begin_pos - 1
43
+ offset: @ruby_clip.offset + offset + child.location.expression.begin_pos - 4
37
44
  )
38
45
  end
39
46
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-slim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-16 00:00:00.000000000 Z
11
+ date: 2024-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.3.26
89
+ rubygems_version: 3.3.27
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: RuboCop plugin for Slim template.