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

pulibrary / bibdata / 97cbe92d-c54f-45de-a4c8-e506299fcc4d

21 Dec 2023 09:42PM UTC coverage: 90.834% (-0.5%) from 91.287%
97cbe92d-c54f-45de-a4c8-e506299fcc4d

Pull #2284

circleci

sandbergja
Upgrade old gem dependencies

Removes the rerun gem, since it is no longer used.  Also, remove some leftover files from the spring gem.
Pull Request #2284: Upgrade old gem dependencies

3409 of 3753 relevant lines covered (90.83%)

334.45 hits per line

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

81.82
/marc_to_solr/lib/orangelight_url_builder.rb
1
# Class for building instances of URI::HTTPS for Orangelight URL's
2
class OrangelightUrlBuilder
1✔
3
  # Constructor
4
  # @param ark_cache [CompositeCacheMap] composite of caches for mapping ARK's to BibID's
5
  # @param service_host [String] the host name for the Orangelight instance
6
  def initialize(ark_cache:, fragment: 'view', service_host: 'catalog.princeton.edu')
1✔
7
    @ark_cache = ark_cache
14✔
8
    @service_host = service_host
14✔
9
    @fragment = fragment
14✔
10
  end
11

12
  # Generates an Orangelight URL using an ARK
13
  # @param ark [URI::ARK] the archival resource key
14
  # @return URI::HTTPS the URL
15
  def build(url:)
1✔
16
    if url.is_a? URI::ARK
14✔
17
      cached_values = @ark_cache.fetch("ark:/#{url.naan}/#{url.name}")
14✔
18
      return if cached_values.nil?
14✔
19

20
      cached_bib_id = cached_values.fetch :source_metadata_identifier
×
21

22
      URI::HTTPS.build(host: @service_host, path: "/catalog/#{cached_bib_id}", fragment: @fragment)
×
23
    end
24
  end
25
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