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

pulibrary / bibdata / 1dcebae2-3318-4e77-bc53-82276e293354

02 May 2025 04:45PM UTC coverage: 28.256% (-63.9%) from 92.189%
1dcebae2-3318-4e77-bc53-82276e293354

push

circleci

sandbergja
Add basic infrastructure for compiling rust code

* Add a rake compile task to compile
* Run the rake task in CI
* Run the rake task before rspec tests with the rust tag, to provide quick feedback on rust changes in TDD cycles

2 of 7 new or added lines in 2 files covered. (28.57%)

2467 existing lines in 97 files now uncovered.

1089 of 3854 relevant lines covered (28.26%)

0.29 hits per line

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

47.37
/marc_to_solr/lib/cache_manager.rb
1
require 'active_support/core_ext/module'
1✔
2

3
# Class for handling instances of caching objects
4
class CacheManager
1✔
5
  # Build and set the current cache to the new instance
6
  # @param cache [ActiveSupport::Cache::Store, CacheAdapter] Low-level cache
7
  # @param logger [IO] logger for handling output during HTTP service requests
8
  def self.initialize(figgy_cache:, logger: STDOUT)
1✔
UNCOV
9
    @current_cache = new(figgy_cache:, logger:)
×
10
  end
11

12
  # Retrieve the last initialized cache manager
13
  # Raises an error if a cache hasn't been initialized
14
  # @return [CacheManager]
15
  def self.current
1✔
UNCOV
16
    @current_cache
×
17
  rescue StandardError
18
    raise NotImplementedError, 'Please initialize a cache using CacheManager.initialize(cache: Rails.cache, logger: Rails.logger)'
×
19
  end
20

21
  # Clear a cache directory by removing its contents
22
  # @param dir [String] path to the cache directory
23
  def self.clear(dir:)
1✔
24
    return unless Dir.exist? dir
×
25

26
    FileUtils.rm_r Dir.glob("#{dir}/*")
×
27
  end
28

29
  # Constructor
30
  # @param cache [ActiveSupport::Cache::Store] Rails low-level cache
31
  # @param logger [IO] logger for handling output during HTTP service requests
32
  def initialize(figgy_cache:, logger: STDOUT)
1✔
UNCOV
33
    @figgy_cache = figgy_cache
×
UNCOV
34
    @logger = logger
×
35

36
    # Seed the caches
UNCOV
37
    seed!
×
38
  end
39

40
  # Retrieve the stored (or seed) the cache for the ARK's in Figgy
41
  # @return [CacheMap]
42
  def figgy_ark_cache
1✔
UNCOV
43
    @figgy_ark_cache ||= CacheMap.new(cache: @figgy_cache, host: 'figgy.princeton.edu', logger: @logger)
×
44
  end
45

46
  # Retrieve the stored (or seed) the cache for the ARK's in all repositories
47
  # @return [CompositeCacheMap]
48
  def ark_cache
1✔
UNCOV
49
    @cache_maps ||= CompositeCacheMap.new(cache_maps: [figgy_ark_cache])
×
50
  end
51

52
  # Ensure the the CacheMap and CompositeCacheMap instances are memoized
53
  delegate :seed!, to: :figgy_ark_cache
1✔
54
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