query-ruby 1.1.2 → 2.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a4c360a47c455070ebc6ed50b705f45cf06571a3df4acada5e601b618ba67ee
4
- data.tar.gz: 90ef16ebe9df12554cc35bcde36393a5e29a180b35925c7079b1e7d3a8f87616
3
+ metadata.gz: bff24f070a4efb436aa4397069ce71e1254eac4e6ab57400e5ad7e62c24c6f76
4
+ data.tar.gz: 872efcaf7f0825b0a0b83c1488b648e6f4518dfbf3850e1c5f4bfd65a48b177c
5
5
  SHA512:
6
- metadata.gz: 0fcd14e61df2ee9533a200562bdeea42f235f669d1fcb136bac5e28eb6a2e91200fac0c9eae221b8cc4143d1915622655dcdbc27c25f33ff6d54de85df14e832
7
- data.tar.gz: a5048741c52e09d170eab98da151c4b1ef9c9dbb4cfc1ce459d12e1d7f95eda994d6e28a10135667d582b5333ea05ebdce3b723bee28a332cf5543a2b336d0d0
6
+ metadata.gz: e65630c378da3bf05c3e5b85dafe789aa897818997d3caf4db03c68a8642d79f2cf172b22037acdf485cd58aee69489b89968ca378df9c05de8dd67cbad2536a
7
+ data.tar.gz: 56f3758ab69d44590c6753b32eaf2028916042f6a17eb8a3c9252cfdcb85ea1cc9fda88db8feb054d820dfc049256e1637d1c65182e5ef94a1c597be73912f1b
data/.node-version CHANGED
@@ -1 +1 @@
1
- 23.11.0
1
+ 26.3.1
data/.npm-version CHANGED
@@ -1 +1 @@
1
- 11.2.0
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: 3.0
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:
@@ -121,7 +143,6 @@ Style/StringLiterals:
121
143
  Style/StringLiteralsInInterpolation:
122
144
  Enabled: false
123
145
  plugins:
124
- - rubocop-factory_bot
125
146
  - rubocop-performance
126
147
  - rubocop-rails
127
148
  - rubocop-rake
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.2
1
+ 4.0.5
data/.tool-versions CHANGED
@@ -1,3 +1,2 @@
1
- ruby 3.4.2
2
- yarn 1.22.22
3
- nodejs 23.11.0
1
+ ruby 4.0.5
2
+ nodejs 26.3.1
data/Gemfile CHANGED
@@ -4,14 +4,13 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
- ruby "3.4.2"
7
+ ruby "4.0.5"
8
8
 
9
9
  gem "bundler-audit"
10
10
  gem "dorian"
11
11
  gem "rake"
12
12
  gem "rspec"
13
13
  gem "rubocop-capybara"
14
- gem "rubocop-factory_bot"
15
14
  gem "rubocop-performance"
16
15
  gem "rubocop-rails"
17
16
  gem "rubocop-rake"
data/Gemfile.lock CHANGED
@@ -1,196 +1,189 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- query-ruby (1.1.2)
4
+ query-ruby (2.0.1)
5
5
  activesupport
6
6
  bigdecimal
7
- dorian-arguments
7
+ dorian-arguments (>= 2.0.1, < 3)
8
8
  json
9
- language-ruby
9
+ language-ruby (>= 2.0.1, < 3)
10
10
  zeitwerk
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (8.0.2)
15
+ activesupport (8.1.3.1)
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.8.7)
29
- public_suffix (>= 2.0.2, < 7.0)
28
+ addressable (2.9.0)
29
+ public_suffix (>= 2.0.2, < 8.0)
30
30
  ast (2.4.3)
31
- base64 (0.2.0)
32
- benchmark (0.4.0)
33
- bigdecimal (3.1.9)
34
- bundler-audit (0.9.2)
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.5)
39
- connection_pool (2.5.1)
40
- crack (1.0.0)
37
+ concurrent-ruby (1.3.8)
38
+ connection_pool (3.0.2)
39
+ crack (1.0.1)
41
40
  bigdecimal
42
41
  rexml
