• 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

0.0
/app/adapters/alma_adapter/status.rb
1
# Abstraction responsible for calculating the status and status label of a given
2
# holding.
3
# @TODO Add support for all the statuses in
4
#   https://github.com/pulibrary/marc_liberation/issues/937
UNCOV
5
class AlmaAdapter::Status
×
UNCOV
6
  attr_reader :bib, :holding, :aeon
×
7

8
  # @param bib [Alma::Bib]
9
  # @param holding [Hash] Holding data pulled from Alma::AvailabilityResponse
10
  # @param aeon [Bool] Is Aeon location?
UNCOV
11
  def initialize(bib:, holding:, aeon: false)
×
UNCOV
12
    @bib = bib
×
UNCOV
13
    @holding = holding
×
UNCOV
14
    @aeon = aeon
×
UNCOV
15
  end
×
16

UNCOV
17
  def to_s
×
UNCOV
18
    return 'On-site Access' if on_site_holding?
×
UNCOV
19
    return 'Some items not available' if holding['availability'] == 'check_holdings'
×
UNCOV
20
    return holding['availability'].titlecase if holding['availability']
×
21

22
    # For electronic holdings
23
    return holding['activation_status'].titlecase if holding['activation_status']
×
UNCOV
24
  end
×
25

UNCOV
26
  def on_site_holding?
×
UNCOV
27
    return true if aeon
×
28

UNCOV
29
    on_site_locations? || on_site_sc_locations?
×
UNCOV
30
  end
×
31

32
  # Holdings in these location are for on-site use only
UNCOV
33
  def on_site_locations?
×
UNCOV
34
    ['lewis$map', 'lewis$maplf', 'lewis$maplref', 'lewis$mapmc', 'lewis$mapmcm'].include?(library_location_code)
×
UNCOV
35
  end
×
36

UNCOV
37
  def on_site_sc_locations?
×
UNCOV
38
    additional_locations = ['rare$xmr', 'mudd$scamudd', 'rare$xrr',
×
UNCOV
39
                            'rare$xgr', 'rare$xcr', 'mudd$phr']
×
UNCOV
40
    library_location_code.start_with?('rare$sca') || additional_locations.include?(library_location_code)
×
UNCOV
41
  end
×
42

UNCOV
43
  def library_location_code
×
UNCOV
44
    "#{holding['library_code']}$#{holding['location_code']}"
×
UNCOV
45
  end
×
UNCOV
46
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