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

pulibrary / pdc_describe / 4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

07 Apr 2025 06:36PM UTC coverage: 1.283% (-94.6%) from 95.862%
4e4e59fc-9df4-4838-9fd4-6c7ea33cdb7c

Pull #1994

circleci

hectorcorrea
Switched to use the autocomplete that we aleady use for ROR. Integrated it with the existing logic for creators
Pull Request #1994: Started adding auto complete to contributors

0 of 46 new or added lines in 2 files covered. (0.0%)

4806 existing lines in 74 files now uncovered.

65 of 5065 relevant lines covered (1.28%)

0.01 hits per line

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

0.0
/app/services/pul_dspace_aws_connector.rb
1
# frozen_string_literal: true
UNCOV
2
class PULDspaceAwsConnector
×
UNCOV
3
  attr_reader :work, :ark, :dspace_doi, :migration_snapshot
×
4

UNCOV
5
  def initialize(work, dspace_doi)
×
UNCOV
6
    @work = work
×
UNCOV
7
    @ark = work.ark&.gsub("ark:/", "")
×
UNCOV
8
    @dspace_doi = dspace_doi
×
UNCOV
9
  end
×
10

UNCOV
11
  def upload_to_s3(dspace_files)
×
UNCOV
12
    dspace_files.map do |dspace_file|
×
UNCOV
13
      filename = dspace_file.filename
×
UNCOV
14
      match_dspace_file = dspace_file.clone
×
UNCOV
15
      basename = File.basename(dspace_file.filename_display)
×
UNCOV
16
      match_dspace_file.filename = dspace_file.filename_display
×
UNCOV
17
      io = File.open(filename)
×
UNCOV
18
      size = File.size(filename)
×
UNCOV
19
      key = work.s3_query_service.upload_file(io:, filename: basename, md5_digest: dspace_file.checksum, size:)
×
UNCOV
20
      if key
×
UNCOV
21
        { key:, file: match_dspace_file, error: nil }
×
UNCOV
22
      else
×
UNCOV
23
        { key: nil, file: match_dspace_file, error: "An error uploading #{filename}.  Please try again." }
×
UNCOV
24
      end
×
UNCOV
25
    end
×
UNCOV
26
  end
×
27

UNCOV
28
  def aws_files
×
UNCOV
29
    return [] if ark.nil? || dspace_doi.nil?
×
UNCOV
30
    @aws_files ||= work.s3_query_service.client_s3_files(reload: true, bucket_name: dspace_bucket_name, prefix: dspace_doi.tr(".", "-"))
×
UNCOV
31
  end
×
32

UNCOV
33
  private
×
34

UNCOV
35
    def dspace_bucket_name
×
UNCOV
36
      @dspace_bucket_name ||= Rails.configuration.s3.dspace[:bucket]
×
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