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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 369491bf2439adc202032d470e5c922c2ac68126
4
- data.tar.gz: 30cf51a05d5987faf7a905fd15d100f59c14d79a
3
+ metadata.gz: 6f3c8a043044a495e03b0dacdad8a67b68d7a1a5
4
+ data.tar.gz: 073bc78c6d4526e5fa0fc92df9ec232d547f740d
5
5
  SHA512:
6
- metadata.gz: 619a449d3ead1d4cc6ac90b825f936f79f62c59dad15f031557dd46fd4a16edc3a9d6cb95466d16f58d98f9005c8e8e81410d99e38c184d15f7624f52968af3d
7
- data.tar.gz: 18b0e2c728a08c69d6d3e7e7862faafcb876dab0bd66660aa271765ae7f343fd27fa7754ec8200f6a7098e60841601d05d245f9aef15a0275941915668f7bb4a
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
- # AWS SDK autoloads everything, but this causes constant missing errors
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 [AWS::S3::S3Object]
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 => :public_read
18
+ :acl => 'public-read'
23
19
  )
24
20
 
25
21
  return object
26
22
  end
27
23
 
28
- ##
29
- # @param [Array] args
30
- # @return [AWS::S3::S3Object]
31
- #
32
- def create(*args)
33
- object = bucket.objects.create(*args)
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
- return @s3 ||= AWS::S3.new
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
- return @bucket ||= s3.buckets[Daemons.output_bucket]
39
+ @bucket ||= s3.bucket(Daemons.output_bucket)
54
40
  end
55
41
  end # Uploader
56
42
  end # Daemons
@@ -1,5 +1,5 @@
1
1
  module Opener
2
2
  module Daemons
3
- VERSION = '2.4.3'
3
+ VERSION = '2.5.0'
4
4
  end # Daemons
5
5
  end # Opener
@@ -67,7 +67,7 @@ module Opener
67
67
 
68
68
  ##
69
69
  # @param [String] output
70
- # @return [AWS::S3::S3Object]
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 [AWS::S3::S3Object] object
86
+ # @param [Aws::S3::Object] object
87
87
  #
88
88
  def submit_callbacks(object)
89
89
  urls = config.callbacks.dup
@@ -1,7 +1,7 @@
1
1
  require 'timeout'
2
2
  require 'securerandom'
3
3
 
4
- require 'aws-sdk-v1'
4
+ require 'aws-sdk'
5
5
  require 'httpclient'
6
6
  require 'slop'
7
7
  require 'oni'
@@ -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', '~> 1.0'
24
+ spec.add_dependency 'aws-sdk', '~> 2.0'
25
25
  spec.add_dependency 'slop', '~> 3.0'
26
- spec.add_dependency 'opener-callback-handler', '~> 1.0'
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', '~> 3.0'
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.3
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: '1.0'
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: '1.0'
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.0'
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.0'
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: '3.0'
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: '3.0'
125
+ version: '4.0'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: httpclient
128
128
  requirement: !ruby/object:Gem::Requirement