conrad 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
  SHA256:
3
- metadata.gz: e96b6146bf06c4a7e186558757e061af57b5dc1b8ac7d2129a78cf6ca9ccae14
4
- data.tar.gz: e1f8ded64e5f68c115722e266615e3cd13c0c430cdfcd75ba59c6ffa2f70ecba
3
+ metadata.gz: b41619922ba6057aff0e0c1132b13ebd674e897f6edd141a7f4fc2ce6c8fad70
4
+ data.tar.gz: 381de5251326c319d50f1c4d6d2af93a1b00ffca594f5b3e423647c105cfb75a
5
5
  SHA512:
6
- metadata.gz: 7278ae58a8a6616d3a81b86be52c544214dfec99673a6af824e6265db0ce6a49e202b88068905c4982f6fb3e5c563d87609c66f5c9772d4404ef236d5f8638eb
7
- data.tar.gz: 820d004eec75ca4870c80fda14137fb670fb6549aa543f545459404b17ae3e40d4ebf5be4aae6a570971b06c10bf262a8d3dfa578a4374d1e32310b8a7d21583
6
+ metadata.gz: f1d65e6a2141b159ee97077ecaa4cb9917edc060b5611736a17146e7f37daea7ce88984380d89ad6ddba30ef55ba3d1c7c81be717506bb1eafa1029e7c176f1a
7
+ data.tar.gz: 1455dbf8b1ac7b2a39c78c61fd000508d2cb222fa75c13aac7105f4a296a9667ccf2bc102bd9692583da303dacd8cee2aad03b28d4f68b431f503acb01bcf5e8
@@ -13,7 +13,7 @@ module Conrad
13
13
  class InvalidAwsCredentials < ::Conrad::Error
14
14
  # :nodoc:
15
15
  def to_s
16
- 'Must provide secret_access_key, access_key_id, and region OR rely ' \
16
+ 'Must provide secret_access_key and access_key_id OR rely ' \
17
17
  'on configured values in the running environment.'
18
18
  end
19
19
  end
@@ -21,7 +21,6 @@ module Conrad
21
21
  # @return [String] the configured SQS queue URL
22
22
  attr_reader :queue_url
23
23
 
24
- # @deprecated Will be removed in 3.0.0, no migration path
25
24
  # @return [String, nil] the configured region
26
25
  attr_reader :region
27
26
 
@@ -41,9 +40,11 @@ module Conrad
41
40
  # @param access_key_id [String] AWS Acesss Key ID
42
41
  # @param secret_access_key [String] AWS Secret Access Key
43
42
  #
44
- # @raise [InvalidAwsCredentials] if any of region, access_key_id, or
45
- # secret_access_key are not provided AND the running environment does
46
- # not have valid AWS credentials
43
+ # @raise [InvalidAwsCredentials] if access_key_id or secret_access_key are
44
+ # not provided AND the running environment does not have valid AWS
45
+ # credentials
46
+ # @raise [Aws::Errors::MissingRegionError] if region is not provided and
47
+ # also not set via an allowed AWS environment variable
47
48
  def initialize(queue_url:, region: nil, access_key_id: nil, secret_access_key: nil)
48
49
  @queue_url = queue_url
49
50
  @region = region
@@ -54,6 +55,8 @@ module Conrad
54
55
  end
55
56
 
56
57
  # Sends an event up to SQS
58
+ #
59
+ # @param event [String] the event to be sent as an SQS message body
57
60
  def call(event)
58
61
  client.send_message(queue_url: queue_url, message_body: event)
59
62
  end
@@ -61,16 +64,16 @@ module Conrad
61
64
  private
62
65
 
63
66
  def create_client(region:, access_key_id:, secret_access_key:)
64
- if secret_access_key.nil? || access_key_id.nil? || region.nil?
67
+ if secret_access_key.nil? || access_key_id.nil?
65
68
  validate_implicit_credentials
66
69
 
67
- @client = Aws::SQS::Client.new
70
+ @client = Aws::SQS::Client.new({ region: region }.compact)
68
71
  else
69
- @client = Aws::SQS::Client.new(
72
+ @client = Aws::SQS::Client.new({
70
73
  region: region,
71
74
  access_key_id: access_key_id,
72
75
  secret_access_key: secret_access_key
73
- )
76
+ }.compact)
74
77
  end
75
78
  end
76
79
 
@@ -1,5 +1,5 @@
1
1
  # :nodoc:
2
2
  module Conrad
3
3
  # :nodoc:
4
- VERSION = '2.3.0'.freeze
4
+ VERSION = '2.3.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conrad
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
  - Jonathon Anderson