node_query 1.10.0 → 1.12.0

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: cc14f10f4a27631913cd6d9b3b66b100864778756bc317b1529abe45999255b4
4
- data.tar.gz: 2e04f47d2bbc0eade7ea2a047fe27174ec0e343d875203a0d3cd39fcaea50120
3
+ metadata.gz: e489f2422c8b9f55da98a88393f23d1526759989feb8f34b9b1c822d6770250c
4
+ data.tar.gz: 99c6229810c7ffc28be0c29903a1719f4b07cb78a801028f5c7c44e0db97358d
5
5
  SHA512:
6
- metadata.gz: 4b434f39629e544435594f4d299b845841b4610bed644954b0e835a7eed7d1b178d510d2ba5be8bfea0d3365d15f46d73a64ea8e9310037f4a851fa9989d05f3
7
- data.tar.gz: bee545aae91e3769cb616e156f4cf6a69f628f5cc3a9e25432ea7eb9224a8ea49f1f76518b09601ce692b52790e5f0fd5da518d55650a243c0478d9056ac9a53
6
+ metadata.gz: b34877880a1058c6895c7a23bd6fb66a3e0b326a924878240a7ac49054ad0c39a37085405c4163fd9a92483929d8cff096a6b97b3a1b875093e1a151c3ad64d9
7
+ data.tar.gz: 1ddfb1d645b1636f20f85a207324783cf48207109d88b2e0bf9a60c65d84b47a432152207b63df3ed33996ec3982352e376ed6f81c1018eb8b2c19ef472ab393
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.12.0 (2023-01-16)
4
+
5
+ * Drop `activesupport`
6
+ * Remove `NodeQuery::AnyValue`
7
+
8
+ ## 1.11.0 (2022-12-09)
9
+
10
+ * Support negative index to fetch array element
11
+ * Parse negative integer and float
12
+
3
13
  ## 1.10.0 (2022-10-26)
4
14
 
5
15
  * Add `NodeQuery::MethodNotSupported` error
data/Gemfile.lock CHANGED
@@ -1,21 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- node_query (1.10.0)
5
- activesupport (< 7.0.0)
4
+ node_query (1.12.0)
6
5
 
7
6
  GEM
8
7
  remote: https://rubygems.org/
9
8
  specs:
10
- activesupport (6.1.7)
11
- concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 1.6, < 2)
13
- minitest (>= 5.1)
14
- tzinfo (~> 2.0)
15
- zeitwerk (~> 2.3)
16
9
  ast (2.4.2)
17
10
  coderay (1.1.3)
18
- concurrent-ruby (1.1.10)
19
11
  diff-lcs (1.5.0)
20
12
  ffi (1.15.5)
21
13
  formatador (1.1.0)
@@ -36,14 +28,11 @@ GEM
36
28
  guard (~> 2.1)
37
29
  guard-compat (~> 1.1)
38
30
  rspec (>= 2.99.0, < 4.0)
39
- i18n (1.12.0)
40
- concurrent-ruby (~> 1.0)
41
31
  listen (3.7.1)
42
32
  rb-fsevent (~> 0.10, >= 0.10.3)
43
33
  rb-inotify (~> 0.9, >= 0.9.10)
44
34
  lumberjack (1.2.8)
45
35
  method_source (1.0.0)
46
- minitest (5.16.3)
47
36
  nenv (0.3.0)
48
37
  notiffany (0.1.3)
49
38
  nenv (~> 0.1)
@@ -76,12 +65,10 @@ GEM
76
65
  rspec-support (3.11.0)
77
66
  shellany (0.0.1)
78
67
  thor (1.2.1)
79
- tzinfo (2.0.5)
80
- concurrent-ruby (~> 1.0)
81
- zeitwerk (2.6.1)
82
68
 
83
69
  PLATFORMS
84
70
  x86_64-darwin-21
71
+ x86_64-darwin-22
85
72
  x86_64-linux
86
73
 
87
74
  DEPENDENCIES
@@ -136,8 +136,6 @@ class NodeQuery::NodeRules
136
136
  :false == actual.type
137
137
  when Parser::AST::Node
138
138
  actual == expected
