rest-ftp-daemon 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +45 -44
- data/lib/rest-ftp-daemon/api/root.rb +12 -5
- data/lib/rest-ftp-daemon/constants.rb +1 -0
- data/lib/rest-ftp-daemon/jobs/errors.rb +0 -1
- data/lib/rest-ftp-daemon/location.rb +7 -5
- 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: 8b4fcd8815838898224c5d74c5c3fcc2612487af
|
|
4
|
+
data.tar.gz: 56826233e4ec35d6551b2f21370b07433c41db7b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 11970060c0b2cb72f7d0e2301f9eb496000a4f9999aa84c709e416d4d48ca8c9ccd419868452971e259ae7a5d9fe05f7863c876c3f032fe77378bb431e2279d2
|
|
7
|
+
data.tar.gz: 4396336daa3b239d29dbaec967f18c2a89fe44109359c6da0fdd3cea73cc8accbd2085c517ce715e21f8078f6c58373af8634ff1a7bf161c651207f0ebaee148
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rest-ftp-daemon (1.0.
|
|
4
|
+
rest-ftp-daemon (1.0.10)
|
|
5
5
|
CFPropertyList
|
|
6
6
|
activesupport (= 4.2.7.1)
|
|
7
7
|
api-auth
|
|
@@ -35,15 +35,15 @@ GEM
|
|
|
35
35
|
minitest (~> 5.1)
|
|
36
36
|
thread_safe (~> 0.3, >= 0.3.4)
|
|
37
37
|
tzinfo (~> 1.1)
|
|
38
|
-
addressable (2.5.
|
|
38
|
+
addressable (2.5.1)
|
|
39
39
|
public_suffix (~> 2.0, >= 2.0.2)
|
|
40
40
|
api-auth (2.1.0)
|
|
41
41
|
ast (2.3.0)
|
|
42
|
-
aws-sdk-core (2.
|
|
42
|
+
aws-sdk-core (2.9.21)
|
|
43
43
|
aws-sigv4 (~> 1.0)
|
|
44
44
|
jmespath (~> 1.0)
|
|
45
|
-
aws-sdk-resources (2.
|
|
46
|
-
aws-sdk-core (= 2.
|
|
45
|
+
aws-sdk-resources (2.9.21)
|
|
46
|
+
aws-sdk-core (= 2.9.21)
|
|
47
47
|
aws-sigv4 (1.0.0)
|
|
48
48
|
axiom-types (0.1.1)
|
|
49
49
|
descendants_tracker (~> 0.0.4)
|
|
@@ -59,19 +59,18 @@ GEM
|
|
|
59
59
|
coercible (1.0.0)
|
|
60
60
|
descendants_tracker (~> 0.0.1)
|
|
61
61
|
daemons (1.2.4)
|
|
62
|
-
declarative (0.0.
|
|
63
|
-
|
|
62
|
+
declarative (0.0.9)
|
|
63
|
+
declarative-option (0.1.0)
|
|
64
64
|
descendants_tracker (0.0.4)
|
|
65
65
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
66
|
-
diff-lcs (1.
|
|
67
|
-
domain_name (0.5.
|
|
66
|
+
diff-lcs (1.3)
|
|
67
|
+
domain_name (0.5.20170404)
|
|
68
68
|
unf (>= 0.0.5, < 1.0.0)
|
|
69
69
|
double-bag-ftps (0.1.3)
|
|
70
70
|
equalizer (0.0.11)
|
|
71
|
-
eventmachine (1.2.
|
|
71
|
+
eventmachine (1.2.3)
|
|
72
72
|
facter (2.4.6)
|
|
73
|
-
|
|
74
|
-
ffi (1.9.17)
|
|
73
|
+
ffi (1.9.18)
|
|
75
74
|
get_process_mem (0.2.1)
|
|
76
75
|
grape (0.19.1)
|
|
77
76
|
activesupport
|
|
@@ -91,28 +90,28 @@ GEM
|
|
|
91
90
|
grape-swagger-entity (0.1.5)
|
|
92
91
|
grape-entity
|
|
93
92
|
grape-swagger (>= 0.20.4)
|
|
94
|
-
grape-swagger-representable (0.1.
|
|
95
|
-
grape-swagger (>= 0.20.
|
|
93
|
+
grape-swagger-representable (0.1.4)
|
|
94
|
+
grape-swagger (>= 0.20.4)
|
|
96
95
|
representable
|
|
97
96
|
haml (4.0.7)
|
|
98
97
|
tilt
|
|
99
|
-
hashie (3.
|
|
100
|
-
http (2.
|
|
98
|
+
hashie (3.5.5)
|
|
99
|
+
http (2.2.2)
|
|
101
100
|
addressable (~> 2.3)
|
|
102
101
|
http-cookie (~> 1.0)
|
|
103
102
|
http-form_data (~> 1.0.1)
|
|
104
103
|
http_parser.rb (~> 0.6.0)
|
|
105
104
|
http-cookie (1.0.3)
|
|
106
105
|
domain_name (~> 0.5)
|
|
107
|
-
http-form_data (1.0.
|
|
106
|
+
http-form_data (1.0.3)
|
|
108
107
|
http_parser.rb (0.6.0)
|
|
109
|
-
i18n (0.
|
|
108
|
+
i18n (0.8.1)
|
|
110
109
|
ice_nine (0.11.2)
|
|
111
110
|
jmespath (1.3.1)
|
|
112
111
|
json (1.8.6)
|
|
113
112
|
method_source (0.8.2)
|
|
114
113
|
mime-types (2.99.3)
|
|
115
|
-
minitest (5.10.
|
|
114
|
+
minitest (5.10.2)
|
|
116
115
|
multi_json (1.12.1)
|
|
117
116
|
multi_xml (0.6.0)
|
|
118
117
|
mustermann (0.4.0)
|
|
@@ -121,10 +120,10 @@ GEM
|
|
|
121
120
|
mustermann (= 0.4.0)
|
|
122
121
|
net-sftp (2.1.2)
|
|
123
122
|
net-ssh (>= 2.6.5)
|
|
124
|
-
net-ssh (4.0
|
|
123
|
+
net-ssh (4.1.0)
|
|
125
124
|
netrc (0.11.0)
|
|
126
125
|
newrelic_rpm (3.17.2.327)
|
|
127
|
-
parser (2.
|
|
126
|
+
parser (2.4.0.0)
|
|
128
127
|
ast (~> 2.2)
|
|
129
128
|
powerpack (0.1.1)
|
|
130
129
|
pry (0.10.4)
|
|
@@ -132,34 +131,36 @@ GEM
|
|
|
132
131
|
method_source (~> 0.8.1)
|
|
133
132
|
slop (~> 3.4)
|
|
134
133
|
public_suffix (2.0.5)
|
|
135
|
-
rack (2.0.
|
|
134
|
+
rack (2.0.3)
|
|
136
135
|
rack-accept (0.4.5)
|
|
137
136
|
rack (>= 0.4)
|
|
138
|
-
rainbow (2.2.
|
|
137
|
+
rainbow (2.2.2)
|
|
138
|
+
rake
|
|
139
139
|
rake (12.0.0)
|
|
140
|
-
representable (3.0.
|
|
141
|
-
declarative (
|
|
142
|
-
|
|
140
|
+
representable (3.0.4)
|
|
141
|
+
declarative (< 0.1.0)
|
|
142
|
+
declarative-option (< 0.2.0)
|
|
143
|
+
uber (< 0.2.0)
|
|
143
144
|
rest-client (1.8.0)
|
|
144
145
|
http-cookie (>= 1.0.2, < 2.0)
|
|
145
146
|
mime-types (>= 1.16, < 3.0)
|
|
146
147
|
netrc (~> 0.7)
|
|
147
|
-
rollbar (2.14.
|
|
148
|
+
rollbar (2.14.1)
|
|
148
149
|
multi_json
|
|
149
|
-
rspec (3.
|
|
150
|
-
rspec-core (~> 3.
|
|
151
|
-
rspec-expectations (~> 3.
|
|
152
|
-
rspec-mocks (~> 3.
|
|
153
|
-
rspec-core (3.
|
|
154
|
-
rspec-support (~> 3.
|
|
155
|
-
rspec-expectations (3.
|
|
150
|
+
rspec (3.6.0)
|
|
151
|
+
rspec-core (~> 3.6.0)
|
|
152
|
+
rspec-expectations (~> 3.6.0)
|
|
153
|
+
rspec-mocks (~> 3.6.0)
|
|
154
|
+
rspec-core (3.6.0)
|
|
155
|
+
rspec-support (~> 3.6.0)
|
|
156
|
+
rspec-expectations (3.6.0)
|
|
156
157
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
157
|
-
rspec-support (~> 3.
|
|
158
|
-
rspec-mocks (3.
|
|
158
|
+
rspec-support (~> 3.6.0)
|
|
159
|
+
rspec-mocks (3.6.0)
|
|
159
160
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
160
|
-
rspec-support (~> 3.
|
|
161
|
-
rspec-support (3.
|
|
162
|
-
rubocop (0.
|
|
161
|
+
rspec-support (~> 3.6.0)
|
|
162
|
+
rspec-support (3.6.0)
|
|
163
|
+
rubocop (0.48.1)
|
|
163
164
|
parser (>= 2.3.3.1, < 3.0)
|
|
164
165
|
powerpack (~> 0.1)
|
|
165
166
|
rainbow (>= 1.99.1, < 3.0)
|
|
@@ -177,16 +178,16 @@ GEM
|
|
|
177
178
|
eventmachine (~> 1.0, >= 1.0.4)
|
|
178
179
|
rack (>= 1, < 3)
|
|
179
180
|
thor (0.19.4)
|
|
180
|
-
thread_safe (0.3.
|
|
181
|
-
tilt (2.0.
|
|
181
|
+
thread_safe (0.3.6)
|
|
182
|
+
tilt (2.0.7)
|
|
182
183
|
tool (0.2.3)
|
|
183
|
-
tzinfo (1.2.
|
|
184
|
+
tzinfo (1.2.3)
|
|
184
185
|
thread_safe (~> 0.1)
|
|
185
186
|
uber (0.1.0)
|
|
186
187
|
unf (0.1.4)
|
|
187
188
|
unf_ext
|
|
188
|
-
unf_ext (0.0.7.
|
|
189
|
-
unicode-display_width (1.1
|
|
189
|
+
unf_ext (0.0.7.4)
|
|
190
|
+
unicode-display_width (1.2.1)
|
|
190
191
|
virtus (1.0.5)
|
|
191
192
|
axiom-types (~> 0.1)
|
|
192
193
|
coercible (~> 1.0)
|
|
@@ -33,6 +33,12 @@ module RestFtpDaemon
|
|
|
33
33
|
# Extract message lines
|
|
34
34
|
lines = exception.message.lines
|
|
35
35
|
|
|
36
|
+
# Add some backtrace lines
|
|
37
|
+
http500_backtrace = LOG_HTP500_BACKTRACE.to_i
|
|
38
|
+
unless LOG_HTP500_BACKTRACE.to_i.zero?
|
|
39
|
+
lines += exception.backtrace[0..http500_backtrace] if exception.backtrace.is_a?(Array)
|
|
40
|
+
end
|
|
41
|
+
|
|
36
42
|
# Log error to file
|
|
37
43
|
log_error "[#{error}] [#{http_code}] #{lines.shift} ", lines
|
|
38
44
|
|
|
@@ -59,14 +65,15 @@ module RestFtpDaemon
|
|
|
59
65
|
|
|
60
66
|
|
|
61
67
|
## EXCEPTION HANDLERS
|
|
62
|
-
# rescue_from Grape::Exceptions::ValidationErrors do |exception|
|
|
63
|
-
# exception_error :api_content_type, 406, exception, "The requested content-type is not supported"
|
|
64
|
-
# end
|
|
65
|
-
|
|
66
68
|
rescue_from Grape::Exceptions::InvalidMessageBody do |exception|
|
|
67
69
|
exception_error :api_invalid_message_body, 400, exception, "Bad request: message body does not match declared format, check command syntax"
|
|
68
70
|
end
|
|
69
|
-
|
|
71
|
+
rescue_from RestFtpDaemon::SchemeUnsupported do |exception|
|
|
72
|
+
exception_error :unsupported_scheme, 422, exception, "Bad request: unsupported scheme"
|
|
73
|
+
end
|
|
74
|
+
rescue_from RestFtpDaemon::LocationParseError do |exception|
|
|
75
|
+
exception_error :location_parse_error, 422, exception, "Bad request: location parse error"
|
|
76
|
+
end
|
|
70
77
|
rescue_from :all do |exception|
|
|
71
78
|
exception_error :api_error, 500, exception
|
|
72
79
|
end
|
|
@@ -24,7 +24,6 @@ module RestFtpDaemon
|
|
|
24
24
|
target_permission_error: RestFtpDaemon::TargetPermissionError,
|
|
25
25
|
target_not_supported: RestFtpDaemon::TargetUnsupported,
|
|
26
26
|
assertion_failed: RestFtpDaemon::AssertionFailed,
|
|
27
|
-
location_parse_error: RestFtpDaemon::LocationParseError,
|
|
28
27
|
|
|
29
28
|
conn_socket_error: SocketError,
|
|
30
29
|
conn_eof: EOFError,
|
|
@@ -27,11 +27,11 @@ module RestFtpDaemon
|
|
|
27
27
|
# Check parameters
|
|
28
28
|
# unless url.is_a? String
|
|
29
29
|
# raise RestFtpDaemon::AssertionFailed, "location/init/string: #{url.inspect}"
|
|
30
|
-
# end
|
|
30
|
+
# end
|
|
31
31
|
debug nil
|
|
32
32
|
|
|
33
33
|
@url = url.clone
|
|
34
|
-
debug :url, url
|
|
34
|
+
debug :url, @url
|
|
35
35
|
@tokens = []
|
|
36
36
|
|
|
37
37
|
# Detect tokens in string
|
|
@@ -39,10 +39,10 @@ module RestFtpDaemon
|
|
|
39
39
|
debug :tokens, @tokens.inspect
|
|
40
40
|
|
|
41
41
|
# First resolve tokens
|
|
42
|
-
resolve_tokens! url
|
|
42
|
+
resolve_tokens! @url
|
|
43
43
|
|
|
44
44
|
# Build URI from parameters
|
|
45
|
-
build_uri url
|
|
45
|
+
build_uri @url
|
|
46
46
|
|
|
47
47
|
# Extract dir and name
|
|
48
48
|
build_dir_name
|
|
@@ -147,8 +147,10 @@ module RestFtpDaemon
|
|
|
147
147
|
|
|
148
148
|
def build_dir_name
|
|
149
149
|
# Store URL parts (remove leading slashes in dir)
|
|
150
|
-
@dir = extract_dirname(@uri.path).gsub(/^\//, '')
|
|
150
|
+
@dir = extract_dirname(@uri.path).to_s.gsub(/^\//, '')
|
|
151
151
|
@name = extract_filename(@uri.path)
|
|
152
|
+
# @dir = File.dirname(@uri.path)
|
|
153
|
+
# @name = File.basename(@uri.path)
|
|
152
154
|
|
|
153
155
|
debug :dir, dir
|
|
154
156
|
debug :name, name
|
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: 1.0.
|
|
4
|
+
version: 1.0.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bruno MEDICI
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|