node_query 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/node_query/any_value.rb +5 -0
- data/lib/node_query/node_rules.rb +3 -3
- data/lib/node_query/version.rb +1 -1
- data/lib/node_query.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc14f10f4a27631913cd6d9b3b66b100864778756bc317b1529abe45999255b4
|
4
|
+
data.tar.gz: 2e04f47d2bbc0eade7ea2a047fe27174ec0e343d875203a0d3cd39fcaea50120
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b434f39629e544435594f4d299b845841b4610bed644954b0e835a7eed7d1b178d510d2ba5be8bfea0d3365d15f46d73a64ea8e9310037f4a851fa9989d05f3
|
7
|
+
data.tar.gz: bee545aae91e3769cb616e156f4cf6a69f628f5cc3a9e25432ea7eb9224a8ea49f1f76518b09601ce692b52790e5f0fd5da518d55650a243c0478d9056ac9a53
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -88,7 +88,7 @@ class NodeQuery::NodeRules
|
|
88
88
|
# @param actual [Object] actual value.
|
89
89
|
# @param expected [Object] expected value.
|
90
90
|
# @return [Boolean]
|
91
|
-
# @raise [
|
91
|
+
# @raise [NodeQuery::MethodNotSupported] if expected class is not supported.
|
92
92
|
def match_value?(actual, expected)
|
93
93
|
return true if actual == expected
|
94
94
|
|
@@ -136,10 +136,10 @@ class NodeQuery::NodeRules
|
|
136
136
|
:false == actual.type
|
137
137
|
when Parser::AST::Node
|
138
138
|
actual == expected
|
139
|
-
when
|
139
|
+
when NodeQuery::AnyValue
|
140
140
|
!actual.nil?
|
141
141
|
else
|
142
|
-
raise
|
142
|
+
raise NodeQuery::MethodNotSupported, "#{expected} is not supported"
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
data/lib/node_query/version.rb
CHANGED
data/lib/node_query.rb
CHANGED
@@ -7,11 +7,14 @@ require_relative "./node_query_lexer.rex"
|
|
7
7
|
require_relative "./node_query_parser.racc"
|
8
8
|
|
9
9
|
class NodeQuery
|
10
|
+
class MethodNotSupported < StandardError; end
|
11
|
+
|
10
12
|
autoload :Adapter, "node_query/adapter"
|
11
13
|
autoload :ParserAdapter, "node_query/parser_adapter"
|
12
14
|
autoload :Compiler, "node_query/compiler"
|
13
15
|
autoload :Helper, "node_query/helper"
|
14
16
|
autoload :NodeRules, "node_query/node_rules"
|
17
|
+
autoload :AnyValue, 'node_query/any_value'
|
15
18
|
|
16
19
|
# Configure NodeQuery
|
17
20
|
# @param [Hash] options options to configure
|
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.
|
4
|
+
version: 1.10.0
|
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-10-
|
11
|
+
date: 2022-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- Rakefile
|
41
41
|
- lib/node_query.rb
|
42
42
|
- lib/node_query/adapter.rb
|
43
|
+
- lib/node_query/any_value.rb
|
43
44
|
- lib/node_query/compiler.rb
|
44
45
|
- lib/node_query/compiler/array_value.rb
|
45
46
|
- lib/node_query/compiler/attribute.rb
|