43
- csv (3.3.4)
44
- diff-lcs (1.6.1)
45
- dorian (2.6.4)
46
- csv
47
- dorian-arguments
48
- dorian-eval
49
- dorian-progress
50
- dorian-to_struct
51
- git
52
- hexapdf
53
- json
54
- mini_racer
55
- ostruct
56
- parallel
57
- syntax_tree
58
- syntax_tree-haml
59
- syntax_tree-xml
60
- terminal-table
61
- w_syntax_tree-erb
62
- yaml
63
- dorian-arguments (1.2.2)
64
- bigdecimal
65
- dorian-eval (1.5.0)
66
- yaml
67
- dorian-progress (1.1.2)
68
- ruby-progressbar
69
- dorian-to_struct (2.0.2)
70
- drb (2.2.1)
42
+ csv (3.3.6)
43
+ diff-lcs (1.6.2)
44
+ dorian (3.0.2)
45
+ csv (>= 3.3.6, < 4)
46
+ dorian-arguments (>= 2.0.1, < 3)
47
+ dorian-eval (>= 2.0.1, < 3)
48
+ dorian-progress (>= 2.0.1, < 3)
49
+ dorian-to_struct (>= 3.0.1, < 4)
50
+ haml (>= 7.5.1, < 8.0)
51
+ hexapdf (>= 1.10.0, < 2)
52
+ json (>= 2.21.2, < 3)
53
+ mini_racer (>= 0.22.1, < 1)
54
+ ostruct (>= 0.6.3, < 1)
55
+ parallel (>= 2.1.0, < 3.0)
56
+ syntax_tree (>= 6.3.0, < 7)
57
+ syntax_tree-haml (>= 4.0.3, < 5)
58
+ syntax_tree-xml (>= 0.1.0, < 1)
59
+ terminal-table (>= 4.0.0, < 5)
60
+ w_syntax_tree-erb (>= 0.12.0, < 1)
61
+ yaml (>= 0.4.0, < 1)
62
+ dorian-arguments (2.0.1)
63
+ bigdecimal (>= 3.1, < 5)
64
+ dorian-eval (2.0.1)
65
+ yaml (>= 0.3, < 1)
66
+ dorian-progress (2.0.1)
67
+ ruby-progressbar (>= 1.13, < 2)
68
+ dorian-to_struct (3.0.1)
69
+ drb (2.2.3)
71
70
  geom2d (0.4.1)
72
- git (3.0.0)
73
- activesupport (>= 5.0)
74
- addressable (~> 2.8)
75
- process_executer (~> 1.3)
76
- rchardet (~> 1.9)
77
- haml (6.3.0)
71
+ haml (7.5.1)
72
+ prism (>= 1.1.0)
78
73
  temple (>= 0.8.2)
79
74
  thor
80
75
  tilt
81
- hashdiff (1.1.2)
82
- hexapdf (1.2.0)
76
+ hashdiff (1.2.1)
77
+ hexapdf (1.10.0)
83
78
  cmdparse (~> 3.0, >= 3.0.3)
84
79
  geom2d (~> 0.4, >= 0.4.1)
85
80
  openssl (>= 2.2.1)
86
81
  strscan (>= 3.1.2)
87
- i18n (1.14.7)
82
+ i18n (1.15.2)
88
83
  concurrent-ruby (~> 1.0)
89
- json (2.10.2)
90
- language-ruby (1.2.0)
84
+ json (2.21.2)
85
+ language-ruby (2.0.1)
91
86
  dorian-arguments
92
87
  zeitwerk
93
- language_server-protocol (3.17.0.4)
94
- libv8-node (23.6.1.0)
95
- libv8-node (23.6.1.0-arm64-darwin)
96
- libv8-node (23.6.1.0-x86_64-linux)
88
+ language_server-protocol (3.17.0.6)
89
+ libv8-node (24.12.0.1)
90
+ libv8-node (24.12.0.1-arm64-darwin)
91
+ libv8-node (24.12.0.1-x86_64-linux)
97
92
  lint_roller (1.1.0)
98
93
  logger (1.7.0)
