• 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

50.0
/marc_to_solr/lib/access_facet_builder.rb
1
# Class for building access_facet values
2
class AccessFacetBuilder
1✔
3
  # Build access facet
4
  # @param record [MARC::Record]
5
  # @param context [Traject::Indexer::Context]
6
  # @return [Array<String>] access values
7
  def self.build(record:, context:)
1✔
UNCOV
8
    new(record:, context:).build
×
9
  end
10

11
  attr_reader :record, :context
1✔
12

13
  # Constructor
14
  # @param record [MARC::Record]
15
  # @param context [Traject::Indexer::Context]
16
  def initialize(record:, context:)
1✔
UNCOV
17
    @record = record
×
UNCOV
18
    @context = context
×
19
  end
20

21
  # @return [Array<String>] access values
22
  def build
1✔
23
    [
UNCOV
24
      electronic_portfolio,
×
25
      in_library,
26
      marc_indicator
27
    ].uniq.compact
28
  end
29

30
  private
1✔
31

32
    def electronic_portfolio
1✔
UNCOV
33
      return 'Online' if context.output_hash['electronic_portfolio_s'].present?
×
34
    end
35

36
    def in_library
1✔
UNCOV
37
      return 'In the Library' if context.output_hash['location_code_s'].present?
×
38
    end
39

40
    # Return 'online' if record has an 856 field and
41
    # it's second indicator is 0, 1, or blank
42
    def marc_indicator
1✔
UNCOV
43
      field = record.find { |f| f.tag == '856' }
×
UNCOV
44
      indicator = field.try(:indicator2)
×
45

UNCOV
46
      return 'Online' if ['0', '1', ' '].include?(indicator)
×
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