node_mutation 1.13.0 → 1.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -3
- data/lib/node_mutation/action.rb +2 -2
- data/lib/node_mutation/parser_adapter.rb +1 -1
- data/lib/node_mutation/version.rb +1 -1
- data/node_mutation.gemspec +0 -3
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc332fd8345dc642414853ebc7f92ddf3f4d364c2bd5f5076d5de3a17368ce50
|
4
|
+
data.tar.gz: 4a5018954b0094f1dea13c4b4f7ce0237e368564b892a57cd680ec88fb062eb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2329f07950c9a97b1cb2729ffc9b617e146a56607476f03c8cb78e3047ebc52358e59ff4e80916e8bf521f4d8ff9e7e5801e2452b414f81ac447590e39ac9e6
|
7
|
+
data.tar.gz: b97de612f89f6d7e23a20e2bfaed7aa1c0ead95ba868c3535e9575161feb18a35b13a0a75623a814855ce149d7f56676ad1fc76836235ce5e4d8a503dc0147bb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# NodeMutation
|
2
2
|
|
3
|
+
## 1.13.2 (2023-04-01)
|
4
|
+
|
5
|
+
* Support `cvar`, `gvar`, `ivar`, and `lvar` name in `child_node_range`
|
6
|
+
|
7
|
+
## 1.13.1 (2023-03-31)
|
8
|
+
|
9
|
+
* Remove both whitespaces only when next char is nil
|
10
|
+
|
3
11
|
## 1.13.0 (2023-03-31)
|
4
12
|
|
5
13
|
* Adapter `get_start` and `get_end` can parse child node
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
node_mutation (1.13.
|
5
|
-
erubis
|
4
|
+
node_mutation (1.13.2)
|
6
5
|
|
7
6
|
GEM
|
8
7
|
remote: https://rubygems.org/
|
@@ -10,7 +9,6 @@ GEM
|
|
10
9
|
ast (2.4.2)
|
11
10
|
coderay (1.1.3)
|
12
11
|
diff-lcs (1.5.0)
|
13
|
-
erubis (2.7.0)
|
14
12
|
ffi (1.15.5)
|
15
13
|
formatador (1.1.0)
|
16
14
|
guard (2.18.0)
|
data/lib/node_mutation/action.rb
CHANGED
@@ -57,9 +57,9 @@ class NodeMutation::Action
|
|
57
57
|
# e.g. `%i[foo bar]`, if we remove `foo`, the whitespace should also be removed,
|
58
58
|
# the code should be changed to `%i[bar]`.
|
59
59
|
def remove_whitespace
|
60
|
-
if file_source[@
|
60
|
+
if file_source[@start - 1] == ' ' && file_source[@end] == ' '
|
61
61
|
@start -= 1
|
62
|
-
@end += 1
|
62
|
+
@end += 1 if file_source[@end + 1].nil?
|
63
63
|
return
|
64
64
|
end
|
65
65
|
|
@@ -88,7 +88,7 @@ class NodeMutation::ParserAdapter < NodeMutation::Adapter
|
|
88
88
|
node.arguments.first.loc.expression.begin_pos,
|
89
89
|
node.arguments.last.loc.expression.end_pos
|
90
90
|
)
|
91
|
-
when %i[class name], %i[const name], %i[def name], %i[defs name]
|
91
|
+
when %i[class name], %i[const name], %i[cvar name], %i[def name], %i[defs name], %i[gvar name], %i[ivar name], %i[lvar name]
|
92
92
|
NodeMutation::Struct::Range.new(node.loc.name.begin_pos, node.loc.name.end_pos)
|
93
93
|
when %i[defs dot]
|
94
94
|
NodeMutation::Struct::Range.new(node.loc.operator.begin_pos, node.loc.operator.end_pos) if node.loc.operator
|
data/node_mutation.gemspec
CHANGED
@@ -29,9 +29,6 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
# Uncomment to register a new dependency of your gem
|
33
|
-
spec.add_dependency "erubis"
|
34
|
-
|
35
32
|
# For more information and examples about making a new gem, check out our
|
36
33
|
# guide at: https://bundler.io/guides/creating_gem.html
|
37
34
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: node_mutation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.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-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: erubis
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
11
|
+
date: 2023-04-04 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
27
13
|
description: ast node mutation apis
|
28
14
|
email:
|
29
15
|
- flyerhzm@gmail.com
|