99
- mini_racer (0.18.1)
100
- libv8-node (~> 23.6.1.0)
101
- minitest (5.25.5)
102
- mustermann (3.0.3)
103
- ruby2_keywords (~> 0.0.1)
104
- openssl (3.3.0)
105
- ostruct (0.6.1)
106
- parallel (1.27.0)
107
- parser (3.3.8.0)
94
+ mini_racer (0.22.1)
95
+ libv8-node (~> 24.12.0.1)
96
+ minitest (6.0.6)
97
+ drb (~> 2.0)
98
+ prism (~> 1.5)
99
+ mustermann (3.1.1)
100
+ openssl (4.0.2)
101
+ ostruct (0.6.3)
102
+ parallel (2.1.0)
103
+ parser (3.3.12.0)
108
104
  ast (~> 2.4.1)
109
105
  racc
110
106
  prettier_print (1.2.1)
111
- prism (1.4.0)
112
- process_executer (1.3.0)
113
- public_suffix (6.0.1)
107
+ prism (1.9.0)
108
+ public_suffix (7.0.5)
114
109
  racc (1.8.1)
115
- rack (3.1.13)
116
- rack-protection (4.1.1)
110
+ rack (3.2.7)
111
+ rack-protection (4.2.1)
117
112
  base64 (>= 0.1.0)
118
113
  logger (>= 1.6.0)
119
114
  rack (>= 3.0.0, < 4)
120
- rack-session (2.1.0)
115
+ rack-session (2.1.2)
121
116
  base64 (>= 0.1.0)
122
117
  rack (>= 3.0.0)
123
118
  rainbow (3.1.1)
124
- rake (13.2.1)
125
- rchardet (1.9.0)
126
- regexp_parser (2.10.0)
127
- rexml (3.4.1)
128
- rspec (3.13.0)
119
+ rake (13.4.2)
120
+ regexp_parser (2.12.0)
121
+ rexml (3.4.4)
122
+ rspec (3.13.2)
129
123
  rspec-core (~> 3.13.0)
130
124
  rspec-expectations (~> 3.13.0)
131
125
  rspec-mocks (~> 3.13.0)
132
- rspec-core (3.13.3)
126
+ rspec-core (3.13.6)
133
127
  rspec-support (~> 3.13.0)
134
- rspec-expectations (3.13.3)
128
+ rspec-expectations (3.13.5)
135
129
  diff-lcs (>= 1.2.0, < 2.0)
136
130
  rspec-support (~> 3.13.0)
137
- rspec-mocks (3.13.2)
131
+ rspec-mocks (3.13.8)
138
132
  diff-lcs (>= 1.2.0, < 2.0)
139
133
  rspec-support (~> 3.13.0)
140
- rspec-support (3.13.2)
141
- rubocop (1.75.2)
142
- json (~> 2.3)
134
+ rspec-support (3.13.7)
135
+ rubocop (1.90.0)
136
+ json (>= 2.3)
143
137
  language_server-protocol (~> 3.17.0.2)
144
138
  lint_roller (~> 1.1.0)
145
- parallel (~> 1.10)
139
+ parallel (>= 1.10)
146
140
  parser (>= 3.3.0.2)
147
141
  rainbow (>= 2.2.2, < 4.0)
148
142
  regexp_parser (>= 2.9.3, < 3.0)
149
- rubocop-ast (>= 1.44.0, < 2.0)
143
+ rubocop-ast (>= 1.49.0, < 2.0)
150
144
  ruby-progressbar (~> 1.7)
151
145
  unicode-display_width (>= 2.4.0, < 4.0)
152
- rubocop-ast (1.44.1)
146
+ rubocop-ast (1.50.0)
153
147
  parser (>= 3.3.7.2)
154
- prism (~> 1.4)
155
- rubocop-capybara (2.22.1)
148
+ prism (~> 1.7)
149
+ rubocop-capybara (3.0.0)
156
150
  lint_roller (~> 1.1)
157
- rubocop (~> 1.72, >= 1.72.1)
158
- rubocop-factory_bot (2.27.1)
159
- lint_roller (~> 1.1)
160
- rubocop (~> 1.72, >= 1.72.1)
161
- rubocop-performance (1.25.0)
151
+ rubocop (~> 1.81)
152
+ rubocop-performance (1.27.0)
162
153
  lint_roller (~> 1.1)
