rest-ftp-daemon 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd3a1ab299501727eeaaee03461b9bf1c5232560
4
- data.tar.gz: 0a14c32e90788499358d23bfa13e72cabf0db639
3
+ metadata.gz: 4150d62047db1f0bc7c31f6eeed472c89d44a4ac
4
+ data.tar.gz: b1a38cd346b63103e4f6b4b3e450e7cc47e0958a
5
5
  SHA512:
6
- metadata.gz: c0bf20c714364b79b9db0787dde6541f25ddaee5be447288ffc7f89f5fb0ccbc49aaa2583efdf2e23dfcaf9e55ffe307552063a64e1c8cdc3b9663861416bafc
7
- data.tar.gz: 6170a2a82ea2e79a182e6efc5d24958645742f561d7c352b3eac8b35ea08e4c47226ca1a68a87bf977103a70de09bbd3a30925907182904a181cd5a0a960e3c2
6
+ metadata.gz: 355082cdf3eff7b6660fb72ac2ad24448caf036b03e7cfee52682a8a11425328145d4d5561d4e84c1c1f587c4afd25d781e00410d1fbdd102e067e838001bf97
7
+ data.tar.gz: 2ede5c40ad23bf63513a89d6ade5a54ed67fce3b19fe4fd02fda9ac3f84ffa70679bb4f0f201d9e214a66985605f81020caf269330675a14c1a17d20da9985ac
data/.rubocop.yml CHANGED
@@ -776,7 +776,7 @@ Lint/EndAlignment:
776
776
  # The value `variable` means that in assignments, `end` should be aligned
777
777
  # with the start of the variable on the left hand side of `=`. In all other
778
778
  # situations, `end` should still be aligned with the keyword.
779
- AlignWith: keyword
779
+ EnforcedStyleAlignWith: keyword
780
780
  SupportedStyles:
781
781
  - keyword
782
782
  - variable
@@ -787,7 +787,7 @@ Lint/DefEndAlignment:
787
787
  # The value `start_of_line` means that `end` should be aligned with method
788
788
  # calls like `private`, `public`, etc, if present in front of the `def`
789
789
  # keyword on the same line.
790
- AlignWith: start_of_line
790
+ EnforcedStyleAlignWith: start_of_line
791
791
  SupportedStyles:
792
792
  - start_of_line
793
793
  - def
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rest-ftp-daemon (1.0.8)
4
+ rest-ftp-daemon (1.0.9)
5
+ CFPropertyList
5
6
  activesupport (= 4.2.7.1)
6
7
  api-auth
7
8
  aws-sdk-resources (~> 2.6)
@@ -27,7 +28,7 @@ PATH
27
28
  GEM
28
29
  remote: http://rubygems.org/
29
30
  specs:
30
- CFPropertyList (2.2.8)
31
+ CFPropertyList (2.3.5)
31
32
  activesupport (4.2.7.1)
32
33
  i18n (~> 0.7)
33
34
  json (~> 1.7, >= 1.7.7)
@@ -29,20 +29,25 @@ module RestFtpDaemon
29
29
  Root.logger
30
30
  end
31
31
 
32
- def exception_error error, http_code, exception
32
+ def exception_error error, http_code, exception, message = nil
33
33
  # Extract message lines
34
34
  lines = exception.message.lines
35
- #.lines.collect(&:strip).reject(&:empty?)
36
35
 
37
36
  # Log error to file
38
37
  log_error "[#{error}] [#{http_code}] #{lines.shift} ", lines
39
38
 
39
+ # Default to exeption message if empty
40
+ message ||= exception.message
41
+
42
+ # Send it to rollbar
43
+ Rollbar.error exception, "api: #{exception.class.name}: #{exception.message}"
44
+
40
45
  # Return error
41
46
  error!({
42
- error: error,
47
+ code: error,
48
+ message: message,
49
+ exception: exception.class.name,
43
50
  http_code: http_code,
44
- class: exception.class.name,
45
- message: exception.message,
46
51
  }, http_code)
47
52
  end
48
53
 
@@ -54,10 +59,15 @@ module RestFtpDaemon
54
59
 
55
60
 
56
61
  ## 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
+ rescue_from Grape::Exceptions::InvalidMessageBody do |exception|
67
+ exception_error :api_invalid_message_body, 400, exception, "Bad request: message body does not match declared format, check command syntax"
68
+ end
69
+
57
70
  rescue_from :all do |exception|
58
- Rollbar.error exception, "api: #{exception.class.name}: #{exception.message}"
59
- # Rollbar.error exception, "api [#{error}]: #{exception.class.name}: #{exception.message}"
60
- #error!({error: :internal_server_error, message: exception.message}, 500)
61
71
  exception_error :api_error, 500, exception
62
72
  end
63
73
 
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |spec|
3
3
 
4
4
  # Project version
5
- spec.version = "1.0.8"
5
+ spec.version = "1.0.9"
6
6
 
7
7
  # Project description
8
8
  spec.name = "rest-ftp-daemon"
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "http"
32
32
  spec.add_development_dependency "ruby-prof"
33
33
 
34
+
34
35
  # Runtime dependencies
35
36
  spec.add_runtime_dependency "bmc-daemon-lib", "0.7.4"
36
37
  spec.add_runtime_dependency "json", "~> 1.8"
@@ -46,6 +47,7 @@ Gem::Specification.new do |spec|
46
47
  spec.add_runtime_dependency "rest-client", "~> 1.8"
47
48
  spec.add_runtime_dependency "api-auth"
48
49
  spec.add_runtime_dependency "haml"
50
+ spec.add_runtime_dependency "CFPropertyList"
49
51
  spec.add_runtime_dependency "facter"
50
52
  spec.add_runtime_dependency "sys-cpu"
51
53
  spec.add_runtime_dependency "get_process_mem"
@@ -58,4 +60,6 @@ Gem::Specification.new do |spec|
58
60
  spec.add_runtime_dependency "aws-sdk-resources", '~> 2.6'
59
61
  spec.add_runtime_dependency "streamio-ffmpeg"
60
62
 
63
+
64
+
61
65
  end
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.8
4
+ version: 1.0.9
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-02-27 00:00:00.000000000 Z
11
+ date: 2017-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -276,6 +276,20 @@ dependencies:
276
276
  - - ">="
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
+ - !ruby/object:Gem::Dependency
280
+ name: CFPropertyList
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ type: :runtime
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
279
293
  - !ruby/object:Gem::Dependency
280
294
  name: facter
281
295
  requirement: !ruby/object:Gem::Requirement