node_mutation 1.12.1 → 1.12.2
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/node_mutation/action.rb +7 -4
- data/lib/node_mutation/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf57adfc552f6b661bf4c08a35976f017dc7439c914cb1e419e656952d77bcef
|
4
|
+
data.tar.gz: ee142c7f5b1b8e2ae7a0b51a36dd8718232918c2fa57595e84470e284fe86411
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a4106b2a6324eac65cb782cb3e3863b4544f7798bb87313205bb5b0cf62d55fc3ed75feb36161fe4810ca5ae030f26bb66347d5b1779a035123a5cddaff12b3
|
7
|
+
data.tar.gz: fa65851e47d51b26ca21efc76d4b16ebc1d3743e7dae9d616ba696dc2491e600077b934aea8f3c8db5345c9220ddbf7a883461058d0c73e381f1e5ef99f589db
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/node_mutation/action.rb
CHANGED
@@ -54,12 +54,15 @@ class NodeMutation::Action
|
|
54
54
|
end
|
55
55
|
|
56
56
|
# remove unused whitespace.
|
57
|
-
# e.g.
|
58
|
-
# the code should be changed to
|
57
|
+
# e.g. `%i[foo bar]`, if we remove `foo`, the whitespace should also be removed,
|
58
|
+
# the code should be changed to `%i[bar]`.
|
59
59
|
def remove_whitespace
|
60
|
-
|
60
|
+
if ["\n", ';', ')', ']', '}', '|', nil].include?(file_source[@end]) && file_source[@start - 1] == ' '
|
61
|
+
@start -= 1
|
62
|
+
return
|
63
|
+
end
|
61
64
|
|
62
|
-
|
65
|
+
if [' ', '(', '[', '{', '|'].include?(file_source[@start - 1]) && file_source[@end] == ' '
|
63
66
|
@end += 1
|
64
67
|
end
|
65
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: node_mutation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubis
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
rubygems_version: 3.4.
|
86
|
+
rubygems_version: 3.4.6
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: ast node mutation apis
|