eventq_aws 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2829093c232a92f85bb0257e8af753f9df7af236
4
- data.tar.gz: fd4e165998897facd99d96df866c0ed1b5546edc
3
+ metadata.gz: be0e5d86815ea0284110cf54ea27581f023d18d1
4
+ data.tar.gz: 0992474c9ed02848ff3793771d9a3fda86ef7b28
5
5
  SHA512:
6
- metadata.gz: e69b9dfd2123a622b5d75eb50e7476b595842b4be71e2a8952d7f1cd2067512b1361dd677438e516374ea22bc9adbf8e7a26e01fd9b10eba82aac5fde7ee1d44
7
- data.tar.gz: 19749d2c6c2e5ff7cbf52d3d40d4180e829b8ffa0699d02e82326f65762fc0559c21b9377d4527915bf6c5a24a1fb6ceb33b5ce0f059ad0186c2f169610b6b2a
6
+ metadata.gz: 35622ef4cf05ed21c466fd80eff39843b09f4ea7687eb517e47ff8d335d43c6f60bf4f41a16c30fb7172d2521ca1629a1be4a8c799ad31d031c865541f19446f
7
+ data.tar.gz: 5db89a59cb75293e8c9a8fde5df1f09bf94abe191962029361527b60e7efe5187cedb44a5ddc898af7c0595ba3aa53e052bfbb881d46bec265ce568e7ca53967
@@ -5,7 +5,7 @@ module EventQ
5
5
  def initialize(options)
6
6
 
7
7
  if options[:client] == nil
8
- raise ':client (QueueClient) must be specified.'
8
+ raise ':client (QueueClient) must be specified.'.freeze
9
9
  end
10
10
 
11
11
  @client = options[:client]
@@ -12,7 +12,7 @@ module EventQ
12
12
  end
13
13
 
14
14
  if !options.has_key?(:aws_account_number)
15
- raise ':aws_account_number option must be specified.'
15
+ raise ':aws_account_number option must be specified.'.freeze
16
16
  end
17
17
 
18
18
  @aws_account = options[:aws_account_number]
@@ -51,7 +51,7 @@ module EventQ
51
51
  end
52
52
 
53
53
  def aws_safe_name(name)
54
- name.gsub(':', '')
54
+ return name.gsub(':', '')
55
55
  end
56
56
 
57
57
  end
@@ -2,12 +2,12 @@ module EventQ
2
2
  module Amazon
3
3
  class QueueManager
4
4
 
5
- @@dead_letter_queue = 'dead_letter_archive'
5
+ VISIBILITY_TIMEOUT = 'VisibilityTimeout'.freeze
6
6
 
7
7
  def initialize(options)
8
8
 
9
9
  if options[:client] == nil
10
- raise ':client (QueueClient) must be specified.'
10
+ raise ':client (QueueClient) must be specified.'.freeze
11
11
  end
12
12
 
13
13
  @client = options[:client]
@@ -27,7 +27,7 @@ module EventQ
27
27
  response = @client.sqs.create_queue({
28
28
  queue_name: queue.name,
29
29
  attributes: {
30
- 'VisibilityTimeout' => 300.to_s #5 minutes
30
+ VISIBILITY_TIMEOUT => 300.to_s #5 minutes
31
31
  }
32
32
  })
33
33
 
@@ -60,7 +60,7 @@ module EventQ
60
60
  @client.sqs.set_queue_attributes({
61
61
  queue_url: url, # required
62
62
  attributes: {
63
- 'VisibilityTimeout' => 300.to_s
63
+ VISIBILITY_TIMEOUT => 300.to_s # 5 minutes
64
64
  }
65
65
  })
66
66
  return url
@@ -2,6 +2,9 @@ module EventQ
2
2
  module Amazon
3
3
  class QueueWorker
4
4
 
5
+ APPROXIMATE_RECEIVE_COUNT = 'ApproximateReceiveCount'.freeze
6
+ MESSAGE = 'Message'.freeze
7
+
5
8
  attr_accessor :is_running
6
9
 
7
10
  def initialize
@@ -107,18 +110,18 @@ module EventQ
107
110
  queue_url: q,
108
111
  max_number_of_messages: 1,
