Skip to content

Commit d59cefe

Browse files
Bundle audit and Rubocop
1 parent 95ba8ac commit d59cefe

File tree

3 files changed

+93
-99
lines changed

3 files changed

+93
-99
lines changed

Gemfile.lock

Lines changed: 74 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -58,51 +58,51 @@ PATH
5858
GEM
5959
remote: https://rubygems.org/
6060
specs:
61-
actioncable (7.1.5.1)
62-
actionpack (= 7.1.5.1)
63-
activesupport (= 7.1.5.1)
61+
actioncable (7.1.5.2)
62+
actionpack (= 7.1.5.2)
63+
activesupport (= 7.1.5.2)
6464
nio4r (~> 2.0)
6565
websocket-driver (>= 0.6.1)
6666
zeitwerk (~> 2.6)
67-
actionmailbox (7.1.5.1)
68-
actionpack (= 7.1.5.1)
69-
activejob (= 7.1.5.1)
70-
activerecord (= 7.1.5.1)
71-
activestorage (= 7.1.5.1)
72-
activesupport (= 7.1.5.1)
67+
actionmailbox (7.1.5.2)
68+
actionpack (= 7.1.5.2)
69+
activejob (= 7.1.5.2)
70+
activerecord (= 7.1.5.2)
71+
activestorage (= 7.1.5.2)
72+
activesupport (= 7.1.5.2)
7373
mail (>= 2.7.1)
7474
net-imap
7575
net-pop
7676
net-smtp
77-
actionmailer (7.1.5.1)
78-
actionpack (= 7.1.5.1)
79-
actionview (= 7.1.5.1)
80-
activejob (= 7.1.5.1)
81-
activesupport (= 7.1.5.1)
77+
actionmailer (7.1.5.2)
78+
actionpack (= 7.1.5.2)
79+
actionview (= 7.1.5.2)
80+
activejob (= 7.1.5.2)
81+
activesupport (= 7.1.5.2)
8282
mail (~> 2.5, >= 2.5.4)
8383
net-imap
8484
net-pop
8585
net-smtp
8686
rails-dom-testing (~> 2.2)
87-
actionpack (7.1.5.1)
88-
actionview (= 7.1.5.1)
89-
activesupport (= 7.1.5.1)
87+
actionpack (7.1.5.2)
88+
actionview (= 7.1.5.2)
89+
activesupport (= 7.1.5.2)
9090
nokogiri (>= 1.8.5)
9191
racc
9292
rack (>= 2.2.4)
9393
rack-session (>= 1.0.1)
9494
rack-test (>= 0.6.3)
9595
rails-dom-testing (~> 2.2)
9696
rails-html-sanitizer (~> 1.6)
97-
actiontext (7.1.5.1)
98-
actionpack (= 7.1.5.1)
99-
activerecord (= 7.1.5.1)
100-
activestorage (= 7.1.5.1)
101-
activesupport (= 7.1.5.1)
97+
actiontext (7.1.5.2)
98+
actionpack (= 7.1.5.2)
99+
activerecord (= 7.1.5.2)
100+
activestorage (= 7.1.5.2)
101+
activesupport (= 7.1.5.2)
102102
globalid (>= 0.6.0)
103103
nokogiri (>= 1.8.5)
104-
actionview (7.1.5.1)
105-
activesupport (= 7.1.5.1)
104+
actionview (7.1.5.2)
105+
activesupport (= 7.1.5.2)
106106
builder (~> 3.1)
107107
erubi (~> 1.11)
108108
rails-dom-testing (~> 2.2)
@@ -112,32 +112,32 @@ GEM
112112
activemodel (>= 4.1)
113113
case_transform (>= 0.2)
114114
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
115-
activejob (7.1.5.1)
116-
activesupport (= 7.1.5.1)
115+
activejob (7.1.5.2)
116+
activesupport (= 7.1.5.2)
117117
globalid (>= 0.3.6)
118-
activemodel (7.1.5.1)
119-
activesupport (= 7.1.5.1)
118+
activemodel (7.1.5.2)
119+
activesupport (= 7.1.5.2)
120120
activemodel-serializers-xml (1.0.2)
121121
activemodel (> 5.x)
122122
activesupport (> 5.x)
123123
builder (~> 3.1)
124-
activerecord (7.1.5.1)
125-
activemodel (= 7.1.5.1)
126-
activesupport (= 7.1.5.1)
124+
activerecord (7.1.5.2)
125+
activemodel (= 7.1.5.2)
126+
activesupport (= 7.1.5.2)
127127
timeout (>= 0.4.0)
128128
activeresource (6.0.0)
129129
activemodel (>= 6.0)
130130
activemodel-serializers-xml (~> 1.0)
131131
activesupport (>= 6.0)
132132
activeresource-response (1.4.0)
133133
activeresource (>= 3, < 6.1)
134-
activestorage (7.1.5.1)
135-
actionpack (= 7.1.5.1)
136-
activejob (= 7.1.5.1)
137-
activerecord (= 7.1.5.1)
138-
activesupport (= 7.1.5.1)
134+
activestorage (7.1.5.2)
135+
actionpack (= 7.1.5.2)
136+
activejob (= 7.1.5.2)
137+
activerecord (= 7.1.5.2)
138+
activesupport (= 7.1.5.2)
139139
marcel (~> 1.0)
140-
activesupport (7.1.5.1)
140+
activesupport (7.1.5.2)
141141
base64
142142
benchmark (>= 0.3)
143143
bigdecimal
@@ -156,12 +156,12 @@ GEM
156156
base64 (0.3.0)
157157
bcp47_spec (0.2.1)
158158
bcrypt (3.1.20)
159-
benchmark (0.4.0)
159+
benchmark (0.4.1)
160160
better_errors (2.10.1)
161161
erubi (>= 1.0.0)
162162
rack (>= 0.9.0)
163163
rouge (>= 1.0.0)
164-
bigdecimal (3.1.9)
164+
bigdecimal (3.2.2)
165165
bindex (0.8.1)
166166
binding_of_caller (1.0.1)
167167
debug_inspector (>= 1.2.0)
@@ -174,7 +174,7 @@ GEM
174174
coderay (1.1.3)
175175
colorize (1.1.0)
176176
concurrent-ruby (1.3.4)
177-
connection_pool (2.5.0)
177+
connection_pool (2.5.3)
178178
crass (1.0.6)
179179
dalli (3.2.8)
180180
database_cleaner-core (2.0.1)
@@ -194,9 +194,10 @@ GEM
194194
diff-lcs (1.5.1)
195195
dimensions (1.3.0)
196196
domain_name (0.6.20240107)
197-
drb (2.2.1)
197+
drb (2.2.3)
198198
edtf (3.2.0)
199199
activesupport (>= 3.0, < 9.0)
200+
erb (5.0.2)
200201
erubi (1.13.1)
201202
et-orbi (1.2.11)
202203
tzinfo
@@ -227,8 +228,8 @@ GEM
227228
domain_name (~> 0.5)
228229
i18n (1.14.7)
229230
concurrent-ruby (~> 1.0)
230-
io-console (0.8.0)
231-
irb (1.15.1)
231+
io-console (0.8.1)
232+
irb (1.15.2)
232233
pp (>= 0.6.0)
233234
rdoc (>= 4.0.0)
234235
reline (>= 0.4.2)
@@ -269,8 +270,8 @@ GEM
269270
lazy_high_charts (1.6.1)
270271
hash-deep-merge
271272
link_header (0.0.8)
272-
logger (1.6.1)
273-
loofah (2.24.0)
273+
logger (1.7.0)
274+
loofah (2.24.1)
274275
crass (~> 1.0.2)
275276
nokogiri (>= 1.12.0)
276277
mail (2.8.1)
@@ -285,7 +286,7 @@ GEM
285286
mime-types-data (~> 3.2015)
286287
mime-types-data (3.2024.1001)
287288
mini_mime (1.1.5)
288-
minitest (5.25.4)
289+
minitest (5.25.5)
289290
mongo (2.20.0)
290291
bson (>= 4.14.1, < 6.0.0)
291292
mongoid (9.0.0)
@@ -298,7 +299,7 @@ GEM
298299
mutex_m (0.3.0)
299300
net-http (0.4.1)
300301
uri
301-
net-imap (0.5.8)
302+
net-imap (0.5.10)
302303
date
303304
net-protocol
304305
net-pop (0.1.2)
@@ -334,67 +335,68 @@ GEM
334335
pry (>= 0.13, < 0.15)
335336
pry-rails (0.3.11)
336337
pry (>= 0.13.0)
337-
psych (5.2.3)
338+
psych (5.2.6)
338339
date
339340
stringio
340341
public_suffix (6.0.0)
341342
pundit (2.3.2)
342343
activesupport (>= 3.0.0)
343344
raabro (1.4.0)
344345
racc (1.8.1)
345-
rack (3.1.16)
346+
rack (3.2.0)
346347
rack-session (2.1.1)
347348
base64 (>= 0.1.0)
348349
rack (>= 3.0.0)
349350
rack-test (2.2.0)
350351
rack (>= 1.3)
351352
rackup (2.2.1)
352353
rack (>= 3)
353-
rails (7.1.5.1)
354-
actioncable (= 7.1.5.1)
355-
actionmailbox (= 7.1.5.1)
356-
actionmailer (= 7.1.5.1)
357-
actionpack (= 7.1.5.1)
358-
actiontext (= 7.1.5.1)
359-
actionview (= 7.1.5.1)
360-
activejob (= 7.1.5.1)
361-
activemodel (= 7.1.5.1)
362-
activerecord (= 7.1.5.1)
363-
activestorage (= 7.1.5.1)
364-
activesupport (= 7.1.5.1)
354+
rails (7.1.5.2)
355+
actioncable (= 7.1.5.2)
356+
actionmailbox (= 7.1.5.2)
357+
actionmailer (= 7.1.5.2)
358+
actionpack (= 7.1.5.2)
359+
actiontext (= 7.1.5.2)
360+
actionview (= 7.1.5.2)
361+
activejob (= 7.1.5.2)
362+
activemodel (= 7.1.5.2)
363+
activerecord (= 7.1.5.2)
364+
activestorage (= 7.1.5.2)
365+
activesupport (= 7.1.5.2)
365366
bundler (>= 1.15.0)
366-
railties (= 7.1.5.1)
367+
railties (= 7.1.5.2)
367368
rails-controller-testing (1.0.5)
368369
actionpack (>= 5.0.1.rc1)
369370
actionview (>= 5.0.1.rc1)
370371
activesupport (>= 5.0.1.rc1)
371-
rails-dom-testing (2.2.0)
372+
rails-dom-testing (2.3.0)
372373
activesupport (>= 5.0.0)
373374
minitest
374375
nokogiri (>= 1.6)
375376
rails-html-sanitizer (1.6.2)
376377
loofah (~> 2.21)
377378
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
378-
railties (7.1.5.1)
379-
actionpack (= 7.1.5.1)
380-
activesupport (= 7.1.5.1)
379+
railties (7.1.5.2)
380+
actionpack (= 7.1.5.2)
381+
activesupport (= 7.1.5.2)
381382
irb
382383
rackup (>= 1.0.0)
383384
rake (>= 12.2)
384385
thor (~> 1.0, >= 1.2.2)
385386
zeitwerk (~> 2.6)
386387
rainbow (3.1.1)
387-
rake (13.2.1)
388+
rake (13.3.0)
388389
rdf (3.3.2)
389390
bcp47_spec (~> 0.2)
390391
bigdecimal (~> 3.1, >= 3.1.5)
391392
link_header (~> 0.0, >= 0.0.8)
392-
rdoc (6.12.0)
393+
rdoc (6.14.2)
394+
erb
393395
psych (>= 4.0.0)
394396
redis-client (0.22.2)
395397
connection_pool
396398
regexp_parser (2.9.2)
397-
reline (0.6.0)
399+
reline (0.6.2)
398400
io-console (~> 0.5)
399401
responders (3.1.1)
400402
actionpack (>= 5.2)
@@ -470,7 +472,7 @@ GEM
470472
activesupport (>= 6.1)
471473
sprockets (>= 3.0.0)
472474
state_machines (0.6.0)
473-
stringio (3.1.2)
475+
stringio (3.1.7)
474476
sunspot_matchers (2.2.5.0)
475477
sunspot_solr (2.4.0)
476478
sunspot_test (0.4.2)
@@ -493,12 +495,12 @@ GEM
493495
activemodel (>= 6.0.0)
494496
bindex (>= 0.4.0)
495497
railties (>= 6.0.0)
496-
websocket-driver (0.7.7)
498+
websocket-driver (0.8.0)
497499
base64
498500
websocket-extensions (>= 0.1.0)
499501
websocket-extensions (0.1.5)
500502
yard (0.9.36)
501-
zeitwerk (2.7.1)
503+
zeitwerk (2.7.3)
502504

