node_mutation 1.4.3 → 1.4.4

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: 739b5f521fb0df8ea2e4b47f11851574e4e771528923fa89e0d7c5a2ed8a0b7b
4
- data.tar.gz: fe8c44a82ef5a21df6390936f7b5b91700c8a7f965e34ada1229ef2443b013c6
3
+ metadata.gz: 3e22702ce72aa488794a76e0d762283155783d56e1af0e5135ad91d768a917ab
4
+ data.tar.gz: 4b0c210a8c94cc46bfce28570164210cc2f54bb768df1b470ea3c27e8f2a7c98
5
5
  SHA512:
6
- metadata.gz: b2dd045bc579535b9ba6c6ece53c8f19ae840385682ca0f3759713b5ee36abca574cbf4a80c065b024ecbf40d23a39c423b6e7ecd3a82d4417f7b65583b78885
7
- data.tar.gz: 298af0ed4518668a784df4e5c3fec4a3904fa63fc325ace94d90ec869cd111efe5e20829b6f0f8902264f38fe87ea2359c65db1ada2170813b4ce62886fdbaef
6
+ metadata.gz: 22d09f324deb8982994201df87bfcf21562576def43034ac9a5f0a0599ee264df8852a0cde609dc41098d314b9fed7ec70e135a51c0ffe8c9ffa293f2436820c
7
+ data.tar.gz: a0348978965f9e3fdbdfe20bba6ad40830f1b1f039859f2fafecaa4329f4f81d52cee64f5bcbaf69c32229b75126cb9554c55256fb421134073d19de2759c2bb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # NodeMutation
2
2
 
3
+ ## 1.4.4 (2022-09-26)
4
+
5
+ * Parser adapter `child_node_by_name` support function call
6
+
3
7
  ## 1.4.3 (2022-09-24)
4
8
 
5
9
  * Update source only if `new_code` is not `nil`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- node_mutation (1.4.3)
4
+ node_mutation (1.4.4)
5
5
  activesupport (< 7.0.0)
6
6
  erubis
7
7
 
@@ -161,14 +161,18 @@ class NodeMutation::ParserAdapter < NodeMutation::Adapter
161
161
 
162
162
  if node.respond_to?(direct_child_name)
163
163
  child_node = node.send(direct_child_name)
164
+ elsif direct_child_name.include?('(') && direct_child_name.include?(')')
165
+ child_node = eval("node.#{direct_child_name}")
166
+ else
167
+ child_node = nil
168
+ end
164
169
 
165
- return child_node_by_name(child_node, nested_child_name) if nested_child_name
170
+ return child_node_by_name(child_node, nested_child_name) if nested_child_name
166
171
 
167
- return nil if child_node.nil?
172
+ return nil if child_node.nil?
168
173
 
169
- return child_node if child_node.is_a?(Parser::AST::Node)
174
+ return child_node if child_node.is_a?(Parser::AST::Node)
170
175
 
171
- return child_node
172
- end
176
+ return child_node
173
177
  end
174
178
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class NodeMutation
4
- VERSION = "1.4.3"
4
+ VERSION = "1.4.4"
5
5
  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.4.3
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-23 00:00:00.000000000 Z
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport