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

pulibrary / bibdata / b3c4a532-5da0-46f8-9c20-20018605a028

21 Mar 2025 08:11PM UTC coverage: 42.257% (-49.9%) from 92.185%
b3c4a532-5da0-46f8-9c20-20018605a028

push

circleci

sandbergja
Move various gems from the default Gemfile group to a more appropriate group

1599 of 3784 relevant lines covered (42.26%)

2.56 hits per line

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

25.0
/marc_to_solr/lib/iiif_manifest_url_builder.rb
1
# Class for building instances of URI::HTTPS for IIIF Manifest URL's
2
class IIIFManifestUrlBuilder
1✔
3
  # Constructor
4
  # @param ark_cache [CompositeCacheMap] composite of caches for mapping ARK's to repository resource ID's
5
  # @param service_host [String] the host name for the repository instance
6
  # @todo Resolve the service_host default parameter properly (please @see https://github.com/pulibrary/marc_liberation/issues/313)
7
  def initialize(ark_cache:, service_host:)
1✔
8
    @ark_cache = ark_cache
×
9
    @service_host = service_host
×
10
  end
11

12
  # Generates an IIIF Manifest 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
×
17
      cached_values = @ark_cache.fetch("ark:/#{url.naan}/#{url.name}")
×
18
      return if cached_values.nil?
×
19

20
      id = cached_values.fetch :id
×
21
      resource_type = cached_values.fetch :internal_resource
×
22
      human_readable_type = resource_type.underscore
×
23

24
      URI::HTTPS.build(host: @service_host, path: "/concern/#{human_readable_type.pluralize}/#{id}/manifest")
×
25
    end
26
  end
27
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