synvert-core 1.21.1 → 1.21.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +6 -6
- data/lib/synvert/core/rewriter/scope/goto_scope.rb +10 -2
- data/lib/synvert/core/version.rb +1 -1
- data/spec/synvert/core/rewriter/scope/goto_scope_spec.rb +14 -1
- data/synvert-core-ruby.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fcf7cea4b77b429f7d0bcd373edbe41e5ce0fa0efd51c2ce9fc1f489d8d4d2d
|
4
|
+
data.tar.gz: 66ee39ba9dcc28bc8636ba3489279d62ab8007d276b66d16ec1953b3a030c9e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00b89829cca5269e433078f9634c22d4b52ca1128fbfc74925bc212d5eb31400b79e0c769dde9e2e2fa94442c38902fce68ad6fa58d5ac9daebac6fa9d5d7239
|
7
|
+
data.tar.gz: fcbc29ce9c8e0057adf91908929e735f3e80931df869dc66c84254a9a546ba66034efb020a67a5143884ad53f39d63a8b53c4b134785ada1fbbc3496f1f037a3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 1.21.3 (2023-02-12)
|
4
|
+
|
5
|
+
* Update `parser_node_ext` to 1.0.0
|
6
|
+
|
7
|
+
## 1.21.2 (2023-02-11)
|
8
|
+
|
9
|
+
* Call block multiple times when goto node array
|
10
|
+
* Update `node_mutation` to 1.9.2
|
11
|
+
|
3
12
|
## 1.21.1 (2023-02-10)
|
4
13
|
|
5
14
|
* Add `tab_size` option to `add_leading_spaces`
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
synvert-core (1.21.
|
4
|
+
synvert-core (1.21.3)
|
5
5
|
activesupport (< 7.0.0)
|
6
6
|
erubis
|
7
|
-
node_mutation (>= 1.9.
|
7
|
+
node_mutation (>= 1.9.2)
|
8
8
|
node_query (>= 1.12.0)
|
9
9
|
parallel
|
10
10
|
parser
|
11
|
-
parser_node_ext (>= 0.
|
11
|
+
parser_node_ext (>= 1.0.0)
|
12
12
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
@@ -50,7 +50,7 @@ GEM
|
|
50
50
|
method_source (1.0.0)
|
51
51
|
minitest (5.17.0)
|
52
52
|
nenv (0.3.0)
|
53
|
-
node_mutation (1.9.
|
53
|
+
node_mutation (1.9.2)
|
54
54
|
erubis
|
55
55
|
node_query (1.12.0)
|
56
56
|
notiffany (0.1.3)
|
@@ -59,7 +59,7 @@ GEM
|
|
59
59
|
parallel (1.22.1)
|
60
60
|
parser (3.2.1.0)
|
61
61
|
ast (~> 2.4.1)
|
62
|
-
parser_node_ext (0.
|
62
|
+
parser_node_ext (1.0.0)
|
63
63
|
parser
|
64
64
|
pry (0.14.1)
|
65
65
|
coderay (~> 1.1)
|
@@ -85,7 +85,7 @@ GEM
|
|
85
85
|
thor (1.2.1)
|
86
86
|
tzinfo (2.0.6)
|
87
87
|
concurrent-ruby (~> 1.0)
|
88
|
-
zeitwerk (2.6.
|
88
|
+
zeitwerk (2.6.7)
|
89
89
|
|
90
90
|
PLATFORMS
|
91
91
|
ruby
|
@@ -22,8 +22,16 @@ module Synvert::Core
|
|
22
22
|
@child_node_name.to_s.split('.').each do |child_node_name|
|
23
23
|
child_node = child_node_name.is_a?(Parser::AST::Node) ? child_node_name : child_node.send(child_node_name)
|
24
24
|
end
|
25
|
-
|
26
|
-
|
25
|
+
if child_node.is_a?(Array)
|
26
|
+
child_node.each do |child_child_node|
|
27
|
+
@instance.process_with_other_node child_child_node do
|
28
|
+
@instance.instance_eval(&@block)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
else
|
32
|
+
@instance.process_with_other_node child_node do
|
33
|
+
@instance.instance_eval(&@block)
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
29
37
|
end
|
data/lib/synvert/core/version.rb
CHANGED
@@ -10,6 +10,8 @@ module Synvert::Core
|
|
10
10
|
}
|
11
11
|
let(:source) { <<~EOS }
|
12
12
|
Factory.define :user do |user|
|
13
|
+
user.first_name 'First'
|
14
|
+
user.last_name 'Last'
|
13
15
|
end
|
14
16
|
EOS
|
15
17
|
|
@@ -17,7 +19,7 @@ module Synvert::Core
|
|
17
19
|
before { instance.current_node = node }
|
18
20
|
|
19
21
|
describe '#process' do
|
20
|
-
it '
|
22
|
+
it 'calls block with child node' do
|
21
23
|
run = false
|
22
24
|
type_in_scope = nil
|
23
25
|
scope =
|
@@ -30,6 +32,17 @@ module Synvert::Core
|
|
30
32
|
expect(type_in_scope).to eq :const
|
31
33
|
expect(instance.current_node.type).to eq :block
|
32
34
|
end
|
35
|
+
|
36
|
+
it 'calls block multiple times with blok body' do
|
37
|
+
count = 0
|
38
|
+
scope =
|
39
|
+
Rewriter::GotoScope.new instance, 'body' do
|
40
|
+
count += 1
|
41
|
+
end
|
42
|
+
scope.process
|
43
|
+
expect(count).to eq 2
|
44
|
+
expect(instance.current_node.type).to eq :block
|
45
|
+
end
|
33
46
|
end
|
34
47
|
end
|
35
48
|
end
|
data/synvert-core-ruby.gemspec
CHANGED
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_runtime_dependency "activesupport", "< 7.0.0"
|
23
23
|
spec.add_runtime_dependency "erubis"
|
24
24
|
spec.add_runtime_dependency "node_query", ">= 1.12.0"
|
25
|
-
spec.add_runtime_dependency "node_mutation", ">= 1.9.
|
25
|
+
spec.add_runtime_dependency "node_mutation", ">= 1.9.2"
|
26
26
|
spec.add_runtime_dependency "parser"
|
27
|
-
spec.add_runtime_dependency "parser_node_ext", ">= 0.
|
27
|
+
spec.add_runtime_dependency "parser_node_ext", ">= 1.0.0"
|
28
28
|
spec.add_runtime_dependency "parallel"
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synvert-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.21.
|
4
|
+
version: 1.21.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.9.
|
61
|
+
version: 1.9.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.9.
|
68
|
+
version: 1.9.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: parser
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 1.0.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 1.0.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: parallel
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|