139
- when NodeQuery::AnyValue
140
- !actual.nil?
141
139
  else
142
140
  raise NodeQuery::MethodNotSupported, "#{expected} is not supported"
143
141
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class NodeQuery
4
- VERSION = "1.10.0"
4
+ VERSION = "1.12.0"
5
5
  end
data/lib/node_query.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/core_ext/array'
4
-
5
3
  require_relative "node_query/version"
6
4
  require_relative "./node_query_lexer.rex"
7
5
  require_relative "./node_query_parser.racc"
@@ -14,7 +12,6 @@ class NodeQuery
14
12
  autoload :Compiler, "node_query/compiler"
15
13
  autoload :Helper, "node_query/helper"
16
14
  autoload :NodeRules, "node_query/node_rules"
17
- autoload :AnyValue, 'node_query/any_value'
18
15
 
19
16
  # Configure NodeQuery
20
17
  # @param [Hash] options options to configure
@@ -8,11 +8,11 @@ macros
8
8
  OPEN_SELECTOR /\(/
9
9
  CLOSE_SELECTOR /\)/
10
10
  NODE_TYPE /\.[a-z]+/
11
- IDENTIFIER /[@\*\.\w]*\w/
11
+ IDENTIFIER /[@\*\-\.\w]*\w/
12
12
  IDENTIFIER_VALUE /[@\.\w!&:\?<>=]+/
13
13
  FALSE /false/
14
- FLOAT /\d+\.\d+/
15
- INTEGER /\d+/
14
+ FLOAT /\-?\d+\.\d+/
15
+ INTEGER /\-?\d+/
16
16
  NIL /nil/
17
17
  REGEXP_BODY /(?:[^\/]|\\\/)*/
18
18
  REGEXP /\/(#{REGEXP_BODY})(?<!\\)\/([imxo]*)/
@@ -21,11 +21,11 @@ class NodeQueryLexer
21
21
  OPEN_SELECTOR = /\(/
22
22
  CLOSE_SELECTOR = /\)/
23
23
  NODE_TYPE = /\.[a-z]+/
24
- IDENTIFIER = /[@\*\.\w]*\w/
24
+ IDENTIFIER = /[@\*\-\.\w]*\w/
25
25
  IDENTIFIER_VALUE = /[@\.\w!&:\?<>=]+/
26
26
  FALSE = /false/
27
- FLOAT = /\d+\.\d+/
28
- INTEGER = /\d+/
27
+ FLOAT = /\-?\d+\.\d+/
28
+ INTEGER = /\-?\d+/
29
29
  NIL = /nil/
30
30
  REGEXP_BODY = /(?:[^\/]|\\\/)*/
31
31
  REGEXP = /\/(#{REGEXP_BODY})(?<!\\)\/([imxo]*)/
data/node_query.gemspec CHANGED
@@ -28,9 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- # Uncomment to register a new dependency of your gem
32
- spec.add_dependency "activesupport", "< 7.0.0"
33
-
34
31
  # For more information and examples about making a new gem, check out our
35
32
  # guide at: https://bundler.io/guides/creating_gem.html
36
33
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: node_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.12.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-26 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "<"
18
- - !ruby/object:Gem::Version
19
- version: 7.0.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "<"
25
- - !ruby/object:Gem::Version
26
- version: 7.0.0
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description: ast node query language
28
14
  email:
29
15
  - flyerhzm@gmail.com
@@ -40,7 +26,6 @@ files:
40
26
  - Rakefile
41
27
  - lib/node_query.rb
42
28
  - lib/node_query/adapter.rb
43
- - lib/node_query/any_value.rb
44
29
  - lib/node_query/compiler.rb
45
30
  - lib/node_query/compiler/array_value.rb
46
31
  - lib/node_query/compiler/attribute.rb
@@ -92,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
77
  - !ruby/object:Gem::Version
93
78
  version: '0'
94
79
  requirements: []
95
- rubygems_version: 3.3.22
80
+ rubygems_version: 3.4.1
96
81
  signing_key:
97
82
  specification_version: 4
98
83
  summary: ast node query language
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # A new type to match any value.
4
- class NodeQuery::AnyValue
5
- end