opener-daemons 2.4.3 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opener/daemons/daemon.rb +1 -5
- data/lib/opener/daemons/uploader.rb +12 -26
- data/lib/opener/daemons/version.rb +1 -1
- data/lib/opener/daemons/worker.rb +2 -2
- data/lib/opener/daemons.rb +1 -1
- data/opener-daemons.gemspec +3 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f3c8a043044a495e03b0dacdad8a67b68d7a1a5
|
4
|
+
data.tar.gz: 073bc78c6d4526e5fa0fc92df9ec232d547f740d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 862ef276d46a65078f5f47c39712f0d0e42f3338ebae5f1bc64ecc6a8989b95a9c6855c7cb2ff5cb3c0cd981ead18f9b0957ea7c084d08c3dd6d3dda7bb0bb93
|
7
|
+
data.tar.gz: 4d56bf239321c51ee2c59580e19eed90e3df3d3cb8b72a7336dc85a718ae54c02da8c3e6374df4bb210252cdf60d94b8e6a43d8d817a0257ac2edfe96bfc3c7a
|
@@ -54,11 +54,7 @@ module Opener
|
|
54
54
|
|
55
55
|
NewRelic::Agent.manual_start if Daemons.newrelic?
|
56
56
|
|
57
|
-
|
58
|
-
# on both JRuby and Rubinius from time to time.
|
59
|
-
AWS.eager_autoload!(AWS::Core)
|
60
|
-
AWS.eager_autoload!(AWS::SQS)
|
61
|
-
AWS.eager_autoload!(AWS::S3)
|
57
|
+
Aws.eager_autoload!(:services => %w{S3 SQS})
|
62
58
|
end
|
63
59
|
|
64
60
|
##
|
@@ -1,56 +1,42 @@
|
|
1
1
|
module Opener
|
2
2
|
module Daemons
|
3
|
-
##
|
4
3
|
# Class for uploading KAF documents to Amazon S3.
|
5
|
-
#
|
6
4
|
class Uploader
|
7
|
-
##
|
8
5
|
# Uploads the given KAF document.
|
9
6
|
#
|
10
7
|
# @param [String] identifier
|
11
8
|
# @param [String] document
|
12
9
|
# @param [Hash] metadata description
|
13
10
|
#
|
14
|
-
# @return [
|
15
|
-
#
|
11
|
+
# @return [Aws::S3::Object]
|
16
12
|
def upload(identifier, document, metadata = {})
|
17
13
|
object = create(
|
18
14
|
"#{SecureRandom.hex}/#{identifier}.xml",
|
19
15
|
document,
|
20
16
|
:metadata => metadata,
|
21
17
|
:content_type => 'application/xml',
|
22
|
-
:acl =>
|
18
|
+
:acl => 'public-read'
|
23
19
|
)
|
24
20
|
|
25
21
|
return object
|
26
22
|
end
|
27
23
|
|
28
|
-
|
29
|
-
# @param [
|
30
|
-
# @
|
31
|
-
#
|
32
|
-
def create(
|
33
|
-
|
34
|
-
|
35
|
-
if object.is_a?(AWS::S3::ObjectVersion)
|
36
|
-
object = object.object
|
37
|
-
end
|
38
|
-
|
39
|
-
return object
|
24
|
+
# @param [String] key
|
25
|
+
# @param [String] body
|
26
|
+
# @param [Hash] options
|
27
|
+
# @return [Aws::S3::Object]
|
28
|
+
def create(key, body, options = {})
|
29
|
+
bucket.put_object(options.merge(:key => key, :body => body))
|
40
30
|
end
|
41
31
|
|
42
|
-
|
43
|
-
# @return [AWS::S3.new]
|
44
|
-
#
|
32
|
+
# @return [Aws::S3::Resource]
|
45
33
|
def s3
|
46
|
-
|
34
|
+
@s3 ||= Aws::S3::Resource.new
|
47
35
|
end
|
48
36
|
|
49
|
-
|
50
|
-
# @return [AWS::S3::Bucket]
|
51
|
-
#
|
37
|
+
# @return [Aws::S3::Bucket]
|
52
38
|
def bucket
|
53
|
-
|
39
|
+
@bucket ||= s3.bucket(Daemons.output_bucket)
|
54
40
|
end
|
55
41
|
end # Uploader
|
56
42
|
end # Daemons
|
@@ -67,7 +67,7 @@ module Opener
|
|
67
67
|
|
68
68
|
##
|
69
69
|
# @param [String] output
|
70
|
-
# @return [
|
70
|
+
# @return [Aws::S3::Object]
|
71
71
|
#
|
72
72
|
def upload_output(output)
|
73
73
|
object = uploader.upload(config.identifier, output, config.metadata)
|
@@ -83,7 +83,7 @@ module Opener
|
|
83
83
|
##
|
84
84
|
# Sends the object's URL to the next callback URL.
|
85
85
|
#
|
86
|
-
# @param [
|
86
|
+
# @param [Aws::S3::Object] object
|
87
87
|
#
|
88
88
|
def submit_callbacks(object)
|
89
89
|
urls = config.callbacks.dup
|
data/lib/opener/daemons.rb
CHANGED
data/opener-daemons.gemspec
CHANGED
@@ -21,14 +21,14 @@ Gem::Specification.new do |spec|
|
|
21
21
|
'README.md'
|
22
22
|
]).select { |file| File.file?(file) }
|
23
23
|
|
24
|
-
spec.add_dependency 'aws-sdk', '~>
|
24
|
+
spec.add_dependency 'aws-sdk', '~> 2.0'
|
25
25
|
spec.add_dependency 'slop', '~> 3.0'
|
26
|
-
spec.add_dependency 'opener-callback-handler', '~> 1.
|
26
|
+
spec.add_dependency 'opener-callback-handler', '~> 1.1'
|
27
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'
|
31
|
-
spec.add_dependency 'oni', '~>
|
31
|
+
spec.add_dependency 'oni', '~> 4.0'
|
32
32
|
|
33
33
|
spec.add_dependency 'httpclient', ['~> 2.0', '>= 2.5.3.3']
|
34
34
|
|
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.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wilco van Duinkerken
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '2.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '2.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: slop
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '1.
|
48
|
+
version: '1.1'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '1.
|
55
|
+
version: '1.1'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: opener-core
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,14 +115,14 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: '
|
118
|
+
version: '4.0'
|
119
119
|
type: :runtime
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '
|
125
|
+
version: '4.0'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: httpclient
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|