• 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/recap_alma_holding.rb
UNCOV
1
class AlmaAdapter
×
2
  # Handle the differences in holding enrichments done for ReCAP only.
UNCOV
3
  class RecapAlmaHolding < AlmaHolding
×
4
    # ReCAP can't handle a call number with both an 'h' and an 'i' subfield, so
5
    # combine them both into 'h'
UNCOV
6
    def enriched_852
×
UNCOV
7
      super.map do |original_field|
×
UNCOV
8
        original_field.tap do |field|
×
UNCOV
9
          call_no = callno_from_852(field)
×
UNCOV
10
          field.subfields.delete_if { |s| %w[h i].include? s.code }
×
UNCOV
11
          field.append(MARC::Subfield.new('h', call_no))
×
UNCOV
12
          combine_location(field)
×
UNCOV
13
        end
×
UNCOV
14
      end
×
UNCOV
15
    end
×
16

UNCOV
17
    private
×
18

19
      # We need to combine 852 b/c for recap.
UNCOV
20
      def combine_location(field)
×
UNCOV
21
        return if field['b'].to_s.include?('$')
×
22

UNCOV
23
        b_code = "#{field['b']}$#{field['c']}"
×
UNCOV
24
        field.subfields.delete_if { |s| s.code == 'b' }
×
UNCOV
25
        field.append(MARC::Subfield.new('b', b_code))
×
UNCOV
26
      end
×
27

28
      # Copied from VoyagerHelpers. Combines h and i into one callnumber.
UNCOV
29
      def callno_from_852(field)
×
UNCOV
30
        call_no = field['h']
×
UNCOV
31
        return call_no if call_no.nil?
×
32

UNCOV
33
        call_no << (' ' + field['i']) if field['i']
×
UNCOV
34
        call_no.gsub!(/^[[:blank:]]+(.*)$/, '\1')
×
UNCOV
35
        call_no
×
UNCOV
36
      end
×
UNCOV
37
  end
×
UNCOV
38
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