163
- rubocop (>= 1.75.0, < 2.0)
164
- rubocop-ast (>= 1.38.0, < 2.0)
165
- rubocop-rails (2.31.0)
154
+ rubocop (>= 1.89.0, < 2.0)
155
+ rubocop-ast (>= 1.47.1, < 2.0)
156
+ rubocop-rails (2.37.0)
166
157
  activesupport (>= 4.2.0)
167
158
  lint_roller (~> 1.1)
168
159
  rack (>= 1.1)
169
- rubocop (>= 1.75.0, < 2.0)
170
- rubocop-ast (>= 1.38.0, < 2.0)
160
+ rubocop (>= 1.89.0, < 2.0)
161
+ rubocop-ast (>= 1.44.0, < 2.0)
171
162
  rubocop-rake (0.7.1)
172
163
  lint_roller (~> 1.1)
173
164
  rubocop (>= 1.72.1)
174
- rubocop-rspec (3.6.0)
165
+ rubocop-rspec (3.10.2)
175
166
  lint_roller (~> 1.1)
176
- rubocop (~> 1.72, >= 1.72.1)
177
- rubocop-rspec_rails (2.31.0)
167
+ regexp_parser (>= 2.0)
168
+ rubocop (~> 1.86, >= 1.86.2)
169
+ rubocop-rspec_rails (2.32.0)
178
170
  lint_roller (~> 1.1)
179
171
  rubocop (~> 1.72, >= 1.72.1)
180
172
  rubocop-rspec (~> 3.5)
181
- ruby-prof (1.7.1)
173
+ ruby-prof (2.0.5)
174
+ base64
175
+ ostruct
182
176
  ruby-progressbar (1.13.0)
183
- ruby2_keywords (0.0.5)
184
177
  securerandom (0.4.1)
185
- sinatra (4.1.1)
178
+ sinatra (4.2.1)
186
179
  logger (>= 1.6.0)
187
180
  mustermann (~> 3.0)
188
181
  rack (>= 3.0.0, < 4)
189
- rack-protection (= 4.1.1)
182
+ rack-protection (= 4.2.1)
190
183
  rack-session (>= 2.0.0, < 3)
191
184
  tilt (~> 2.0)
192
- strscan (3.1.3)
193
- syntax_tree (6.2.0)
185
+ strscan (3.1.8)
186
+ syntax_tree (6.3.0)
194
187
  prettier_print (>= 1.2.0)
195
188
  syntax_tree-haml (4.0.3)
196
189
  haml (>= 5.2)
@@ -199,26 +192,26 @@ GEM
199
192
  syntax_tree-xml (0.1.0)
200
193
  prettier_print
201
194
  syntax_tree (>= 2.0.1)
202
- temple (0.10.3)
195
+ temple (0.10.7)
203
196
  terminal-table (4.0.0)
204
197
  unicode-display_width (>= 1.1.1, < 4)
205
- thor (1.3.2)
206
- tilt (2.6.0)
198
+ thor (1.5.0)
199
+ tilt (2.9.0)
207
200
  tzinfo (2.0.6)
208
201
  concurrent-ruby (~> 1.0)
209
- unicode-display_width (3.1.4)
210
- unicode-emoji (~> 4.0, >= 4.0.4)
211
- unicode-emoji (4.0.4)
212
- uri (1.0.3)
202
+ unicode-display_width (3.2.0)
203
+ unicode-emoji (~> 4.1)
204
+ unicode-emoji (4.2.0)
205
+ uri (1.1.1)
213
206
  w_syntax_tree-erb (0.12.0)
214
207
  prettier_print (~> 1.2, >= 1.2.0)
215
208
  syntax_tree (~> 6.1, >= 6.1.1)
216
- webmock (3.25.1)
209
+ webmock (3.26.4)
217
210
  addressable (>= 2.8.0)
218
211
  crack (>= 0.3.2)
219
212
  hashdiff (>= 0.4.0, < 2.0.0)
220
213
  yaml (0.4.0)
221
- zeitwerk (2.7.2)
214
+ zeitwerk (2.8.3)
222
215
 
223
216
  PLATFORMS
