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

pulibrary / orangelight / 62bad3f1-d46d-40af-822c-403d653da2a8

17 Jun 2025 05:30PM UTC coverage: 0.447% (-94.9%) from 95.337%
62bad3f1-d46d-40af-822c-403d653da2a8

push

circleci

maxkadel
Install chrome & chromedriver for smoke specs

43 of 9610 relevant lines covered (0.45%)

0.01 hits per line

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

0.0
/app/services/requests/bibdata_service.rb
1
# frozen_string_literal: true
2
module Requests
×
3
  class BibdataService
×
4
    def self.connection
×
5
      Faraday.new(url: Requests.config[:bibdata_base]) do |faraday|
×
6
        faraday.request :url_encoded # form-encode POST params
×
7
        faraday.response :logger unless Rails.env.test?
×
8
        faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
×
9
      end
×
10
    end
×
11

12
    def self.delivery_locations
×
13
      # check cache; return unless nil
14
      locations = Rails.cache.fetch('delivery_locations', expires_in: 24.hours)
×
15
      return locations unless locations.nil?
×
16

17
      # don't cache if we didn't get a success
18
      locations = {}.with_indifferent_access
×
19

20
      response = connection.get "/locations/delivery_locations.json"
×
21
      return locations unless response.status == 200
×
22

23
      JSON.parse(response.body).each do |location|
×
24
        locations[location['gfa_pickup']] = location.with_indifferent_access
×
25
      end
×
26

27
      Rails.cache.write('delivery_locations', locations, expires_in: 24.hours)
×
28
      locations
×
29
    end
×
30
  end
×
31
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

© 2025 Coveralls, Inc