node_query 1.15.1 → 1.15.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 +7 -0
- data/Gemfile.lock +5 -5
- data/README.md +5 -2
- data/lib/node_query/adapter/syntax_tree.rb +1 -1
- data/lib/node_query/version.rb +1 -1
- data/node_query.gemspec +3 -3
- 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: 73328f35ddead7666ea7205aec6775a739ac3875addb68f0716787186149aac5
|
4
|
+
data.tar.gz: b789b58e27ad38de762a2b4f41f2cd0fc4747ef92c8db84ee13204a2f7f72cf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74fac5a891c4271fa838b955846c7ee816ef26efc557be71b70474225152c1f3ea84209a6301683bb40c6c0fe19aaddf0fec2aa8f934c1a8aa412eb131d19f3c
|
7
|
+
data.tar.gz: d8b25d7069670207d470760b024f47affcc013ecc31b89acb6ec985fb8e8b5716451ff991dceed202703c293fe2f4e5ddb41e8801e6b11692a21cb3f31208a16
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 1.15.2 (2024-04-07)
|
4
|
+
|
5
|
+
* Update `prism_ext` to 0.3.0
|
6
|
+
* Update `syntax_tree_ext` to 0.8.1
|
7
|
+
* Update `parser_node_ext` to 1.3.0
|
8
|
+
* Require `parent_node_ext` only when necessary
|
9
|
+
|
3
10
|
## 1.15.1 (2024-02-16)
|
4
11
|
|
5
12
|
* Use `deconstruct_keys` to get prism children
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
node_query (1.15.
|
4
|
+
node_query (1.15.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -41,11 +41,11 @@ GEM
|
|
41
41
|
parser (3.3.0.5)
|
42
42
|
ast (~> 2.4.1)
|
43
43
|
racc
|
44
|
-
parser_node_ext (1.
|
44
|
+
parser_node_ext (1.3.0)
|
45
45
|
parser
|
46
46
|
prettier_print (1.2.1)
|
47
|
-
prism (0.
|
48
|
-
prism_ext (0.
|
47
|
+
prism (0.25.0)
|
48
|
+
prism_ext (0.3.0)
|
49
49
|
prism
|
50
50
|
pry (0.14.1)
|
51
51
|
coderay (~> 1.1)
|
@@ -71,7 +71,7 @@ GEM
|
|
71
71
|
shellany (0.0.1)
|
72
72
|
syntax_tree (6.2.0)
|
73
73
|
prettier_print (>= 1.2.0)
|
74
|
-
syntax_tree_ext (0.
|
74
|
+
syntax_tree_ext (0.8.1)
|
75
75
|
syntax_tree
|
76
76
|
thor (1.2.1)
|
77
77
|
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# NodeQuery
|
2
2
|
|
3
|
+
[![Build Status](https://github.com/synvert-hq/node-query-ruby/actions/workflows/main.yml/badge.svg)](https://github.com/synvert-hq/node-query-ruby/actions/workflows/main.yml)
|
4
|
+
[![Gem Version](https://img.shields.io/gem/v/node_query.svg)](https://rubygems.org/gems/node_query)
|
5
|
+
|
3
6
|
NodeQuery defines a NQL (node query language) and node rules to query AST nodes.
|
4
7
|
|
5
8
|
## Table of Contents
|
@@ -475,7 +478,7 @@ It matches def node whose arguments are id and name.
|
|
475
478
|
## Write Adapter
|
476
479
|
|
477
480
|
Different parser, like parser, syntax_tree, will generate different AST nodes, to make NodeQuery work for them all,
|
478
|
-
we define an [Adapter](https://github.com/
|
481
|
+
we define an [Adapter](https://github.com/synvert-hq/node-query-ruby/blob/main/lib/node_query/adapter.rb) interface,
|
479
482
|
if you implement the Adapter interface, you can set it as NodeQuery's adapter.
|
480
483
|
|
481
484
|
It provides 2 adapters
|
@@ -491,4 +494,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
491
494
|
|
492
495
|
## Contributing
|
493
496
|
|
494
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
497
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/synvert-hq/node-query-ruby.
|
@@ -22,7 +22,7 @@ class NodeQuery::SyntaxTreeAdapter
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def get_siblings(node)
|
25
|
-
child_nodes = node.parent_node
|
25
|
+
child_nodes = get_children(node.parent_node)
|
26
26
|
if child_nodes.is_a?(Array) && child_nodes.size == 1 && child_nodes.first.is_a?(Array)
|
27
27
|
index = child_nodes.first.index(node)
|
28
28
|
return child_nodes.first[index + 1...]
|
data/lib/node_query/version.rb
CHANGED
data/node_query.gemspec
CHANGED
@@ -10,12 +10,12 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = "ast node query language"
|
12
12
|
spec.description = "ast node query language"
|
13
|
-
spec.homepage = "https://github.com/
|
13
|
+
spec.homepage = "https://github.com/synvert-hq/node-query-ruby"
|
14
14
|
spec.required_ruby_version = ">= 2.6.0"
|
15
15
|
|
16
16
|
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
-
spec.metadata["source_code_uri"] = "https://github.com/
|
18
|
-
spec.metadata["changelog_uri"] = "https://github.com/
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/synvert-hq/node-query-ruby"
|
18
|
+
spec.metadata["changelog_uri"] = "https://github.com/synvert-hq/node-query-ruby/blob/master/CHANGELOG.md"
|
19
19
|
|
20
20
|
# Specify which files should be added to the gem when it is released.
|
21
21
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
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.15.
|
4
|
+
version: 1.15.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: 2024-
|
11
|
+
date: 2024-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ast node query language
|
14
14
|
email:
|
@@ -58,12 +58,12 @@ files:
|
|
58
58
|
- node_query.gemspec
|
59
59
|
- sig/node_query.rbs
|
60
60
|
- sig/node_query/adapter.rbs
|
61
|
-
homepage: https://github.com/
|
61
|
+
homepage: https://github.com/synvert-hq/node-query-ruby
|
62
62
|
licenses: []
|
63
63
|
metadata:
|
64
|
-
homepage_uri: https://github.com/
|
65
|
-
source_code_uri: https://github.com/
|
66
|
-
changelog_uri: https://github.com/
|
64
|
+
homepage_uri: https://github.com/synvert-hq/node-query-ruby
|
65
|
+
source_code_uri: https://github.com/synvert-hq/node-query-ruby
|
66
|
+
changelog_uri: https://github.com/synvert-hq/node-query-ruby/blob/master/CHANGELOG.md
|
67
67
|
post_install_message:
|
68
68
|
rdoc_options: []
|
69
69
|
require_paths:
|