503505
PLATFORMS
504506
arm64-darwin-22

app/controllers/supplejack_api/harvester/records_controller.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def delete
4646
status: :failed, exception_class: e.class.to_s, message: e.message,
4747
backtrace: e.backtrace, raw_data: @record.try(:to_json), record_id: id
4848
}
49-
end
49+
end
5050

5151
def update
5252
@record = SupplejackApi::Record.custom_find(params[:id], nil, status: :all)
@@ -74,8 +74,6 @@ def index
7474

7575
page = search_options_params[:page].to_i
7676

77-
78-
7977
@records = query.page(page).per(20).hint(hints)
8078

8179
if @records.present?
@@ -92,15 +90,11 @@ def query
9290
job_id = params['search']['fragments.job_id']
9391
exclude_source_id = params['exclude_source_id']
9492

95-
if job_id.is_a?(Array)
96-
range_job_ids = { "fragments.job_id": { "$in": job_id } }
97-
end
93+
range_job_ids = { "fragments.job_id": { "$in": job_id } } if job_id.is_a?(Array)
9894

9995
query = SupplejackApi::Record.where(range_job_ids || search_params.to_hash)
10096

101-
if exclude_source_id.present?
102-
query = query.where("fragments.source_id": { "$ne": exclude_source_id })
103-
end
97+
query = query.where("fragments.source_id": { "$ne": exclude_source_id }) if exclude_source_id.present?
10498