224
217
  arm64-darwin-23
@@ -232,7 +225,6 @@ DEPENDENCIES
232
225
  rake
233
226
  rspec
234
227
  rubocop-capybara
235
- rubocop-factory_bot
236
228
  rubocop-performance
237
229
  rubocop-rails
238
230
  rubocop-rake
@@ -243,7 +235,7 @@ DEPENDENCIES
243
235
  webmock
244
236
 
245
237
  RUBY VERSION
246
- ruby 3.4.2p28
238
+ ruby 4.0.5
247
239
 
248
240
  BUNDLED WITH
249
- 2.6.7
241
+ 4.0.15
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 2.0.1
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
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ set -e
@@ -34,13 +34,14 @@ class Query
34
34
  end
35
35
 
36
36
  def format_value(value)
37
- if value.is_a?(Hash)
37
+ case value
38
+ when Hash
38
39
  "#{value[:key]}#{value[:operator]}#{format_value(value[:value])}"
39
- elsif value.is_a?(String)
40
+ when String
40
41
  Query.evaluate(value).is_a?(Hash) ? value.inspect : value
41
- elsif value.is_a?(BigDecimal)
42
+ when BigDecimal
42
43
  value.to_s("F")
43
- elsif value.is_a?(Range)
44
+ when Range
44
45
  left = value.first
45
46
  right = value.last
46
47
  operator = value.exclude_end? ? "..." : ".."
@@ -7,12 +7,13 @@ class Query
7
7
 
8
8
  def initialize(parsed)
9
9
  self.whole = parsed.delete(:whole)
10
- self.exponent =
11
- Node::Value.new(parsed.delete(:exponent)) if parsed.key?(:exponent)
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
@@ -32,13 +32,13 @@ class Query
32
32
  "off" => false,
33
33
  "Off" => false,
34
34
  "OFF" => false
35
- }
35
+ }.freeze
36
36
 
37
37
  def initialize(parsed)
38
38
  self.boolean = parsed
39
39
  end
40
40
 
41
- def evaluate(**args)
41
+ def evaluate(**_args)
42
42
  BOOLEANS.fetch(boolean)
43
43
  end
44
44
  end
@@ -8,14 +8,14 @@ class Query
8
8
  def initialize(parsed)
9
9
  self.decimal = parsed.delete(:decimal)
10
10
 
11
- if parsed.key?(:exponent)
12
- self.exponent = Value.new(parsed.delete(:exponent))
13
- end
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
@@ -9,7 +9,7 @@ class Query
9
9
  self.key = parsed.presence
10
10
  end
11
11
 
12
- def evaluate(**args)
12
+ def evaluate(**_args)
13
13
  key.to_sym
14
14
  end
15
15
  end
@@ -6,17 +6,18 @@ class Query
6
6
  attr_accessor :value
7
7
 
8
8
  def initialize(parsed)
9
- if parsed.key?(:decimal)
10
- self.value = Decimal.new(parsed.delete(:decimal))
11
- elsif parsed.key?(:base_16)
12
- self.value = Base16.new(parsed.delete(:base_16))
13
- elsif parsed.key?(:base_8)
14
- self.value = Base8.new(parsed.delete(:base_8))
15
- elsif parsed.key?(:base_2)
16
- self.value = Base2.new(parsed.delete(:base_2))
17
- else
18
- self.value = Base10.new(parsed.delete(:base_10))
19
- end
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)
@@ -5,7 +5,13 @@ class Query
5
5
  class Operator < Node
6
6
  attr_accessor :prefix, :suffix
7
7
 
8
- PREFIXES = { "+" => "", "-" => "!", "!" => "!", "" => "", nil => "" }
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(**args)
39
+ def evaluate(**_args)
34
40
  "#{PREFIXES.fetch(prefix)}#{SUFFIXES.fetch(suffix)}"
35
41
  end
36
42
  end
@@ -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)
@@ -9,7 +9,7 @@ class Query
9
9
  self.string = parsed
10
10
  end
11
11
 
12
- def evaluate(**args)
12
+ def evaluate(**_args)
13
13
  string.to_s
14
14
  end
15
15
  end
