• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / 39c03fef-76bf-4aae-9be3-c3920e4648f4

24 Dec 2024 05:17PM UTC coverage: 91.859% (-0.04%) from 91.902%
39c03fef-76bf-4aae-9be3-c3920e4648f4

push

circleci

web-flow
Rubocop gems (#2569)

* Remove stale line for bixby in rubocop.yml

* Include Rails and Performance rubocop gems
Remove Rails and Performance cops from rubocop.yml
Let rubocop target ruby version to be 3.2

* bundle exec rubocop -a

* Generate new .rubocop_todo.yml
rubocop fix

335 of 378 new or added lines in 57 files covered. (88.62%)

2 existing lines in 2 files now uncovered.

3385 of 3685 relevant lines covered (91.86%)

378.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/app/controllers/availability_controller.rb
1
class AvailabilityController < ApplicationController
1✔
2
  def adapter
1✔
3
    @adapter ||= AlmaAdapter.new
×
4
  end
5

6
  def index
1✔
7
    if params[:ids] || params[:id] || params[:mfhd] || params[:mfhd_serial]
10✔
8
      render plain: 'This endpoint no longer accepts this param', status: :bad_request
4✔
9
    elsif params[:barcodes]
6✔
10
      scsb_lookup = ScsbLookup.new
3✔
11
      avail = scsb_lookup.find_by_barcodes(sanitize_array(params[:barcodes]))
3✔
12
      if avail.empty?
3✔
13
        render plain: "SCSB Barcodes(s): #{params[:barcodes]} not found.", status: :not_found
1✔
14
      else
15
        respond_to do |wants|
2✔
16
          wants.json  { render json: MultiJson.dump(avail) }
4✔
17
        end
18
      end
19
    elsif params[:scsb_id]
3✔
20
      scsb_lookup = ScsbLookup.new
3✔
21
      avail = scsb_lookup.find_by_id(CGI.escape(params[:scsb_id]))
3✔
22
      if avail.empty?
3✔
23
        render plain: "SCSB Record: #{params[:scsb_id]} not found.", status: :not_found
1✔
24
      else
25
        respond_to do |wants|
2✔
26
          wants.json  { render json: MultiJson.dump(avail) }
4✔
27
        end
28
      end
29
    else
NEW
30
      render plain: 'Please provide a bib id.', status: :not_found
×
31
    end
32
  end
33

34
  private
1✔
35

36
    def sanitize_array(arr)
1✔
37
      arr.map { |s| CGI.escape(s) }
9✔
38
    end
39
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc