• 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

12.5
/marc_to_solr/lib/geo.rb
1
# geo.rb
2
# extract geo-related data from MARC
3

4
def decimal_coordinate record
1✔
UNCOV
5
  coverage = []
×
UNCOV
6
  Traject::MarcExtractor.cached('034defg').collect_matching_lines(record) do |field, _spec, _extractor|
×
UNCOV
7
    c = {}
×
UNCOV
8
    field.subfields.each do |s_field|
×
UNCOV
9
      c['w'] = s_field.value if (s_field.code == 'd') && valid_coordinate_format?(s_field.value, record)
×
UNCOV
10
      c['e'] = s_field.value if (s_field.code == 'e') && valid_coordinate_format?(s_field.value, record)
×
UNCOV
11
      c['n'] = s_field.value if (s_field.code == 'f') && valid_coordinate_format?(s_field.value, record)
×
UNCOV
12
      c['s'] = s_field.value if (s_field.code == 'g') && valid_coordinate_format?(s_field.value, record)
×
13
    end
UNCOV
14
    if c.length != 4
×
15
      # turning of geo coordinate logging for now
16
      # logger.error "#{record['001']} - missing coordinate"
UNCOV
17
      break
×
18
    end
19

UNCOV
20
    coverage << "northlimit=#{c['n']}; eastlimit=#{c['e']}; southlimit=#{c['s']}; westlimit=#{c['w']}; units=degrees; projection=EPSG:4326"
×
21
  end
22
  # turning of geo coordinate logging for now
23
  # logger.error "#{record['001']} - multiple 034s" if coverage.length > 1
UNCOV
24
  coverage.first
×
25
end
26

27
def valid_coordinate_format? c, _record
1✔
UNCOV
28
  return false unless /^[-+]?[0-9]*\.?[0-9]+$/.match?(c)
×
29

UNCOV
30
  true
×
31
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