@@ -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": "code-ruby",
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": "23.11.0",
10
- "npm": "11.2.0"
9
+ "node": "26.3.1",
10
+ "npm": "11.17.0"
11
11
  }
12
12
  }
13
13
  }
14
- }
14
+ }
data/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "MIT",
3
3
  "engines": {
4
- "node": "23.11.0",
5
- "npm": "11.2.0"
4
+ "node": "26.3.1",
5
+ "npm": "11.17.0"
6
6
  }
7
- }
7
+ }
data/query-ruby.gemspec CHANGED
@@ -15,12 +15,12 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.add_dependency "activesupport"
17
17
  s.add_dependency "bigdecimal"
18
- s.add_dependency "dorian-arguments"
18
+ s.add_dependency "dorian-arguments", ">= 2.0.1", "< 3"
19
19
  s.add_dependency "json"
20
- s.add_dependency "language-ruby"
20
+ s.add_dependency "language-ruby", ">= 2.0.1", "< 3"
21
21
  s.add_dependency "zeitwerk"
22
22
 
23
23
  s.metadata["rubygems_mfa_required"] = "true"
24
24
 
25
- s.required_ruby_version = ">= 3.0"
25
+ s.required_ruby_version = ">= 4.0"
26
26
  end
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
- Query.evaluate(source)
69
+ described_class.evaluate(source)
68
70
  end
69
71
 
70
72
  it "decompiles #{source.inspect}" do
71
- expect(Query.evaluate(Query.decompile(Query.evaluate(source)))).to eq(
72
- Query.evaluate(source)
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
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../lib/query-ruby"
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: 1.1.2
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-17 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport
@@ -43,14 +43,20 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: 2.0.1
47
+ - - "<"
48
+ - !ruby/object:Gem::Version
49
+ version: '3'
47
50
  type: :runtime
48
51
  prerelease: false
49
52
  version_requirements: !ruby/object:Gem::Requirement
50
53
  requirements:
51
54
  - - ">="
52
55
  - !ruby/object:Gem::Version
53
- version: '0'
56
+ version: 2.0.1
57
+ - - "<"
58
+ - !ruby/object:Gem::Version
59
+ version: '3'
54
60
  - !ruby/object:Gem::Dependency
55
61
  name: json
56
62
  requirement: !ruby/object:Gem::Requirement
@@ -71,14 +77,20 @@ dependencies:
71
77
  requirements:
72
78
  - - ">="
73
79
  - !ruby/object:Gem::Version
74
- version: '0'
80
+ version: 2.0.1
81
+ - - "<"
82
+ - !ruby/object:Gem::Version
83
+ version: '3'
75
84
  type: :runtime
76
85
  prerelease: false
77
86
  version_requirements: !ruby/object:Gem::Requirement
78
87
  requirements:
79
88
  - - ">="
80
89
  - !ruby/object:Gem::Version
81
- version: '0'
90
+ version: 2.0.1
91
+ - - "<"
92
+ - !ruby/object:Gem::Version
93
+ version: '3'
82
94
  - !ruby/object:Gem::Dependency
83
95
  name: zeitwerk
84
96
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +128,13 @@ files:
116
128
  - README.md
117
129
  - Rakefile
118
130
  - VERSION
131
+ - bin/bundle
132
+ - bin/bundle-audit
133
+ - bin/bundler-audit
134
+ - bin/dorian
119
135
  - bin/query
136
+ - bin/rubocop
137
+ - bin/test
120
138
  - lib/query-ruby.rb
121
139
  - lib/query.rb
122
140
  - lib/query/combiner.rb
@@ -171,14 +189,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
189
  requirements:
172
190
  - - ">="
173
191
  - !ruby/object:Gem::Version
174
- version: '3.0'
192
+ version: '4.0'
175
193
  required_rubygems_version: !ruby/object:Gem::Requirement
176
194
  requirements:
177
195
  - - ">="
178
196
  - !ruby/object:Gem::Version
179
197
  version: '0'
180
198
  requirements: []
181
- rubygems_version: 3.6.2
199
+ rubygems_version: 4.0.17
182
200
  specification_version: 4
183
201
  summary: a querying language for the internet
184
202
  test_files: []