rest-ftp-daemon 0.304.0 → 0.305.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/defaults.yml +1 -0
- data/lib/rest-ftp-daemon/api/root.rb +3 -0
- data/lib/rest-ftp-daemon/job.rb +19 -14
- data/rest-ftp-daemon.gemspec +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2802386f8b827e27d25b54c13cc87fd53eb2e1f
|
4
|
+
data.tar.gz: e7025e6844c9469ff02b1a1eb3c1bf204d6910c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9dff222b7810f70a7cba87452ef23e19c1d8dfac637e0dbe7ca3d6ec2a50bf7a6cabf2cd1da5f68a5de88b58b3abb694c6ff3ee79f9955f809bf5bb1d976e36
|
7
|
+
data.tar.gz: 9578b8b8521da9e393fed22a119caf8343bc9a9d5df56eae2e4b685a6f705b9d3033be38f340e6731e36e611c1783e5ea618cd5703a67cd5acd7c92adec28eeb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/defaults.yml
CHANGED
data/lib/rest-ftp-daemon/job.rb
CHANGED
@@ -156,11 +156,20 @@ module RestFtpDaemon
|
|
156
156
|
rescue OpenSSL::SSL::SSLError => exception
|
157
157
|
return oops :ended, exception, "conn_openssl_error"
|
158
158
|
|
159
|
+
rescue Net::FTPReplyError => exception
|
160
|
+
return oops :ended, exception, "ftp_reply_error"
|
161
|
+
|
162
|
+
rescue Net::FTPTempError => exception
|
163
|
+
return oops :ended, exception, "ftp_temp_error"
|
164
|
+
|
159
165
|
rescue Net::FTPPermError => exception
|
160
166
|
return oops :ended, exception, "ftp_perm_error"
|
161
167
|
|
162
|
-
rescue Net::
|
163
|
-
return oops :ended, exception, "
|
168
|
+
rescue Net::FTPProtoError => exception
|
169
|
+
return oops :ended, exception, "ftp_proto_error"
|
170
|
+
|
171
|
+
rescue Net::FTPError => exception
|
172
|
+
return oops :ended, exception, "ftp_error"
|
164
173
|
|
165
174
|
rescue Net::SFTP::StatusException => exception
|
166
175
|
return oops :ended, exception, "sftp_exception"
|
@@ -313,30 +322,21 @@ module RestFtpDaemon
|
|
313
322
|
set_info :target, :host, target_uri.host
|
314
323
|
@target_path = Path.new target_uri.path, true
|
315
324
|
|
316
|
-
#
|
317
|
-
|
318
|
-
# Prepare remote
|
319
|
-
#FIXME: use a "case" statement on @target_url.class
|
320
|
-
|
325
|
+
# Prepare remote (case would be preferable but too hard to use,
|
326
|
+
# as target could be of a descendent class of URI:XXX and not matching directlry)
|
321
327
|
if target_uri.is_a? URI::FTP
|
322
328
|
log_info "Job.prepare target_method FTP"
|
323
|
-
# set_info :target, :method, :ftp
|
324
329
|
set_info :target, :method, JOB_METHOD_FTP
|
325
|
-
#@target_method = :ftp
|
326
330
|
@remote = RemoteFTP.new target_uri, log_prefix, debug: @config[:debug_ftp]
|
327
331
|
|
328
332
|
elsif (target_uri.is_a? URI::FTPES) || (target_uri.is_a? URI::FTPS)
|
329
333
|
log_info "Job.prepare target_method FTPES"
|
330
|
-
# set_info :target, :method, :ftpes
|
331
334
|
set_info :target, :method, JOB_METHOD_FTPS
|
332
|
-
|
333
|
-
@remote = RemoteFTP.new target_uri, log_prefix, debug: @config[:debug_sftp], ftpes: true
|
335
|
+
@remote = RemoteFTP.new target_uri, log_prefix, debug: @config[:debug_ftps], ftpes: true
|
334
336
|
|
335
337
|
elsif target_uri.is_a? URI::SFTP
|
336
338
|
log_info "Job.prepare target_method SFTP"
|
337
|
-
# set_info :target, :method, :sftp
|
338
339
|
set_info :target, :method, JOB_METHOD_SFTP
|
339
|
-
# @target_method = :sftp
|
340
340
|
@remote = RemoteSFTP.new target_uri, log_prefix, debug: @config[:debug_sftp]
|
341
341
|
|
342
342
|
else
|
@@ -386,6 +386,7 @@ module RestFtpDaemon
|
|
386
386
|
|
387
387
|
# Handle each source file matched, and start a transfer
|
388
388
|
source_processed = 0
|
389
|
+
targets = []
|
389
390
|
sources.each do |source|
|
390
391
|
# Compute target filename
|
391
392
|
full_target = @target_path.clone
|
@@ -398,6 +399,10 @@ module RestFtpDaemon
|
|
398
399
|
# Do the transfer, for each file
|
399
400
|
remote_push source, full_target
|
400
401
|
|
402
|
+
# Add it to transferred target names
|
403
|
+
targets << full_target.full
|
404
|
+
set_info :target, :files, targets
|
405
|
+
|
401
406
|
# Update counters
|
402
407
|
set_info :source, :processed, source_processed += 1
|
403
408
|
end
|
data/rest-ftp-daemon.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
|
4
4
|
# Project version
|
5
|
-
spec.version = "0.
|
5
|
+
spec.version = "0.305.0"
|
6
6
|
|
7
7
|
# Project description
|
8
8
|
spec.name = "rest-ftp-daemon"
|
@@ -16,7 +16,9 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
|
18
18
|
# List files and executables
|
19
|
-
spec.files = `git ls-files -z`.
|
19
|
+
spec.files = `git ls-files -z`.
|
20
|
+
split("\x0").
|
21
|
+
reject{ |f| f =~ /^dashboard.+\.png/ }
|
20
22
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
23
|
spec.require_paths = ["lib"]
|
22
24
|
spec.required_ruby_version = ">= 2.2"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-ftp-daemon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.305.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno MEDICI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|