query-ruby 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.node-version +1 -1
- data/.npm-version +1 -1
- data/.rubocop.yml +23 -1
- data/.ruby-version +1 -1
- data/.tool-versions +2 -3
- data/Gemfile +1 -1
- data/Gemfile.lock +95 -91
- data/VERSION +1 -1
- data/bin/bundle +123 -0
- data/bin/bundle-audit +31 -0
- data/bin/bundler-audit +31 -0
- data/bin/dorian +31 -0
- data/bin/rubocop +31 -0
- data/bin/test +3 -0
- data/lib/query/decompiler.rb +5 -4
- data/lib/query/node/base_10.rb +4 -3
- data/lib/query/node/boolean.rb +2 -2
- data/lib/query/node/decimal.rb +4 -4
- data/lib/query/node/key.rb +1 -1
- data/lib/query/node/number.rb +12 -11
- data/lib/query/node/operator.rb +9 -3
- data/lib/query/node/query.rb +2 -2
- data/lib/query/node/string.rb +1 -1
- data/lib/query/parser/operator.rb +3 -3
- data/package-lock.json +4 -4
- data/package.json +3 -3
- data/query-ruby.gemspec +1 -1
- data/spec/query_spec.rb +8 -4
- data/spec/spec_helper.rb +2 -0
- metadata +10 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 01ad565c4d0fe0e875800e7ace9a057ffb8d38150ebed97ee5d9d140cae5b5fd
|
|
4
|
+
data.tar.gz: 1c8ed5753010140eaefc64bf73f986a4a19ff7f587f36447fbb3bf350d753d75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e7d5f71e4a0d395e9db6f5df2e91b29fced678cb144541c384e9f6ac459c85d0bdc23b478a17c4fd83d9e4e056e8880b0fc28a8f9850923e42caf0d3f5d7f16
|
|
7
|
+
data.tar.gz: 256a1aab67f9bb5a40d5ac5cd50004dbd2880cbb9b279f235acde7fac8f159fbd98887783391939a994745b980793702ec2cb83751bd3815b4e61c1e9c2c78b9
|
data/.node-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
26.3.1
|
data/.npm-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
11.
|
|
1
|
+
11.17.0
|
data/.rubocop.yml
CHANGED
|
@@ -5,15 +5,21 @@ AllCops:
|
|
|
5
5
|
- "**/vendor/**/*"
|
|
6
6
|
- "**/db/schema.rb"
|
|
7
7
|
NewCops: enable
|
|
8
|
-
TargetRubyVersion:
|
|
8
|
+
TargetRubyVersion: 4.0
|
|
9
9
|
Layout/ClosingHeredocIndentation:
|
|
10
10
|
Enabled: false
|
|
11
|
+
Layout/ElseAlignment:
|
|
12
|
+
Enabled: false
|
|
13
|
+
Layout/EndAlignment:
|
|
14
|
+
Enabled: false
|
|
11
15
|
Layout/FirstArgumentIndentation:
|
|
12
16
|
Enabled: false
|
|
13
17
|
Layout/HashAlignment:
|
|
14
18
|
Enabled: false
|
|
15
19
|
Layout/HeredocIndentation:
|
|
16
20
|
Enabled: false
|
|
21
|
+
Layout/IndentationWidth:
|
|
22
|
+
Enabled: false
|
|
17
23
|
Layout/LineEndStringConcatenationIndentation:
|
|
18
24
|
Enabled: false
|
|
19
25
|
Layout/LineLength:
|
|
@@ -22,14 +28,20 @@ Layout/MultilineMethodCallIndentation:
|
|
|
22
28
|
Enabled: false
|
|
23
29
|
Layout/MultilineOperationIndentation:
|
|
24
30
|
Enabled: false
|
|
31
|
+
Layout/SpaceAroundKeyword:
|
|
32
|
+
Enabled: false
|
|
25
33
|
Layout/SpaceInsideHashLiteralBraces:
|
|
26
34
|
Enabled: false
|
|
35
|
+
Lint/ConstantDefinitionInBlock:
|
|
36
|
+
Enabled: false
|
|
27
37
|
Lint/EmptyClass:
|
|
28
38
|
Enabled: false
|
|
29
39
|
Lint/MissingSuper:
|
|
30
40
|
Enabled: false
|
|
31
41
|
Lint/PercentStringArray:
|
|
32
42
|
Enabled: false
|
|
43
|
+
Lint/SafeNavigationChain:
|
|
44
|
+
Enabled: false
|
|
33
45
|
Lint/ShadowingOuterLocalVariable:
|
|
34
46
|
Enabled: false
|
|
35
47
|
Lint/SuppressedException:
|
|
@@ -44,6 +56,8 @@ Metrics/BlockLength:
|
|
|
44
56
|
Enabled: false
|
|
45
57
|
Metrics/ClassLength:
|
|
46
58
|
Enabled: false
|
|
59
|
+
Metrics/CollectionLiteralLength:
|
|
60
|
+
Enabled: false
|
|
47
61
|
Metrics/CyclomaticComplexity:
|
|
48
62
|
Enabled: false
|
|
49
63
|
Metrics/MethodLength:
|
|
@@ -58,6 +72,8 @@ Naming/FileName:
|
|
|
58
72
|
Enabled: false
|
|
59
73
|
Naming/MethodParameterName:
|
|
60
74
|
Enabled: false
|
|
75
|
+
Naming/PredicateMethod:
|
|
76
|
+
Enabled: false
|
|
61
77
|
Naming/VariableNumber:
|
|
62
78
|
Enabled: false
|
|
63
79
|
Performance/Sum:
|
|
@@ -80,6 +96,8 @@ RSpec/NoExpectationExample:
|
|
|
80
96
|
Enabled: false
|
|
81
97
|
RSpec/PendingWithoutReason:
|
|
82
98
|
Enabled: false
|
|
99
|
+
Rails/BulkChangeTable:
|
|
100
|
+
Enabled: false
|
|
83
101
|
Rails/Delegate:
|
|
84
102
|
Enabled: false
|
|
85
103
|
Rails/DynamicFindBy:
|
|
@@ -94,6 +112,8 @@ Rails/Presence:
|
|
|
94
112
|
Enabled: false
|
|
95
113
|
Rails/Present:
|
|
96
114
|
Enabled: false
|
|
115
|
+
Rails/SkipsModelValidations:
|
|
116
|
+
Enabled: false
|
|
97
117
|
Rails/ThreeStateBooleanColumn:
|
|
98
118
|
Enabled: false
|
|
99
119
|
Rails/TimeZone:
|
|
@@ -110,6 +130,8 @@ Style/EmptyMethod:
|
|
|
110
130
|
Enabled: false
|
|
111
131
|
Style/IfUnlessModifier:
|
|
112
132
|
Enabled: false
|
|
133
|
+
Style/Lambda:
|
|
134
|
+
Enabled: false
|
|
113
135
|
Style/MultilineBlockChain:
|
|
114
136
|
Enabled: false
|
|
115
137
|
Style/NestedTernaryOperator:
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.5
|
data/.tool-versions
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
ruby
|
|
2
|
-
|
|
3
|
-
nodejs 23.11.0
|
|
1
|
+
ruby 4.0.5
|
|
2
|
+
nodejs 26.3.1
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
query-ruby (
|
|
4
|
+
query-ruby (2.0.0)
|
|
5
5
|
activesupport
|
|
6
6
|
bigdecimal
|
|
7
7
|
dorian-arguments
|
|
@@ -12,37 +12,36 @@ PATH
|
|
|
12
12
|
GEM
|
|
13
13
|
remote: https://rubygems.org/
|
|
14
14
|
specs:
|
|
15
|
-
activesupport (8.
|
|
15
|
+
activesupport (8.1.3)
|
|
16
16
|
base64
|
|
17
|
-
benchmark (>= 0.3)
|
|
18
17
|
bigdecimal
|
|
19
18
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
20
19
|
connection_pool (>= 2.2.5)
|
|
21
20
|
drb
|
|
22
21
|
i18n (>= 1.6, < 2)
|
|
22
|
+
json
|
|
23
23
|
logger (>= 1.4.2)
|
|
24
24
|
minitest (>= 5.1)
|
|
25
25
|
securerandom (>= 0.3)
|
|
26
26
|
tzinfo (~> 2.0, >= 2.0.5)
|
|
27
27
|
uri (>= 0.13.1)
|
|
28
|
-
addressable (2.
|
|
29
|
-
public_suffix (>= 2.0.2, <
|
|
28
|
+
addressable (2.9.0)
|
|
29
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
30
30
|
ast (2.4.3)
|
|
31
|
-
base64 (0.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
bundler (>= 1.2.0, < 3)
|
|
31
|
+
base64 (0.3.0)
|
|
32
|
+
bigdecimal (4.1.2)
|
|
33
|
+
bundler-audit (0.9.3)
|
|
34
|
+
bundler (>= 1.2.0)
|
|
36
35
|
thor (~> 1.0)
|
|
37
36
|
cmdparse (3.0.7)
|
|
38
|
-
concurrent-ruby (1.3.
|
|
39
|
-
connection_pool (
|
|
40
|
-
crack (1.0.
|
|
37
|
+
concurrent-ruby (1.3.7)
|
|
38
|
+
connection_pool (3.0.2)
|
|
39
|
+
crack (1.0.1)
|
|
41
40
|
bigdecimal
|
|
42
41
|
rexml
|
|
43
|
-
csv (3.3.
|
|
44
|
-
diff-lcs (1.6.
|
|
45
|
-
dorian (2.6.
|
|
42
|
+
csv (3.3.5)
|
|
43
|
+
diff-lcs (1.6.2)
|
|
44
|
+
dorian (2.6.8)
|
|
46
45
|
csv
|
|
47
46
|
dorian-arguments
|
|
48
47
|
dorian-eval
|
|
@@ -60,137 +59,141 @@ GEM
|
|
|
60
59
|
terminal-table
|
|
61
60
|
w_syntax_tree-erb
|
|
62
61
|
yaml
|
|
63
|
-
dorian-arguments (1.2.
|
|
64
|
-
bigdecimal
|
|
65
|
-
dorian-eval (1.5.
|
|
66
|
-
yaml
|
|
67
|
-
dorian-progress (1.1.
|
|
68
|
-
ruby-progressbar
|
|
69
|
-
dorian-to_struct (2.0.
|
|
70
|
-
drb (2.2.
|
|
62
|
+
dorian-arguments (1.2.3)
|
|
63
|
+
bigdecimal (>= 3.1, < 5)
|
|
64
|
+
dorian-eval (1.5.1)
|
|
65
|
+
yaml (>= 0.3, < 1)
|
|
66
|
+
dorian-progress (1.1.3)
|
|
67
|
+
ruby-progressbar (>= 1.13, < 2)
|
|
68
|
+
dorian-to_struct (2.0.3)
|
|
69
|
+
drb (2.2.3)
|
|
71
70
|
geom2d (0.4.1)
|
|
72
|
-
git (3.
|
|
71
|
+
git (4.3.2)
|
|
73
72
|
activesupport (>= 5.0)
|
|
74
73
|
addressable (~> 2.8)
|
|
75
|
-
process_executer (~>
|
|
74
|
+
process_executer (~> 4.0)
|
|
76
75
|
rchardet (~> 1.9)
|
|
77
|
-
haml (
|
|
76
|
+
haml (7.2.0)
|
|
78
77
|
temple (>= 0.8.2)
|
|
79
78
|
thor
|
|
80
79
|
tilt
|
|
81
|
-
hashdiff (1.1
|
|
82
|
-
hexapdf (1.
|
|
80
|
+
hashdiff (1.2.1)
|
|
81
|
+
hexapdf (1.9.1)
|
|
83
82
|
cmdparse (~> 3.0, >= 3.0.3)
|
|
84
83
|
geom2d (~> 0.4, >= 0.4.1)
|
|
85
84
|
openssl (>= 2.2.1)
|
|
86
85
|
strscan (>= 3.1.2)
|
|
87
|
-
i18n (1.
|
|
86
|
+
i18n (1.15.2)
|
|
88
87
|
concurrent-ruby (~> 1.0)
|
|
89
|
-
json (2.
|
|
88
|
+
json (2.20.0)
|
|
90
89
|
language-ruby (1.2.0)
|
|
91
90
|
dorian-arguments
|
|
92
91
|
zeitwerk
|
|
93
|
-
language_server-protocol (3.17.0.
|
|
94
|
-
libv8-node (
|
|
95
|
-
libv8-node (
|
|
96
|
-
libv8-node (
|
|
92
|
+
language_server-protocol (3.17.0.5)
|
|
93
|
+
libv8-node (24.12.0.1)
|
|
94
|
+
libv8-node (24.12.0.1-arm64-darwin)
|
|
95
|
+
libv8-node (24.12.0.1-x86_64-linux)
|
|
97
96
|
lint_roller (1.1.0)
|
|
98
97
|
logger (1.7.0)
|
|
99
|
-
mini_racer (0.
|
|
100
|
-
libv8-node (~>
|
|
101
|
-
minitest (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
mini_racer (0.21.4)
|
|
99
|
+
libv8-node (~> 24.12.0.1)
|
|
100
|
+
minitest (6.0.6)
|
|
101
|
+
drb (~> 2.0)
|
|
102
|
+
prism (~> 1.5)
|
|
103
|
+
mustermann (3.1.1)
|
|
104
|
+
openssl (4.0.2)
|
|
105
|
+
ostruct (0.6.3)
|
|
106
|
+
parallel (2.1.0)
|
|
107
|
+
parser (3.3.11.1)
|
|
108
108
|
ast (~> 2.4.1)
|
|
109
109
|
racc
|
|
110
110
|
prettier_print (1.2.1)
|
|
111
|
-
prism (1.
|
|
112
|
-
process_executer (
|
|
113
|
-
|
|
111
|
+
prism (1.9.0)
|
|
112
|
+
process_executer (4.0.4)
|
|
113
|
+
track_open_instances (~> 0.1)
|
|
114
|
+
public_suffix (7.0.5)
|
|
114
115
|
racc (1.8.1)
|
|
115
|
-
rack (3.
|
|
116
|
-
rack-protection (4.
|
|
116
|
+
rack (3.2.6)
|
|
117
|
+
rack-protection (4.2.1)
|
|
117
118
|
base64 (>= 0.1.0)
|
|
118
119
|
logger (>= 1.6.0)
|
|
119
120
|
rack (>= 3.0.0, < 4)
|
|
120
|
-
rack-session (2.1.
|
|
121
|
+
rack-session (2.1.2)
|
|
121
122
|
base64 (>= 0.1.0)
|
|
122
123
|
rack (>= 3.0.0)
|
|
123
124
|
rainbow (3.1.1)
|
|
124
|
-
rake (13.2
|
|
125
|
-
rchardet (1.
|
|
126
|
-
regexp_parser (2.
|
|
127
|
-
rexml (3.4.
|
|
128
|
-
rspec (3.13.
|
|
125
|
+
rake (13.4.2)
|
|
126
|
+
rchardet (1.10.2)
|
|
127
|
+
regexp_parser (2.12.0)
|
|
128
|
+
rexml (3.4.4)
|
|
129
|
+
rspec (3.13.2)
|
|
129
130
|
rspec-core (~> 3.13.0)
|
|
130
131
|
rspec-expectations (~> 3.13.0)
|
|
131
132
|
rspec-mocks (~> 3.13.0)
|
|
132
|
-
rspec-core (3.13.
|
|
133
|
+
rspec-core (3.13.6)
|
|
133
134
|
rspec-support (~> 3.13.0)
|
|
134
|
-
rspec-expectations (3.13.
|
|
135
|
+
rspec-expectations (3.13.5)
|
|
135
136
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
136
137
|
rspec-support (~> 3.13.0)
|
|
137
|
-
rspec-mocks (3.13.
|
|
138
|
+
rspec-mocks (3.13.8)
|
|
138
139
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
139
140
|
rspec-support (~> 3.13.0)
|
|
140
|
-
rspec-support (3.13.
|
|
141
|
-
rubocop (1.
|
|
141
|
+
rspec-support (3.13.7)
|
|
142
|
+
rubocop (1.88.0)
|
|
142
143
|
json (~> 2.3)
|
|
143
144
|
language_server-protocol (~> 3.17.0.2)
|
|
144
145
|
lint_roller (~> 1.1.0)
|
|
145
|
-
parallel (
|
|
146
|
+
parallel (>= 1.10)
|
|
146
147
|
parser (>= 3.3.0.2)
|
|
147
148
|
rainbow (>= 2.2.2, < 4.0)
|
|
148
149
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
149
|
-
rubocop-ast (>= 1.
|
|
150
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
150
151
|
ruby-progressbar (~> 1.7)
|
|
151
152
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
152
|
-
rubocop-ast (1.
|
|
153
|
+
rubocop-ast (1.49.1)
|
|
153
154
|
parser (>= 3.3.7.2)
|
|
154
|
-
prism (~> 1.
|
|
155
|
-
rubocop-capybara (
|
|
155
|
+
prism (~> 1.7)
|
|
156
|
+
rubocop-capybara (3.0.0)
|
|
156
157
|
lint_roller (~> 1.1)
|
|
157
|
-
rubocop (~> 1.
|
|
158
|
-
rubocop-factory_bot (2.
|
|
158
|
+
rubocop (~> 1.81)
|
|
159
|
+
rubocop-factory_bot (2.28.0)
|
|
159
160
|
lint_roller (~> 1.1)
|
|
160
161
|
rubocop (~> 1.72, >= 1.72.1)
|
|
161
|
-
rubocop-performance (1.
|
|
162
|
+
rubocop-performance (1.26.1)
|
|
162
163
|
lint_roller (~> 1.1)
|
|
163
164
|
rubocop (>= 1.75.0, < 2.0)
|
|
164
|
-
rubocop-ast (>= 1.
|
|
165
|
-
rubocop-rails (2.
|
|
165
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
166
|
+
rubocop-rails (2.35.5)
|
|
166
167
|
activesupport (>= 4.2.0)
|
|
167
168
|
lint_roller (~> 1.1)
|
|
168
169
|
rack (>= 1.1)
|
|
169
170
|
rubocop (>= 1.75.0, < 2.0)
|
|
170
|
-
rubocop-ast (>= 1.
|
|
171
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
171
172
|
rubocop-rake (0.7.1)
|
|
172
173
|
lint_roller (~> 1.1)
|
|
173
174
|
rubocop (>= 1.72.1)
|
|
174
|
-
rubocop-rspec (3.
|
|
175
|
+
rubocop-rspec (3.10.2)
|
|
175
176
|
lint_roller (~> 1.1)
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
regexp_parser (>= 2.0)
|
|
178
|
+
rubocop (~> 1.86, >= 1.86.2)
|
|
179
|
+
rubocop-rspec_rails (2.32.0)
|
|
178
180
|
lint_roller (~> 1.1)
|
|
179
181
|
rubocop (~> 1.72, >= 1.72.1)
|
|
180
182
|
rubocop-rspec (~> 3.5)
|
|
181
|
-
ruby-prof (
|
|
183
|
+
ruby-prof (2.0.5)
|
|
184
|
+
base64
|
|
185
|
+
ostruct
|
|
182
186
|
ruby-progressbar (1.13.0)
|
|
183
|
-
ruby2_keywords (0.0.5)
|
|
184
187
|
securerandom (0.4.1)
|
|
185
|
-
sinatra (4.
|
|
188
|
+
sinatra (4.2.1)
|
|
186
189
|
logger (>= 1.6.0)
|
|
187
190
|
mustermann (~> 3.0)
|
|
188
191
|
rack (>= 3.0.0, < 4)
|
|
189
|
-
rack-protection (= 4.
|
|
192
|
+
rack-protection (= 4.2.1)
|
|
190
193
|
rack-session (>= 2.0.0, < 3)
|
|
191
194
|
tilt (~> 2.0)
|
|
192
|
-
strscan (3.1.
|
|
193
|
-
syntax_tree (6.
|
|
195
|
+
strscan (3.1.8)
|
|
196
|
+
syntax_tree (6.3.0)
|
|
194
197
|
prettier_print (>= 1.2.0)
|
|
195
198
|
syntax_tree-haml (4.0.3)
|
|
196
199
|
haml (>= 5.2)
|
|
@@ -199,26 +202,27 @@ GEM
|
|
|
199
202
|
syntax_tree-xml (0.1.0)
|
|
200
203
|
prettier_print
|
|
201
204
|
syntax_tree (>= 2.0.1)
|
|
202
|
-
temple (0.10.
|
|
205
|
+
temple (0.10.4)
|
|
203
206
|
terminal-table (4.0.0)
|
|
204
207
|
unicode-display_width (>= 1.1.1, < 4)
|
|
205
|
-
thor (1.
|
|
206
|
-
tilt (2.
|
|
208
|
+
thor (1.5.0)
|
|
209
|
+
tilt (2.7.0)
|
|
210
|
+
track_open_instances (0.1.15)
|
|
207
211
|
tzinfo (2.0.6)
|
|
208
212
|
concurrent-ruby (~> 1.0)
|
|
209
|
-
unicode-display_width (3.
|
|
210
|
-
unicode-emoji (~> 4.
|
|
211
|
-
unicode-emoji (4.0
|
|
212
|
-
uri (1.
|
|
213
|
+
unicode-display_width (3.2.0)
|
|
214
|
+
unicode-emoji (~> 4.1)
|
|
215
|
+
unicode-emoji (4.2.0)
|
|
216
|
+
uri (1.1.1)
|
|
213
217
|
w_syntax_tree-erb (0.12.0)
|
|
214
218
|
prettier_print (~> 1.2, >= 1.2.0)
|
|
215
219
|
syntax_tree (~> 6.1, >= 6.1.1)
|
|
216
|
-
webmock (3.
|
|
220
|
+
webmock (3.26.2)
|
|
217
221
|
addressable (>= 2.8.0)
|
|
218
222
|
crack (>= 0.3.2)
|
|
219
223
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
220
224
|
yaml (0.4.0)
|
|
221
|
-
zeitwerk (2.
|
|
225
|
+
zeitwerk (2.8.2)
|
|
222
226
|
|
|
223
227
|
PLATFORMS
|
|
224
228
|
arm64-darwin-23
|
|
@@ -243,7 +247,7 @@ DEPENDENCIES
|
|
|
243
247
|
webmock
|
|
244
248
|
|
|
245
249
|
RUBY VERSION
|
|
246
|
-
|
|
250
|
+
ruby 4.0.5
|
|
247
251
|
|
|
248
252
|
BUNDLED WITH
|
|
249
|
-
|
|
253
|
+
4.0.15
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2.0.0
|
data/bin/bundle
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'bundle' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "rubygems"
|
|
12
|
+
|
|
13
|
+
m =
|
|
14
|
+
Module.new do
|
|
15
|
+
module_function
|
|
16
|
+
|
|
17
|
+
def invoked_as_script?
|
|
18
|
+
File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def env_var_version
|
|
22
|
+
ENV.fetch("BUNDLER_VERSION", nil)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def cli_arg_version
|
|
26
|
+
return unless invoked_as_script? # don't want to hijack other binstubs
|
|
27
|
+
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
|
|
28
|
+
|
|
29
|
+
bundler_version = nil
|
|
30
|
+
update_index = nil
|
|
31
|
+
ARGV.each_with_index do |a, i|
|
|
32
|
+
if update_index && update_index.succ == i &&
|
|
33
|
+
a.match?(Gem::Version::ANCHORED_VERSION_PATTERN)
|
|
34
|
+
bundler_version = a
|
|
35
|
+
end
|
|
36
|
+
unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o
|
|
37
|
+
next
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
bundler_version = Regexp.last_match(1)
|
|
41
|
+
update_index = i
|
|
42
|
+
end
|
|
43
|
+
bundler_version
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def gemfile
|
|
47
|
+
gemfile = ENV.fetch("BUNDLE_GEMFILE", nil)
|
|
48
|
+
return gemfile if gemfile && !gemfile.empty?
|
|
49
|
+
|
|
50
|
+
File.expand_path("../Gemfile", __dir__)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def lockfile
|
|
54
|
+
lockfile =
|
|
55
|
+
case File.basename(gemfile)
|
|
56
|
+
when "gems.rb"
|
|
57
|
+
gemfile.sub(/\.rb$/, ".locked")
|
|
58
|
+
else
|
|
59
|
+
"#{gemfile}.lock"
|
|
60
|
+
end
|
|
61
|
+
File.expand_path(lockfile)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def lockfile_version
|
|
65
|
+
return unless File.file?(lockfile)
|
|
66
|
+
|
|
67
|
+
lockfile_contents = File.read(lockfile)
|
|
68
|
+
unless lockfile_contents =~
|
|
69
|
+
/\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o
|
|
70
|
+
return
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
Regexp.last_match(1)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def bundler_requirement
|
|
77
|
+
@bundler_requirement ||=
|
|
78
|
+
env_var_version || cli_arg_version ||
|
|
79
|
+
bundler_requirement_for(lockfile_version)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def bundler_requirement_for(version)
|
|
83
|
+
return "#{Gem::Requirement.default}.a" unless version
|
|
84
|
+
|
|
85
|
+
bundler_gem_version = Gem::Version.new(version)
|
|
86
|
+
|
|
87
|
+
bundler_gem_version.approximate_recommendation
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def load_bundler!
|
|
91
|
+
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
|
92
|
+
|
|
93
|
+
activate_bundler
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def activate_bundler
|
|
97
|
+
gem_error =
|
|
98
|
+
activation_error_handling { gem "bundler", bundler_requirement }
|
|
99
|
+
return if gem_error.nil?
|
|
100
|
+
|
|
101
|
+
require_error = activation_error_handling { require "bundler/version" }
|
|
102
|
+
if require_error.nil? &&
|
|
103
|
+
Gem::Requirement.new(bundler_requirement).satisfied_by?(
|
|
104
|
+
Gem::Version.new(Bundler::VERSION)
|
|
105
|
+
)
|
|
106
|
+
return
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
|
|
110
|
+
exit 42
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def activation_error_handling
|
|
114
|
+
yield
|
|
115
|
+
nil
|
|
116
|
+
rescue StandardError, LoadError => e
|
|
117
|
+
e
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
m.load_bundler!
|
|
122
|
+
|
|
123
|
+
load Gem.bin_path("bundler", "bundle") if m.invoked_as_script?
|
data/bin/bundle-audit
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'bundle-audit' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
|
12
|
+
|
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
|
14
|
+
|
|
15
|
+
if File.file?(bundle_binstub)
|
|
16
|
+
if File.read(bundle_binstub, 300).include?(
|
|
17
|
+
"This file was generated by Bundler"
|
|
18
|
+
)
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort(
|
|
22
|
+
"Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
23
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again."
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
require "rubygems"
|
|
29
|
+
require "bundler/setup"
|
|
30
|
+
|
|
31
|
+
load Gem.bin_path("bundler-audit", "bundle-audit")
|
data/bin/bundler-audit
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'bundler-audit' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
|
12
|
+
|
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
|
14
|
+
|
|
15
|
+
if File.file?(bundle_binstub)
|
|
16
|
+
if File.read(bundle_binstub, 300).include?(
|
|
17
|
+
"This file was generated by Bundler"
|
|
18
|
+
)
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort(
|
|
22
|
+
"Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
23
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again."
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
require "rubygems"
|
|
29
|
+
require "bundler/setup"
|
|
30
|
+
|
|
31
|
+
load Gem.bin_path("bundler-audit", "bundler-audit")
|
data/bin/dorian
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'dorian' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
|
12
|
+
|
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
|
14
|
+
|
|
15
|
+
if File.file?(bundle_binstub)
|
|
16
|
+
if File.read(bundle_binstub, 300).include?(
|
|
17
|
+
"This file was generated by Bundler"
|
|
18
|
+
)
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort(
|
|
22
|
+
"Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
23
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again."
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
require "rubygems"
|
|
29
|
+
require "bundler/setup"
|
|
30
|
+
|
|
31
|
+
load Gem.bin_path("dorian", "dorian")
|
data/bin/rubocop
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
|
12
|
+
|
|
13
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
|
14
|
+
|
|
15
|
+
if File.file?(bundle_binstub)
|
|
16
|
+
if File.read(bundle_binstub, 300).include?(
|
|
17
|
+
"This file was generated by Bundler"
|
|
18
|
+
)
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort(
|
|
22
|
+
"Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
23
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again."
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
require "rubygems"
|
|
29
|
+
require "bundler/setup"
|
|
30
|
+
|
|
31
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/bin/test
ADDED
data/lib/query/decompiler.rb
CHANGED
|
@@ -34,13 +34,14 @@ class Query
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def format_value(value)
|
|
37
|
-
|
|
37
|
+
case value
|
|
38
|
+
when Hash
|
|
38
39
|
"#{value[:key]}#{value[:operator]}#{format_value(value[:value])}"
|
|
39
|
-
|
|
40
|
+
when String
|
|
40
41
|
Query.evaluate(value).is_a?(Hash) ? value.inspect : value
|
|
41
|
-
|
|
42
|
+
when BigDecimal
|
|
42
43
|
value.to_s("F")
|
|
43
|
-
|
|
44
|
+
when Range
|
|
44
45
|
left = value.first
|
|
45
46
|
right = value.last
|
|
46
47
|
operator = value.exclude_end? ? "..." : ".."
|
data/lib/query/node/base_10.rb
CHANGED
|
@@ -7,12 +7,13 @@ class Query
|
|
|
7
7
|
|
|
8
8
|
def initialize(parsed)
|
|
9
9
|
self.whole = parsed.delete(:whole)
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
return unless parsed.key?(:exponent)
|
|
11
|
+
|
|
12
|
+
self.exponent = Node::Value.new(parsed.delete(:exponent))
|
|
12
13
|
end
|
|
13
14
|
|
|
14
15
|
def evaluate(**args)
|
|
15
|
-
exponent ? whole.to_i * 10**exponent.evaluate(**args) : whole.to_i
|
|
16
|
+
exponent ? whole.to_i * (10**exponent.evaluate(**args)) : whole.to_i
|
|
16
17
|
end
|
|
17
18
|
end
|
|
18
19
|
end
|
data/lib/query/node/boolean.rb
CHANGED
data/lib/query/node/decimal.rb
CHANGED
|
@@ -8,14 +8,14 @@ class Query
|
|
|
8
8
|
def initialize(parsed)
|
|
9
9
|
self.decimal = parsed.delete(:decimal)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
return unless parsed.key?(:exponent)
|
|
12
|
+
|
|
13
|
+
self.exponent = Value.new(parsed.delete(:exponent))
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def evaluate(**args)
|
|
17
17
|
if exponent
|
|
18
|
-
BigDecimal(decimal) * 10**exponent.evaluate(**args)
|
|
18
|
+
BigDecimal(decimal) * (10**exponent.evaluate(**args))
|
|
19
19
|
else
|
|
20
20
|
BigDecimal(decimal)
|
|
21
21
|
end
|
data/lib/query/node/key.rb
CHANGED
data/lib/query/node/number.rb
CHANGED
|
@@ -6,17 +6,18 @@ class Query
|
|
|
6
6
|
attr_accessor :value
|
|
7
7
|
|
|
8
8
|
def initialize(parsed)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
self.value =
|
|
10
|
+
if parsed.key?(:decimal)
|
|
11
|
+
Decimal.new(parsed.delete(:decimal))
|
|
12
|
+
elsif parsed.key?(:base_16)
|
|
13
|
+
Base16.new(parsed.delete(:base_16))
|
|
14
|
+
elsif parsed.key?(:base_8)
|
|
15
|
+
Base8.new(parsed.delete(:base_8))
|
|
16
|
+
elsif parsed.key?(:base_2)
|
|
17
|
+
Base2.new(parsed.delete(:base_2))
|
|
18
|
+
else
|
|
19
|
+
Base10.new(parsed.delete(:base_10))
|
|
20
|
+
end
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
def evaluate(**args)
|
data/lib/query/node/operator.rb
CHANGED
|
@@ -5,7 +5,13 @@ class Query
|
|
|
5
5
|
class Operator < Node
|
|
6
6
|
attr_accessor :prefix, :suffix
|
|
7
7
|
|
|
8
|
-
PREFIXES = {
|
|
8
|
+
PREFIXES = {
|
|
9
|
+
"+" => "",
|
|
10
|
+
"-" => "!",
|
|
11
|
+
"!" => "!",
|
|
12
|
+
"" => "",
|
|
13
|
+
nil => ""
|
|
14
|
+
}.freeze
|
|
9
15
|
|
|
10
16
|
SUFFIXES = {
|
|
11
17
|
"^" => "^",
|
|
@@ -23,14 +29,14 @@ class Query
|
|
|
23
29
|
"=" => "=",
|
|
24
30
|
"==" => "=",
|
|
25
31
|
"===" => "="
|
|
26
|
-
}
|
|
32
|
+
}.freeze
|
|
27
33
|
|
|
28
34
|
def initialize(parsed)
|
|
29
35
|
self.prefix = parsed.delete(:prefix)
|
|
30
36
|
self.suffix = parsed.delete(:suffix)
|
|
31
37
|
end
|
|
32
38
|
|
|
33
|
-
def evaluate(**
|
|
39
|
+
def evaluate(**_args)
|
|
34
40
|
"#{PREFIXES.fetch(prefix)}#{SUFFIXES.fetch(suffix)}"
|
|
35
41
|
end
|
|
36
42
|
end
|
data/lib/query/node/query.rb
CHANGED
|
@@ -18,14 +18,14 @@ class Query
|
|
|
18
18
|
"&" => "and",
|
|
19
19
|
"" => "and",
|
|
20
20
|
nil => "and"
|
|
21
|
-
}
|
|
21
|
+
}.freeze
|
|
22
22
|
|
|
23
23
|
NEGATIVE_OPERATORS = {
|
|
24
24
|
"not" => "not",
|
|
25
25
|
"Not" => "not",
|
|
26
26
|
"NOT" => "not",
|
|
27
27
|
"!" => "not"
|
|
28
|
-
}
|
|
28
|
+
}.freeze
|
|
29
29
|
|
|
30
30
|
def initialize(parsed)
|
|
31
31
|
self.negative = (parsed.presence || {}).delete(:not)
|
data/lib/query/node/string.rb
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
class Query
|
|
4
4
|
class Parser
|
|
5
5
|
class Operator < Language
|
|
6
|
-
PREFIXES = %w[- + !]
|
|
6
|
+
PREFIXES = %w[- + !].freeze
|
|
7
7
|
|
|
8
|
-
OPERATORS = %w[^ $ >= => <= =< < > !]
|
|
8
|
+
OPERATORS = %w[^ $ >= => <= =< < > !].freeze
|
|
9
9
|
|
|
10
|
-
MODIFIERS = [":::", "::", ":", "===", "==", "=", ""]
|
|
10
|
+
MODIFIERS = [":::", "::", ":", "===", "==", "=", ""].freeze
|
|
11
11
|
|
|
12
12
|
def root
|
|
13
13
|
(
|
data/package-lock.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "query-ruby",
|
|
3
3
|
"lockfileVersion": 3,
|
|
4
4
|
"requires": true,
|
|
5
5
|
"packages": {
|
|
6
6
|
"": {
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": "
|
|
10
|
-
"npm": "11.
|
|
9
|
+
"node": "26.3.1",
|
|
10
|
+
"npm": "11.17.0"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
}
|
|
14
|
+
}
|
data/package.json
CHANGED
data/query-ruby.gemspec
CHANGED
data/spec/query_spec.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require "spec_helper"
|
|
2
4
|
|
|
3
5
|
RSpec.describe Query do
|
|
@@ -64,13 +66,15 @@ RSpec.describe Query do
|
|
|
64
66
|
"(a or b) and (not b ! c)"
|
|
65
67
|
].each do |source|
|
|
66
68
|
it source.inspect do
|
|
67
|
-
|
|
69
|
+
described_class.evaluate(source)
|
|
68
70
|
end
|
|
69
71
|
|
|
70
72
|
it "decompiles #{source.inspect}" do
|
|
71
|
-
expect(
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
expect(
|
|
74
|
+
described_class.evaluate(
|
|
75
|
+
described_class.decompile(described_class.evaluate(source))
|
|
76
|
+
)
|
|
77
|
+
).to eq(described_class.evaluate(source))
|
|
74
78
|
end
|
|
75
79
|
end
|
|
76
80
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: query-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dorian Marié
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activesupport
|
|
@@ -116,7 +116,13 @@ files:
|
|
|
116
116
|
- README.md
|
|
117
117
|
- Rakefile
|
|
118
118
|
- VERSION
|
|
119
|
+
- bin/bundle
|
|
120
|
+
- bin/bundle-audit
|
|
121
|
+
- bin/bundler-audit
|
|
122
|
+
- bin/dorian
|
|
119
123
|
- bin/query
|
|
124
|
+
- bin/rubocop
|
|
125
|
+
- bin/test
|
|
120
126
|
- lib/query-ruby.rb
|
|
121
127
|
- lib/query.rb
|
|
122
128
|
- lib/query/combiner.rb
|
|
@@ -171,14 +177,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
171
177
|
requirements:
|
|
172
178
|
- - ">="
|
|
173
179
|
- !ruby/object:Gem::Version
|
|
174
|
-
version: '
|
|
180
|
+
version: '4.0'
|
|
175
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
182
|
requirements:
|
|
177
183
|
- - ">="
|
|
178
184
|
- !ruby/object:Gem::Version
|
|
179
185
|
version: '0'
|
|
180
186
|
requirements: []
|
|
181
|
-
rubygems_version:
|
|
187
|
+
rubygems_version: 4.0.15
|
|
182
188
|
specification_version: 4
|
|
183
189
|
summary: a querying language for the internet
|
|
184
190
|
test_files: []
|