rest-ftp-daemon 0.432.0 → 0.433.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 +2 -2
- data/lib/rest-ftp-daemon/location.rb +1 -1
- data/lib/rest-ftp-daemon/remote/base.rb +8 -3
- data/lib/rest-ftp-daemon/remote/ftp.rb +14 -8
- data/lib/rest-ftp-daemon/remote/sftp.rb +1 -2
- data/lib/rest-ftp-daemon/static/css/main.css +1 -6
- data/lib/rest-ftp-daemon/views/dashboard_footer.haml +1 -1
- data/rest-ftp-daemon.gemspec +1 -1
- 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: 9e668f8f43effe91b3332111a2963abb1011343c
|
4
|
+
data.tar.gz: 79bc3e98795a91cdef80609096b15fc9606f4a6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a06749631bb61dd15e9ef0556e8909fd6ca75ab32d944e70a854533a8caa9e50854fd13942b2fa11dda2dfea2f098dbf15c9fdd2e123c00971911f35f7ce396
|
7
|
+
data.tar.gz: c6ae3a6914a80a1c932947f63be90d8d9a722134411839cdfa6d0694e8c3555ac86dac8b9afdbc923561489c0993186c61811d49b375a981f8fa4dbae0b8513a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rest-ftp-daemon (0.
|
4
|
+
rest-ftp-daemon (0.433.0)
|
5
5
|
activesupport (~> 4.2)
|
6
6
|
api-auth
|
7
7
|
aws-sdk-resources (~> 2)
|
@@ -110,7 +110,7 @@ GEM
|
|
110
110
|
jmespath (1.3.1)
|
111
111
|
json (1.8.3)
|
112
112
|
method_source (0.8.2)
|
113
|
-
mime-types (2.99.
|
113
|
+
mime-types (2.99.3)
|
114
114
|
minitest (5.9.0)
|
115
115
|
multi_json (1.12.1)
|
116
116
|
multi_xml (0.5.5)
|
@@ -42,7 +42,7 @@ module RestFtpDaemon
|
|
42
42
|
# Ensure result does not contain tokens after replacement
|
43
43
|
detected_tokens = detect_tokens(location_uri)
|
44
44
|
unless detected_tokens.empty?
|
45
|
-
raise RestFtpDaemon::JobUnresolvedTokens, detected_tokens.join(' ')
|
45
|
+
raise RestFtpDaemon::JobUnresolvedTokens, 'unresolved tokens: ' + detected_tokens.join(' ')
|
46
46
|
end
|
47
47
|
|
48
48
|
# Parse URL and do specific initializations
|
@@ -63,12 +63,17 @@ module RestFtpDaemon
|
|
63
63
|
|
64
64
|
private
|
65
65
|
|
66
|
-
def
|
66
|
+
def split_path path
|
67
67
|
return unless path.is_a? String
|
68
|
-
|
69
|
-
return m[1], m[2] unless m.nil?
|
68
|
+
return File.dirname(path), File.basename(path)
|
70
69
|
end
|
71
70
|
|
71
|
+
# def extract_parent path
|
72
|
+
# return unless path.is_a? String
|
73
|
+
# m = path.match(/^(.*)\/([^\/]+)\/?$/)
|
74
|
+
# return m[1], m[2] unless m.nil?
|
75
|
+
# end
|
76
|
+
|
72
77
|
def myname
|
73
78
|
self.class.to_s
|
74
79
|
end
|
@@ -60,24 +60,29 @@ module RestFtpDaemon
|
|
60
60
|
raise TargetPermissionError, ex.message
|
61
61
|
end
|
62
62
|
|
63
|
-
def chdir_or_create
|
63
|
+
def chdir_or_create thedir, mkdir = true
|
64
64
|
# Init, extract my parent name and my own name
|
65
|
-
|
66
|
-
parent
|
67
|
-
|
68
|
-
#dirname, _current = extract_parent(directory)
|
69
|
-
|
65
|
+
parent, current = split_path(thedir)
|
66
|
+
log_debug "RemoteFTP.chdir_or_create mkdir[#{mkdir}] dir[#{thedir}] parent[#{parent}] current[#{current}]"
|
70
67
|
|
71
68
|
# Access this directory
|
72
69
|
begin
|
73
|
-
@ftp.chdir "/#{
|
70
|
+
@ftp.chdir "/#{thedir}"
|
74
71
|
|
75
72
|
rescue Net::FTPPermError => _e
|
73
|
+
|
76
74
|
# If not allowed to create path, that's over, we're stuck
|
77
|
-
|
75
|
+
unless mkdir
|
76
|
+
log_debug " [#{thedir}] failed > no mkdir > over"
|
77
|
+
return false
|
78
|
+
end
|
79
|
+
|
80
|
+
# Try to go into my parent directory
|
81
|
+
log_debug " [#{thedir}] failed > chdir_or_create [#{parent}]"
|
78
82
|
chdir_or_create parent, mkdir
|
79
83
|
|
80
84
|
# Now I was able to chdir into my parent, create the current directory
|
85
|
+
log_debug " [#{thedir}] failed > mkdir [#{current}]"
|
81
86
|
mkdir current
|
82
87
|
|
83
88
|
# Finally retry the chdir
|
@@ -85,6 +90,7 @@ module RestFtpDaemon
|
|
85
90
|
else
|
86
91
|
return true
|
87
92
|
end
|
93
|
+
|
88
94
|
end
|
89
95
|
|
90
96
|
def upload source, target, use_temp_name = false, &callback
|
@@ -61,11 +61,10 @@ module RestFtpDaemon
|
|
61
61
|
def chdir_or_create directory, mkdir = false
|
62
62
|
# Init, extract my parent name and my own name
|
63
63
|
log_debug "RemoteSFTP.chdir_or_create mkdir[#{mkdir}] dir[#{directory}]"
|
64
|
-
parent, _current =
|
64
|
+
parent, _current = split_path(directory)
|
65
65
|
|
66
66
|
# Access this directory
|
67
67
|
begin
|
68
|
-
#log_debug "chdir [/#{directory}]"
|
69
68
|
@sftp.opendir! directory
|
70
69
|
|
71
70
|
rescue Net::SFTP::StatusException => _e
|
@@ -14,7 +14,7 @@
|
|
14
14
|
%a{href: "http://refactorcop.com/bmedici/rest-ftp-daemon/", target: TARGET_BLANK} RefactorCop
|
15
15
|
|
16
16
|
·
|
17
|
-
%a{href: MOUNT_SWAGGER_UI, target: TARGET_BLANK} API
|
17
|
+
%a{href: MOUNT_SWAGGER_UI, target: TARGET_BLANK} API
|
18
18
|
|
19
19
|
|
20
20
|
.footer-indicators.indicators.pull-right
|
data/rest-ftp-daemon.gemspec
CHANGED
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.433.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-09-
|
11
|
+
date: 2016-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|