node_query 1.15.2 → 1.15.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: 73328f35ddead7666ea7205aec6775a739ac3875addb68f0716787186149aac5
4
- data.tar.gz: b789b58e27ad38de762a2b4f41f2cd0fc4747ef92c8db84ee13204a2f7f72cf0
3
+ metadata.gz: 033ac29de15656a8eb6e5a20eced18efa53253afa3c263c4a0947028404a0030
4
+ data.tar.gz: adc0a52b3b83ca0f556c1a8d895f4236efb29bb5808d38ca0a6be082d57394f6
5
5
  SHA512:
6
- metadata.gz: 74fac5a891c4271fa838b955846c7ee816ef26efc557be71b70474225152c1f3ea84209a6301683bb40c6c0fe19aaddf0fec2aa8f934c1a8aa412eb131d19f3c
7
- data.tar.gz: d8b25d7069670207d470760b024f47affcc013ecc31b89acb6ec985fb8e8b5716451ff991dceed202703c293fe2f4e5ddb41e8801e6b11692a21cb3f31208a16
6
+ metadata.gz: 0f233ed498d5fc0d911a3cd5c4f611f4ee4ae8835110387a0dd1e5ca4c9d660aa05cb3e6a3c8ea9958f417f4a7004c63559fac5f3f8dbe4c9939649d4ed023d3
7
+ data.tar.gz: f3ccde8ceb897ca676aaeaf25837ff7cd6c616292896cb8784937d3569c70eae4d239d9fb14e5d6f104d88dadcd30d606862b400d5b435c881cd76676308ad92
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.15.4 (2024-07-02)
4
+
5
+ * Drop support ruby 2.6
6
+ * Update `prism_ext` to 0.3.3
7
+ * Use `Prism::Node#to_source`
8
+
9
+ ## 1.15.3 (2024-05-30)
10
+
11
+ * Fix actual value is nil
12
+
3
13
  ## 1.15.2 (2024-04-07)
4
14
 
5
15
  * Update `prism_ext` to 0.3.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- node_query (1.15.2)
4
+ node_query (1.15.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -44,8 +44,8 @@ GEM
44
44
  parser_node_ext (1.3.0)
45
45
  parser
46
46
  prettier_print (1.2.1)
47
- prism (0.25.0)
48
- prism_ext (0.3.0)
47
+ prism (0.30.0)
48
+ prism_ext (0.3.3)
49
49
  prism
50
50
  pry (0.14.1)
51
51
  coderay (~> 1.1)
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 2 adapters
484
+ It provides 3 adapters
485
485
 
486
- 1. `ParserAdapter`
487
- 2. `SyntaxTreeAdapter`
486
+ 1. `PrismAdapter`
487
+ 2. `ParserAdapter`
488
+ 3. `SyntaxTreeAdapter`
488
489
 
489
490
  ## Development
490
491
 
@@ -13,7 +13,7 @@ class NodeQuery::PrismAdapter
13
13
  end
14
14
 
15
15
  def get_source(node)
16
- node.slice
16
+ node.to_source
17
17
  end
18
18
 
19
19
  def get_children(node)
@@ -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.to_sym == expected
104
+ actual&.to_sym == expected
105
105
  end
106
106
  when String
107
107
  if @adapter.is_node?(actual)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class NodeQuery
4
- VERSION = "1.15.2"
4
+ VERSION = "1.15.4"
5
5
  end
data/node_query.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = "ast node query language"
12
12
  spec.description = "ast node query language"
13
13
  spec.homepage = "https://github.com/synvert-hq/node-query-ruby"
14
- spec.required_ruby_version = ">= 2.6.0"
14
+ spec.required_ruby_version = ">= 2.7.0"
15
15
 
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = "https://github.com/synvert-hq/node-query-ruby"
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.2
4
+ version: 1.15.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: 2024-04-07 00:00:00.000000000 Z
11
+ date: 2024-07-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ast node query language
14
14
  email:
@@ -72,14 +72,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 2.6.0
75
+ version: 2.7.0
76
76
  required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  requirements: []
82
- rubygems_version: 3.5.3
82
+ rubygems_version: 3.5.14
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: ast node query language