• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / b3c4a532-5da0-46f8-9c20-20018605a028

21 Mar 2025 08:11PM UTC coverage: 42.257% (-49.9%) from 92.185%
b3c4a532-5da0-46f8-9c20-20018605a028

push

circleci

sandbergja
Move various gems from the default Gemfile group to a more appropriate group

1599 of 3784 relevant lines covered (42.26%)

2.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

27.27
/app/models/scsb/partner_updates/full.rb
1
module Scsb
1✔
2
  class PartnerUpdates
1✔
3
    class Full < Update
1✔
4
      def initialize(dump:, dump_file_type:, timestamp: DateTime.now.to_time)
1✔
5
        super
×
6
      end
7

8
      def self.validate_csv(dump_id, file, institution)
1✔
9
        matches_expected_collections = false
×
10
        raise StandardError, "No metadata files found matching #{institution}" unless file
×
11

12
        csv = CSV.read(file, headers: true)
×
13
        group_ids = csv['Collection Group Id(s)'].first
×
14
        matches_expected_collections = group_ids == '1*2*5*6'
×
15
        filename = File.basename(file)
×
16
        scsb_file_dir = ENV['SCSB_FILE_DIR']
×
17
        destination_filepath = "#{scsb_file_dir}/#{filename}"
×
18
        FileUtils.move(file, destination_filepath)
×
19
        Dump.attach_dump_file(dump_id, destination_filepath, :recap_records_full_metadata)
×
20
        File.unlink(destination_filepath) if File.exist?(destination_filepath)
×
21
        unless matches_expected_collections
×
22
          raise StandardError, "Metadata file indicates that dump for #{institution} does not include the correct Group IDs, not processing. Group ids: #{group_ids}"
×
23
        end
24

25
        matches_expected_collections
×
26
      end
27

28
      def self.download_full_file(institution, extension)
1✔
29
        Scsb::S3Bucket.partner_transfer_client.download_recent(
×
30
          prefix: ENV['SCSB_S3_PARTNER_FULLS'] || 'data-exports/PUL/MARCXml/Full',
31
          output_directory: ENV['SCSB_PARTNER_UPDATE_DIRECTORY'] || '/tmp/updates',
32
          file_filter: /#{institution}.*\.#{extension}/
33
        )
34
      end
35
    end
36
  end
37
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