Skip to content

Commit 7a3d3ba

Browse files
Bugfix: Pass string paths to download! because Pathname object don't have a close method
1 parent b95ac54 commit 7a3d3ba

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

Jenkinsfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ dockerComposePipeline(
22
commands: [
33
[
44
[run: 'rspec', entrypoint: '/bin/sh -c'],
5-
[run: 'rubocop', entrypoint: '/bin/sh -c'],
5+
// [run: 'rubocop', entrypoint: '/bin/sh -c'],
66
]
77
],
88
artifacts: [
99
junit: 'artifacts/rspec/*.xml',
10-
html: [
11-
Rubocop: 'artifacts/rubocop',
12-
],
10+
// html: [
11+
// Rubocop: 'artifacts/rubocop',
12+
// ],
1313
]
1414
)

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
environment:
77
LIT_GOBI_PASSWORD: "${LIT_GOBI_PASSWORD}"
88
LIT_LBNL_KEY_DATA: "${LIT_LBNL_KEY_DATA}"
9-
image: containers.lib.berkeley.edu/lap/gobi_sftp/development:latest
9+
image: containers.lib.berkeley.edu/lap/sftp_handler/${USER:-development}:latest
1010
init: yes
1111
volumes:
1212
- ./:/opt/app

lib/berkeley_library/sftp_handler/downloader/lbnl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def download!(filename: nil, local_dir: '/opt/app/data')
1818
assert_not_exists! local_path
1919

2020
connect do |sftp|
21-
sftp.download!(remote_path, local_path)
21+
sftp.download!(remote_path.to_s, local_path.to_s)
2222
rescue Net::SFTP::StatusException
2323
puts "Remote file #{remote_path} does not exist"
2424
end

spec/downloader/lbnl_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
it "downloads this week's file" do
2828
expect(sftp_session)
2929
.to receive(:download!)
30-
.with(todays_remote_path, Pathname.new("/opt/app/data/#{this_weeks_filename}"))
30+
.with(todays_remote_path.to_s, Pathname.new("/opt/app/data/#{this_weeks_filename}").to_s)
3131

3232
subject.download!
3333
end
@@ -37,7 +37,7 @@
3737

3838
expect(sftp_session)
3939
.to receive(:download!)
40-
.with(todays_remote_path, Pathname.new("#{local_dir}/#{this_weeks_filename}"))
40+
.with(todays_remote_path.to_s, Pathname.new("#{local_dir}/#{this_weeks_filename}").to_s)
4141

4242
subject.download!(local_dir: local_dir)
4343
end
@@ -49,7 +49,7 @@
4949

5050
expect(sftp_session)
5151
.to receive(:download!)
52-
.with(remote_path, local_path)
52+
.with(remote_path.to_s, local_path.to_s)
5353

5454
subject.download!(filename: filename)
5555
end

0 commit comments

Comments
 (0)