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

pulibrary / bibdata / 9d96b322-2ea5-411e-a0cc-8228852b9190

01 Oct 2025 02:04PM UTC coverage: 89.329% (-0.3%) from 89.665%
9d96b322-2ea5-411e-a0cc-8228852b9190

push

circleci

christinach
Update CacheMap to look for the correct structure from figgy
Exclude resource types with no ark
and no resource_identifier(bibID)
When seed! check solr response for meta and pages key

related to [#1720]
related to [#1848]

7 of 36 new or added lines in 1 file covered. (19.44%)

7 existing lines in 2 files now uncovered.

8991 of 10065 relevant lines covered (89.33%)

349.24 hits per line

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

52.94
/marc_to_solr/lib/cache_adapter.rb
1
# Class which provides an API similar to that of ActiveSupport::Cache::Store Objects
2
# Currently this just supports the Lightly Gem (@see https://github.com/DannyBen/lightly)
3
class CacheAdapter
1✔
4
  # Clear a directory path used by a caching service
5
  # @param dir [String] the path to the directory used by the cache
6
  def self.clear(dir:)
1✔
7
    # Ensure that the directory is empty
8
    base_path = File.expand_path(dir)
×
9
    glob_path = File.join(base_path, '**', '*')
×
10
    paths = Dir.glob(glob_path)
×
11
    FileUtils.rm_r(paths)
×
12
  end
13

14
  # Constructor
15
  # @param service [Lightly] the caching service
16
  def initialize(service:)
1✔
17
    @service = service
3✔
18
  end
19

20
  # Fetch a value from the cache
21
  # @param key [String] key for the cache
22
  # @return [Object, nil] the value (or nil if no objects have been cached)
23
  def fetch(key)
1✔
24
    return nil unless @service.cached?(key)
39✔
25

26
    @service.get(key)
12✔
27
  end
28

29
  # Write to the cache
30
  # @param key [String] key for the cache
31
  # @return [Object] the object being cached for the key
32
  def write(key, value)
1✔
UNCOV
33
    @service.clear(key)
×
UNCOV
34
    @service.get(key) do
×
UNCOV
35
      value
×
36
    end
37
  end
38

39
  # Determine whether or not a value for a given key has been cached
40
  # @param key [String] the key
41
  # @return [TrueClass, FalseClass]
42
  def exist?(key)
1✔
UNCOV
43
    @service.cached?(key)
×
44
  end
45
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