opener-daemons 2.3.0 → 2.3.1

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: d343e353902637e8107d0fae767b78ae6f1d5088
4
- data.tar.gz: ca6e691a8224d1d8b9fdc10e1fa60b688f4e13c3
3
+ metadata.gz: 081edcf7e60af228857624b50af9619ff3fb0118
4
+ data.tar.gz: 4bb69b101678efd7b05bfe222a92fd211c13db59
5
5
  SHA512:
6
- metadata.gz: c4e8da4cb952e4168d1e82dcb7c1a50e60558355618919ed33f0384ea8ebfe948701eb369367dde02fab5f1b5c6894a7de0994ed501bba516331e30978eaf228
7
- data.tar.gz: c5b0205a179c591d1389c62696aae256e2973a6b446a91f5885aacef2229597384a3d4af095bad50ad01e3bee6e42cb3855dc377828da1b4af920d63788d10a4
6
+ metadata.gz: 3f709e600af06649e4e631456a313750d976fbf5fdebbf2b33ae7bfd52e24a3e4d118595892b3dc9277a6880cf0438f1f042e37c9a22948cf9be695c8abff459
7
+ data.tar.gz: 4e52fac8c46818eff00f1a9b3a5cba0b37a6aeb807c71a30dd93b150f2acf630567a61cfa4cd9a3c11f8ef4bb47702ab582aef0952bb85503921ad95af170029
@@ -1,5 +1,5 @@
1
1
  module Opener
2
2
  module Daemons
3
- VERSION = '2.3.0'
3
+ VERSION = '2.3.1'
4
4
  end # Daemons
5
5
  end # Opener
@@ -41,8 +41,35 @@ module Opener
41
41
  def process
42
42
  add_transaction_attributes
43
43
 
44
- input = downloader.download(config.input_url)
45
- output = config.component_instance.run(input)
44
+ begin
45
+ output = run_component
46
+ object = upload_output(output)
47
+
48
+ submit_callbacks(object)
49
+
50
+ # Unsupported languages are handled in a different manner as they can
51
+ # occur quite often. In these cases we _do_ want the data to be sent
52
+ # to the final callback URL (skipping whatever comes before it) so it
53
+ # can act upon it.
54
+ rescue Core::UnsupportedLanguageError
55
+ handle_unsupported_language
56
+ end
57
+ end
58
+
59
+ ##
60
+ # @return [String]
61
+ #
62
+ def run_component
63
+ input = downloader.download(config.input_url)
64
+
65
+ return config.component_instance.run(input)
66
+ end
67
+
68
+ ##
69
+ # @param [String] output
70
+ # @return [AWS::S3::S3Object]
71
+ #
72
+ def upload_output(output)
46
73
  object = uploader.upload(config.identifier, output, config.metadata)
47
74
 
48
75
  Core::Syslog.info(
@@ -50,7 +77,7 @@ module Opener
50
77
  config.metadata
51
78
  )
52
79
 
53
- submit_callbacks(object)
80
+ return object
54
81
  end
55
82
 
56
83
  ##
@@ -74,6 +101,25 @@ module Opener
74
101
  Core::Syslog.info("Submitted response to #{next_url}", config.metadata)
75
102
  end
76
103
 
104
+ ##
105
+ # Sends the unsupported input to the last callback URL.
106
+ #
107
+ def handle_unsupported_language
108
+ last_url = config.callbacks.last
109
+
110
+ callback_handler.post(
111
+ last_url,
112
+ :input_url => config.input_url,
113
+ :identifier => config.identifier,
114
+ :metadata => config.metadata
115
+ )
116
+
117
+ Core::Syslog.info(
118
+ "Submitted input with an unsupported language to #{last_url}",
119
+ config.metadata
120
+ )
121
+ end
122
+
77
123
  private
78
124
 
79
125
  def add_transaction_attributes
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'aws-sdk', '~> 1.0'
25
25
  spec.add_dependency 'slop', '~> 3.0'
26
26
  spec.add_dependency 'opener-callback-handler', '~> 1.0'
27
- spec.add_dependency 'opener-core', '~> 2.0'
27
+ spec.add_dependency 'opener-core', '~> 2.3'
28
28
  spec.add_dependency 'newrelic_rpm'
29
29
  spec.add_dependency 'json-schema'
30
30
  spec.add_dependency 'rollbar', '~> 1.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opener-daemons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wilco van Duinkerken
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-03 00:00:00.000000000 Z
12
+ date: 2014-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '2.0'
62
+ version: '2.3'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '2.0'
69
+ version: '2.3'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: newrelic_rpm
72
72
  requirement: !ruby/object:Gem::Requirement