leftovers 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 +5 -5
- data/CHANGELOG.md +9 -0
- data/lib/leftovers/erb.rb +2 -2
- data/lib/leftovers/matcher_builders/node_value.rb +15 -7
- data/lib/leftovers/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 03a9797868cc444642bc0d475de4bd067a344891
|
4
|
+
data.tar.gz: fa5961bbcbb420c1a4a1159215e5df64da163b71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c6d93694df1819e9f464b184b64ebb4ce53fe8b73558c59e286d21fae4d349bed14e89c57c4f6f7c38a7c8ec51669cd6ab909d09f6ec7384f197725846c5092
|
7
|
+
data.tar.gz: 2955b7635cf34fccbaa06e3555ec0210a2a9fc00afa116c7a9e412d703c22a6ad3e563021ace19fec7cd96d13ec5d3222515355f0794a39206deab64ac1297bb
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# v0.5.1
|
2
|
+
- fixed a bug with the erb parsing where it was incorrectly compiling comments:
|
3
|
+
```
|
4
|
+
<% # Comment %>
|
5
|
+
<% if query? %>
|
6
|
+
<%= content %>
|
7
|
+
<% end %>
|
8
|
+
```
|
9
|
+
|
1
10
|
# v0.5.0
|
2
11
|
- `has_receiver:` will match the receiver for methods and the namespace for constants.
|
3
12
|
- `has_value_type:` is now `has_value: type:`
|
data/lib/leftovers/erb.rb
CHANGED
@@ -12,7 +12,7 @@ module Leftovers
|
|
12
12
|
when ::String
|
13
13
|
::Leftovers::MatcherBuilders::NodeName.build(pat)
|
14
14
|
when ::Hash
|
15
|
-
build_from_hash(pat)
|
15
|
+
build_from_hash(**pat)
|
16
16
|
# :nocov:
|
17
17
|
else raise
|
18
18
|
# :nocov:
|
@@ -22,18 +22,26 @@ module Leftovers
|
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
|
-
def build_from_hash(
|
25
|
+
def build_from_hash( # rubocop:disable Metrics/MethodLength, Metrics/ParameterLists
|
26
|
+
at: nil, has_value: nil,
|
27
|
+
match: nil, has_prefix: nil, has_suffix: nil,
|
28
|
+
type: nil,
|
29
|
+
has_receiver: nil,
|
30
|
+
unless_arg: nil
|
31
|
+
)
|
26
32
|
matcher = ::Leftovers::MatcherBuilders::And.build([
|
27
|
-
::Leftovers::MatcherBuilders::NodeHasArgument.build(
|
33
|
+
::Leftovers::MatcherBuilders::NodeHasArgument.build(
|
34
|
+
at: at, has_value: has_value
|
35
|
+
),
|
28
36
|
::Leftovers::MatcherBuilders::NodeName.build(
|
29
|
-
|
37
|
+
match: match, has_prefix: has_prefix, has_suffix: has_suffix
|
30
38
|
),
|
31
|
-
::Leftovers::MatcherBuilders::NodeType.build(
|
32
|
-
::Leftovers::MatcherBuilders::NodeHasReceiver.build(
|
39
|
+
::Leftovers::MatcherBuilders::NodeType.build(type),
|
40
|
+
::Leftovers::MatcherBuilders::NodeHasReceiver.build(has_receiver)
|
33
41
|
])
|
34
42
|
|
35
43
|
::Leftovers::MatcherBuilders::AndNot.build(
|
36
|
-
matcher, ::Leftovers::MatcherBuilders::NodeValue.build(
|
44
|
+
matcher, ::Leftovers::MatcherBuilders::NodeValue.build(unless_arg)
|
37
45
|
)
|
38
46
|
end
|
39
47
|
end
|
data/lib/leftovers/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leftovers
|
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
|
- Dana Sherson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -465,7 +465,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
465
465
|
- !ruby/object:Gem::Version
|
466
466
|
version: '0'
|
467
467
|
requirements: []
|
468
|
-
|
468
|
+
rubyforge_project:
|
469
|
+
rubygems_version: 2.6.13
|
469
470
|
signing_key:
|
470
471
|
specification_version: 4
|
471
472
|
summary: Find unused methods and classes/modules
|