• 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/alma_holding.rb
UNCOV
1
class AlmaAdapter
×
UNCOV
2
  class AlmaHolding
×
UNCOV
3
    def self.for(holding, holding_record: nil, recap: false)
×
UNCOV
4
      return new(holding, holding_record:) unless recap
×
5

UNCOV
6
      AlmaAdapter::RecapAlmaHolding.new(holding, holding_record:)
×
UNCOV
7
    end
×
UNCOV
8
    attr_reader :holding
×
9

10
    # @param item [Alma::BibHolding]
UNCOV
11
    def initialize(holding, holding_record: nil)
×
UNCOV
12
      @holding = holding
×
UNCOV
13
      @holding_record = holding_record
×
UNCOV
14
    end
×
15

UNCOV
16
    def marc_record_enrichment
×
UNCOV
17
      [
×
UNCOV
18
        enriched_852,
×
UNCOV
19
        prepend_holding_id(holding_record.fields('856')),
×
UNCOV
20
        prepend_holding_id(holding_record.fields('866')),
×
UNCOV
21
        prepend_holding_id(holding_record.fields('867'))
×
UNCOV
22
      ].flatten.compact
×
UNCOV
23
    end
×
24

UNCOV
25
    def enriched_852
×
UNCOV
26
      prepend_holding_id(holding_record.fields('852'))
×
UNCOV
27
    end
×
28

UNCOV
29
    def prepend_holding_id(fields)
×
UNCOV
30
      return if fields.blank?
×
31

UNCOV
32
      fields.map do |field|
×
UNCOV
33
        field.tap do |f|
×
UNCOV
34
          f.subfields.unshift(MARC::Subfield.new('0', holding_id))
×
UNCOV
35
        end
×
UNCOV
36
      end
×
UNCOV
37
    end
×
38

UNCOV
39
    def holding_record
×
UNCOV
40
      @holding_record ||=
×
UNCOV
41
        MARC::XMLReader.new(
×
UNCOV
42
          StringIO.new(
×
UNCOV
43
            holding['anies'].first
×
UNCOV
44
          )
×
UNCOV
45
        ).first
×
UNCOV
46
    end
×
47

UNCOV
48
    def holding_id
×
UNCOV
49
      holding['holding_id']
×
UNCOV
50
    end
×
UNCOV
51
  end
×
UNCOV
52
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