erb_lint 0.0.33 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/erb_lint/utils/offset_corrector.rb +18 -1
- data/lib/erb_lint/version.rb +1 -1
- 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: 65e35ea36e2654316241c7267aca2f9b581fa7eb5c858008a80dfc098c07a187
|
4
|
+
data.tar.gz: db35c2f60f85651728bec14a853fc8d7060e93e686c9cababa55bccb3dd46c49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe12716e085e0baa6beef5c1395bf86874f442db6087c2d1312315cb4d60704cca5a007a3843738197d58fa0025d35b993bbbed5606ca9a3c71b81928d365e2
|
7
|
+
data.tar.gz: 7bb3506036e3a098cb9c688c20373a80bc413a6528fcb05b951e16996dd62eea358c01658f5b2aceb4d4b1b4bc63afa7ad53d852478b2b49d549a13f3da6ed1c
|
@@ -38,7 +38,9 @@ module ERBLint
|
|
38
38
|
@corrector.remove_trailing(range_with_offset(range), size)
|
39
39
|
end
|
40
40
|
|
41
|
-
def range_with_offset(
|
41
|
+
def range_with_offset(node_or_range)
|
42
|
+
range = to_range(node_or_range)
|
43
|
+
|
42
44
|
@processed_source.to_source_range(
|
43
45
|
bound(@offset + range.begin_pos)..bound(@offset + (range.end_pos - 1))
|
44
46
|
)
|
@@ -50,6 +52,21 @@ module ERBLint
|
|
50
52
|
@bound_range.max,
|
51
53
|
].min
|
52
54
|
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def to_range(node_or_range)
|
59
|
+
case node_or_range
|
60
|
+
when ::RuboCop::AST::Node, ::Parser::Source::Comment
|
61
|
+
node_or_range.loc.expression
|
62
|
+
when ::Parser::Source::Range
|
63
|
+
node_or_range
|
64
|
+
else
|
65
|
+
raise TypeError,
|
66
|
+
'Expected a Parser::Source::Range, Comment or ' \
|
67
|
+
"Rubocop::AST::Node, got #{node_or_range.class}"
|
68
|
+
end
|
69
|
+
end
|
53
70
|
end
|
54
71
|
end
|
55
72
|
end
|
data/lib/erb_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erb_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Chan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: better_html
|