109
112
  wait_time_seconds: 1,
110
- attribute_names: ['ApproximateReceiveCount']
113
+ attribute_names: [APPROXIMATE_RECEIVE_COUNT]
111
114
  })
112
115
 
113
116
  #check that a message was received
114
117
  if response.messages.length > 0
115
118
 
116
119
  msg = response.messages[0]
117
- retry_attempts = msg.attributes['ApproximateReceiveCount'].to_i - 1
120
+ retry_attempts = msg.attributes[APPROXIMATE_RECEIVE_COUNT].to_i - 1
118
121
 
119
122
  #deserialize the message payload
120
123
  payload = JSON.load(msg.body)
121
- message = deserialize_message(payload["Message"])
124
+ message = deserialize_message(payload[MESSAGE])
122
125
 
123
126
  message_args = EventQ::MessageArgs.new(message.type, retry_attempts)
124
127
 
@@ -5,13 +5,13 @@ module EventQ
5
5
  def initialize(options)
6
6
 
7
7
  if options[:client] == nil
8
- raise ':client (QueueClient) must be specified.'
8
+ raise "[#{self.class}] - :client (QueueClient) must be specified."
9
9
  end
10
10
 
11
11
  @client = options[:client]
12
12
 
13
13
  if options[:queue_manager] == nil
14
- raise ':queue_manager (QueueManager) must be specified.'
14
+ raise "[#{self.class}] - :queue_manager (QueueManager) must be specified."
15
15
  end
16
16
 
17
17
  @manager = options[:queue_manager]
@@ -27,7 +27,7 @@ module EventQ
27
27
  @client.sqs.set_queue_attributes({
28
28
  queue_url: q,
29
29
  attributes:{
30
- 'Policy' => '{
30
+ 'Policy'.freeze => '{
31
31
  "Version": "2012-10-17",
32
32
  "Id": "SNStoSQS",
33
33
  "Statement": [
@@ -50,7 +50,7 @@ module EventQ
50
50
 
51
51
  @client.sns.subscribe({
52
52
  topic_arn: topic_arn,
53
- protocol: 'sqs',
53
+ protocol: 'sqs'.freeze,
54
54
  endpoint: queue_arn
55
55
  })
56
56
 
@@ -60,7 +60,7 @@ module EventQ
60
60
 
61
61
  def unsubscribe(queue)
62
62
 
63
- raise 'Not implemented. Please unsubscribe the queue from the topic inside the AWS Management Console.'
63
+ raise "[#{self.class}] - Not implemented. Please unsubscribe the queue from the topic inside the AWS Management Console."
64
64
 
65
65
  end
66
66
 
@@ -1,5 +1,5 @@
1
1
  module EventQ
2
2
  module Amazon
3
- VERSION = "1.3.4"
3
+ VERSION = "1.3.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventq_aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaughanbrittonsage
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-09 00:00:00.000000000 Z
11
+ date: 2016-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.11'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.11'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: aws-sdk-core
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: eventq_base
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: hash_kit
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: This is the aws implementation for EventQ
@@ -117,13 +117,13 @@ extra_rdoc_files: []
117
117
  files:
118
118
  - bin/console
119
119
  - bin/setup
120
- - lib/eventq_aws.rb
121
120
  - lib/eventq_aws/aws_eventq_client.rb
122
121
  - lib/eventq_aws/aws_queue_client.rb
123
122
  - lib/eventq_aws/aws_queue_manager.rb
124
123
  - lib/eventq_aws/aws_queue_worker.rb
125
124
  - lib/eventq_aws/aws_subscription_manager.rb
126
125
  - lib/eventq_aws/version.rb
126
+ - lib/eventq_aws.rb
127
127
  homepage: https://github.com/vaughanbrittonsage/eventq
128
128
  licenses:
129
129
  - MIT
@@ -134,18 +134,19 @@ require_paths:
134
134
  - lib
135
135
  required_ruby_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ">="
137
+ - - '>='
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - ">="
142
+ - - '>='
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.5.1
147
+ rubygems_version: 2.0.14.1
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: This is the aws implementation for EventQ
151
151
  test_files: []
152
+ has_rdoc: