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

pulibrary / bibdata / f04bc944-f9b4-4a42-8b26-dcacd0e3e688

11 Mar 2025 10:27PM UTC coverage: 34.017% (-58.1%) from 92.162%
f04bc944-f9b4-4a42-8b26-dcacd0e3e688

Pull #2653

circleci

christinach
Add new lc_subject_facet field.
Helps with the vocabulary work https://github.com/pulibrary/orangelight/pull/3386
In this new field we index only the lc subject heading and the subdivisions
So that when the user searches using the Details section, they can query solr for
all the subject headings and their divisions.

This is needed for the Subject browse Vocabulary work.
example: "lc_subject_facet": [
             "Booksellers and bookselling—Italy—Directories",
             "Booksellers and bookselling-Italy",
             "Booksellers and bookselling"
              ]
Pull Request #2653: Add new lc_subject_facet field.

1 of 3 new or added lines in 1 file covered. (33.33%)

2215 existing lines in 93 files now uncovered.

1294 of 3804 relevant lines covered (34.02%)

0.99 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