node_query 1.13.10 → 1.13.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/lib/node_query/helper.rb +14 -9
- data/lib/node_query/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: d162f1ed40046054e6b68d3b89341508485ca005541c16408c632f86f205a818
|
4
|
+
data.tar.gz: 191962526bb18daa93b6e506181c99d211cdc3273fe861d4e6aec699720b5557
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a3ed7084d7268f5e4aef354fd5b49abec8e255ca542a755992eabb705402e23eabfead3d16b37a6b451c63c5703bdf2f24da59be8bbdbbe9b623e02b44dcf9f
|
7
|
+
data.tar.gz: 00d10e20a2a6cbc4db6340bdc01f77a543361e689cc877fbb5923f996306c51301cd40612fbf9d6e3928954aa680a0f3055cea6d273dc7043bfaebb960e9cfed
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
node_query (1.13.
|
4
|
+
node_query (1.13.11)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -67,7 +67,7 @@ GEM
|
|
67
67
|
shellany (0.0.1)
|
68
68
|
syntax_tree (6.1.1)
|
69
69
|
prettier_print (>= 1.2.0)
|
70
|
-
syntax_tree_ext (0.6.
|
70
|
+
syntax_tree_ext (0.6.4)
|
71
71
|
syntax_tree
|
72
72
|
thor (1.2.1)
|
73
73
|
|
data/lib/node_query/helper.rb
CHANGED
@@ -33,15 +33,7 @@ class NodeQuery::Helper
|
|
33
33
|
# @yieldparam child [Node] child node
|
34
34
|
def handle_recursive_child(node, &block)
|
35
35
|
NodeQuery.adapter.get_children(node).each do |child|
|
36
|
-
|
37
|
-
block.call(child)
|
38
|
-
handle_recursive_child(child, &block)
|
39
|
-
elsif child.is_a?(Array)
|
40
|
-
child.each do |child_child|
|
41
|
-
block.call(child_child)
|
42
|
-
handle_recursive_child(child_child, &block)
|
43
|
-
end
|
44
|
-
end
|
36
|
+
handle_child(child, &block)
|
45
37
|
end
|
46
38
|
end
|
47
39
|
|
@@ -67,5 +59,18 @@ class NodeQuery::Helper
|
|
67
59
|
|
68
60
|
node.to_s
|
69
61
|
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def handle_child(node, &block)
|
66
|
+
if NodeQuery.adapter.is_node?(node)
|
67
|
+
block.call(node)
|
68
|
+
handle_recursive_child(node, &block)
|
69
|
+
elsif node.is_a?(Array)
|
70
|
+
node.each do |child_node|
|
71
|
+
handle_child(child_node, &block) unless child_node.nil?
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
70
75
|
end
|
71
76
|
end
|
data/lib/node_query/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: node_query
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.11
|
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-08-
|
11
|
+
date: 2023-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ast node query language
|
14
14
|
email:
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.4.
|
81
|
+
rubygems_version: 3.4.18
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: ast node query language
|