aws-broker 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/aws/broker/base.rb +9 -1
- data/lib/aws/broker/config.rb +4 -3
- data/lib/aws/broker/subscriber.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e55ec09b5dfe5a8343300e6e925e0061c8ad2892
|
4
|
+
data.tar.gz: ab7380dca0974b5f07bbf8d9c12c38378fdf7f15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 550bfefa10a343e8e8054bc664566728614264fb9b1ddb47fcd6291e967d306f7420fcd1b3f07effee986d73adb7995091c54e717aec576c223ab19a2478d5a6
|
7
|
+
data.tar.gz: e2bf6de6ac1b0b26a9b1bfcc79a533cd8a01d77d9641bb23388683784e3131b854fb9b44f735372abe8ca55fe16402fb22fd1ae6c6c3b202122088d88a17525c
|
data/README.md
CHANGED
@@ -26,8 +26,7 @@ Message processing is not part of this gem - we recommend using
|
|
26
26
|
# subscribe topic to specified queue
|
27
27
|
Broker.subscribe(topic, queue)
|
28
28
|
|
29
|
-
# subscribe topic to default queue
|
30
|
-
# "topic" or "prefix-topic" (see options)
|
29
|
+
# subscribe topic to default queue (see wiki)
|
31
30
|
Broker.subscribe(topic)
|
32
31
|
|
33
32
|
# publish message to topic
|
data/lib/aws/broker/base.rb
CHANGED
@@ -9,7 +9,15 @@ module Aws
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def create_topic
|
12
|
-
@topic_arn = sns.create_topic(name:
|
12
|
+
@topic_arn = sns.create_topic(name: topic_name).topic_arn
|
13
|
+
end
|
14
|
+
|
15
|
+
def topic_name
|
16
|
+
if config.topic_prefix
|
17
|
+
"#{config.topic_prefix}:#{@topic}"
|
18
|
+
else
|
19
|
+
@topic
|
20
|
+
end
|
13
21
|
end
|
14
22
|
|
15
23
|
def sns
|
data/lib/aws/broker/config.rb
CHANGED
@@ -2,12 +2,13 @@ module Aws
|
|
2
2
|
class Broker
|
3
3
|
class Config
|
4
4
|
|
5
|
-
attr_accessor :enabled, :queue_prefix
|
5
|
+
attr_accessor :enabled, :queue_prefix, :topic_prefix
|
6
6
|
alias_method :enabled?, :enabled
|
7
7
|
|
8
8
|
def initialize
|
9
|
-
self.enabled
|
10
|
-
self.queue_prefix
|
9
|
+
self.enabled = true
|
10
|
+
self.queue_prefix = nil
|
11
|
+
self.topic_prefix = nil
|
11
12
|
end
|
12
13
|
|
13
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eng @ Thanx
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-sns
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
76
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.
|
77
|
+
rubygems_version: 2.6.13
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: AWS Broker
|