rubocop-erb 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.gemfile.lock +1 -1
- data/lib/rubocop/erb/keyword_remover.rb +1 -0
- data/lib/rubocop/erb/version.rb +1 -1
- data/lib/rubocop/erb/when_decomposer.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b13699d8ba0b6d66de391094e0bbfcc7a4476cfcd821e584b1c75c7d016324c5
|
4
|
+
data.tar.gz: bfab6b295f44a2e98e74b4a35ad82217ccf14cf212943b9c9dd4c2d978df3531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d11d09706fd7d59ef07600ce2c3986ba90b436272465c19ed3dc60e1a87344540396d7b739d2f64afce8d6e486cc4de6a276e47eabf6251695d22f43df0a6fb3
|
7
|
+
data.tar.gz: f3153518ca9634939f6327e8881aa958012d20d1805ecb677a66909424d27add955bdb50c4f128d8b350184a153b5ac60657e838ff745cb679e7d3f68a77e971
|
data/Gemfile.lock
CHANGED
data/lib/rubocop/erb/version.rb
CHANGED
@@ -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
|
-
|
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 -
|
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-erb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: better_html
|