• 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

40.0
/marc_to_solr/lib/hierarchical_heading.rb
1
# frozen_string_literal: true
2

3
# Generate hierarchical heading strings
4
# like German language—Foreign words and phrases
5
class HierarchicalHeading
1✔
6
  def initialize(field:, spec:, split_on_subfield:)
1✔
UNCOV
7
    @field = field
×
UNCOV
8
    @spec = spec
×
UNCOV
9
    @split_on_subfield = split_on_subfield
×
10
  end
11

12
  def to_s
1✔
UNCOV
13
    return unless any_subfields?
×
14

UNCOV
15
    compile_string
×
16
  end
17

18
  private
1✔
19

20
    def any_subfields?
1✔
UNCOV
21
      subfields.any?
×
22
    end
23

24
    def compile_string
1✔
UNCOV
25
      heading = Traject::Macros::Marc21.trim_punctuation(first_subfield.value)
×
UNCOV
26
      remaining_subfields.each do |subfield|
×
UNCOV
27
        heading << delimiter_for(subfield)
×
UNCOV
28
        heading << Traject::Macros::Marc21.trim_punctuation(subfield.value)
×
29
      end
UNCOV
30
      heading
×
31
    end
32

33
    def delimiter_for(subfield)
1✔
UNCOV
34
      @split_on_subfield.include?(subfield.code) ? SEPARATOR : ' '
×
35
    end
36

37
    def first_subfield
1✔
UNCOV
38
      subfields.first
×
39
    end
40

41
    def remaining_subfields
1✔
UNCOV
42
      subfields.drop(1)
×
43
    end
44

45
    def subfields
1✔
UNCOV
46
      @subfields ||= @field.subfields.select { |subfield| @spec.subfields.include? subfield.code }
×
47
    end
48
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