node_query 1.15.2 → 1.15.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 +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +5 -4
- data/lib/node_query/node_rules.rb +1 -1
- 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: 248ecdf537a77583086b3e03b2ad5235264898da63b1a1038af234be48404b95
|
4
|
+
data.tar.gz: 18ff554ae6c55f7e9eeba88cd48e1cc99deb50394d6a98bae5a6281d4b578dc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9221cf053b6362069ccbe380a9d6f1803e779f9b89a029ec23d5d33fbdcc8e1ed704e6bb0561e58bfc6f94669b42f804e14c86aefa167f3f774a817fd1a46423
|
7
|
+
data.tar.gz: 90cf347b582004377dbf31dce64c8bca69e15d5e86c4cd397b8ba0aa4fbc06552261f5aa8b3aa4fe25d4e356bae32a2d4ab9806147cf1e0d32bf9b5decbf630f
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -477,14 +477,15 @@ It matches def node whose arguments are id and name.
|
|
477
477
|
|
478
478
|
## Write Adapter
|
479
479
|
|
480
|
-
Different parser, like parser, syntax_tree, will generate different AST nodes, to make NodeQuery work for them all,
|
480
|
+
Different parser, like prism, parser, syntax_tree, will generate different AST nodes, to make NodeQuery work for them all,
|
481
481
|
we define an [Adapter](https://github.com/synvert-hq/node-query-ruby/blob/main/lib/node_query/adapter.rb) interface,
|
482
482
|
if you implement the Adapter interface, you can set it as NodeQuery's adapter.
|
483
483
|
|
484
|
-
It provides
|
484
|
+
It provides 3 adapters
|
485
485
|
|
486
|
-
1. `
|
487
|
-
2. `
|
486
|
+
1. `PrismAdapter`
|
487
|
+
2. `ParserAdapter`
|
488
|
+
3. `SyntaxTreeAdapter`
|
488
489
|
|
489
490
|
## Development
|
490
491
|
|
@@ -101,7 +101,7 @@ class NodeQuery::NodeRules
|
|
101
101
|
actual_source = @adapter.get_source(actual)
|
102
102
|
actual_source == ":#{expected}" || actual_source == expected.to_s
|
103
103
|
else
|
104
|
-
actual
|
104
|
+
actual&.to_sym == expected
|
105
105
|
end
|
106
106
|
when String
|
107
107
|
if @adapter.is_node?(actual)
|
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.15.
|
4
|
+
version: 1.15.3
|
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-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ast node query language
|
14
14
|
email:
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
|
-
rubygems_version: 3.5.
|
82
|
+
rubygems_version: 3.5.9
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: ast node query language
|