10599
query
106100
end

spec/controllers/supplejack_api/harvester/records_controller_spec.rb

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -479,30 +479,28 @@ module SupplejackApi
479479
end
480480
end
481481

482-
context "when the exclude_source_id parameter is set" do
483-
let!(:record) {
484-
create(:record,
485-
fragments: [
486-
build(:record_fragment, source_id: 'harvest_fragment'),
487-
build(:record_fragment, source_id: 'enrichment_fragment')
488-
]
489-
)
490-
}
482+
context 'when the exclude_source_id parameter is set' do
483+
let!(:record) do
484+
create(:record,
485+
fragments: [
486+
build(:record_fragment, source_id: 'harvest_fragment'),
487+
build(:record_fragment, source_id: 'enrichment_fragment')
488+
])
489+
end
491490

492-
let!(:record2) {
493-
create(:record,
494-
fragments: [
495-
build(:record_fragment, source_id: 'harvest_fragment')
496-
]
497-
)
498-
}
491+
let!(:record2) do
492+
create(:record,
493+
fragments: [
494+
build(:record_fragment, source_id: 'harvest_fragment')
495+
])
496+
end
499497

500-
it "only returns records that do not contain the source id being harvested" do
498+
it 'only returns records that do not contain the source id being harvested' do
501499
get :index, params: {
502500
search: { 'fragments.source_id' => 'harvest_fragment' },
503501
exclude_source_id: 'enrichment_fragment',
504502
search_options: { page: 1 }
505-
}
503+
}
506504

507505
body = JSON.parse(response.body)
508506

0 commit comments

Comments
 (0)