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

pulibrary / lib_jobs / 296334ab-247f-402e-8c5d-d996b3320917

14 Oct 2025 09:24PM UTC coverage: 96.388% (+0.2%) from 96.205%
296334ab-247f-402e-8c5d-d996b3320917

push

circleci

web-flow
Bring Aspace2alma code into the repository (#981)

* Add aspace helper methods gem

* Add barcode validation

Note that the class name is changed slightly?

* Add ItemRecordConstructor

* Add Resource spec

* Add top container spec

* Bring aspace2alma process in

* Get rubocop passing

286 of 290 new or added lines in 8 files covered. (98.62%)

3683 of 3821 relevant lines covered (96.39%)

1144.95 hits per line

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

66.67
/app/helpers/aspace2alma_helper.rb
1
# frozen_string_literal: true
2

3
module Aspace2almaHelper
1✔
4
  # configure sendoff to alma
5
  def self.alma_sftp(filename)
1✔
NEW
6
    Net::SFTP.start(ENV.fetch('SFTP_HOST', nil), ENV.fetch('SFTP_USERNAME', nil), { password: ENV.fetch('SFTP_PASSWORD', nil) }) do |sftp|
×
NEW
7
      sftp.upload!(filename, File.join('/alma/aspace/', File.basename(filename)))
×
8
    end
9
  end
10

11
  # rename old files so we never send an outdated file by accident
12
  def self.rename_file(original_path, new_path)
1✔
13
    Net::SFTP.start(ENV.fetch('SFTP_HOST', nil), ENV.fetch('SFTP_USERNAME', nil), { password: ENV.fetch('SFTP_PASSWORD', nil) }) do |sftp|
4✔
14
      sftp.stat(original_path) do |response|
4✔
NEW
15
        sftp.rename!(original_path, new_path) if response.ok?
×
16
      end
17
    end
18
  end
19

20
  # remove files in preparation for renaming
21
  def self.remove_file(path)
1✔
22
    Net::SFTP.start(ENV.fetch('SFTP_HOST', nil), ENV.fetch('SFTP_USERNAME', nil), { password: ENV.fetch('SFTP_PASSWORD', nil) }) do |sftp|
4✔
23
      sftp.stat(path) do |response|
4✔
NEW
24
        sftp.remove!(path) if response.ok?
×
25
      end
26
    end
27
  end
28
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