synvert-core 1.23.0 → 1.23.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6590e4796366364169c7e2cc65779406ce8a8f88221ffcd7f0ad05df4487f78b
4
- data.tar.gz: b1792cc8d6744fbef809d43ba428f0d5592702c6abee4653fe8160a87261acd4
3
+ metadata.gz: 862649a82e2cd9d14454b65b9c3e146c2c6adff96a03441624cca7d83f42a8f5
4
+ data.tar.gz: 167e5ee0a3ae617888af58dd40ee582d3427012a5e0daea881f13ffd51a07b8a
5
5
  SHA512:
6
- metadata.gz: ec759f01184a5730b99742f28310b72df7e5c844fcafa535238dcfacaca8582e9e13b695219ec76f3b8a45194d15aec2caed1e714848cad33263de53a6a56be2
7
- data.tar.gz: eef33bbc2623a9ff16e908722ef358cbec51188911e07e1c9c8e44bcb4029c4e73cc1c0da54581d557c3d1edde0f8ed224fff75dffca5b2fcd347e1eed3f83f8
6
+ metadata.gz: dbf9a15e4e795edf0bedcb690b163b088ca00236545881744ef8ac004c68059cf90654d3804626e29e8b3ce4a9e3ccb3e9e7cf6d82ea05c98c941f6e59c77b8c
7
+ data.tar.gz: 916953fc304f4a2054b3722197ec0d194a958b2f502d5ea379411b1de970fc9691aaa3caf68c3458f99281a92d7c316bb084fe3deaba7af0fd03e0df7cbd31c9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.23.1 (2023-04-06)
4
+
5
+ * Fix array index name in `GotoScope`
6
+ * Update `node_query` to 1.12.1
7
+
3
8
  ## 1.23.0 (2023-04-05)
4
9
 
5
10
  * Add haml engine
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synvert-core (1.23.0)
4
+ synvert-core (1.23.1)
5
5
  activesupport (< 7.0.0)
6
6
  node_mutation (>= 1.14.0)
7
- node_query (>= 1.12.0)
7
+ node_query (>= 1.12.1)
8
8
  parallel
9
9
  parser
10
10
  parser_node_ext (>= 1.0.0)
@@ -49,7 +49,7 @@ GEM
49
49
  minitest (5.18.0)
50
50
  nenv (0.3.0)
51
51
  node_mutation (1.14.0)
52
- node_query (1.12.0)
52
+ node_query (1.12.1)
53
53
  notiffany (0.1.3)
54
54
  nenv (~> 0.1)
55
55
  shellany (~> 0.0)
@@ -20,7 +20,7 @@ module Synvert::Core
20
20
 
21
21
  child_node = current_node
22
22
  @child_node_name.to_s.split('.').each do |child_node_name|
23
- child_node = child_node_name.is_a?(Parser::AST::Node) ? child_node_name : child_node.send(child_node_name)
23
+ child_node = child_node.is_a?(Array) && child_node_name =~ /-?\d+/ ? child_node[child_node_name.to_i] : child_node.send(child_node_name)
24
24
  end
25
25
  if child_node.is_a?(Array)
26
26
  child_node.each do |child_child_node|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '1.23.0'
5
+ VERSION = '1.23.1'
6
6
  end
7
7
  end
@@ -33,7 +33,21 @@ module Synvert::Core
33
33
  expect(instance.current_node.type).to eq :block
34
34
  end
35
35
 
36
- it 'calls block multiple times with blok body' do
36
+ it 'call block with child node in array' do
37
+ run = false
38
+ type_in_scope = nil
39
+ scope =
40
+ Rewriter::GotoScope.new instance, 'body.1' do
41
+ run = true
42
+ type_in_scope = node.type
43
+ end
44
+ scope.process
45
+ expect(run).to be_truthy
46
+ expect(type_in_scope).to eq :send
47
+ expect(instance.current_node.type).to eq :block
48
+ end
49
+
50
+ it 'calls block multiple times with block body' do
37
51
  count = 0
38
52
  scope =
39
53
  Rewriter::GotoScope.new instance, 'body' do
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_runtime_dependency "activesupport", "< 7.0.0"
23
- spec.add_runtime_dependency "node_query", ">= 1.12.0"
23
+ spec.add_runtime_dependency "node_query", ">= 1.12.1"
24
24
  spec.add_runtime_dependency "node_mutation", ">= 1.14.0"
25
25
  spec.add_runtime_dependency "parser"
26
26
  spec.add_runtime_dependency "parser_node_ext", ">= 1.0.0"
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.23.0
4
+ version: 1.23.1
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-04-05 00:00:00.000000000 Z
11
+ date: 2023-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.12.0
33
+ version: 1.12.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.12.0
40
+ version: 1.12.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: node_mutation
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  - !ruby/object:Gem::Version
177
177
  version: '0'
178
178
  requirements: []
179
- rubygems_version: 3.4.6
179
+ rubygems_version: 3.4.10
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: convert ruby code to better syntax.