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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b938dd1e263fd48b2cc64c96655f5aff24f78b6
4
- data.tar.gz: 52ebfad9aea471cb056d45b937df66f4935aa588
3
+ metadata.gz: e55ec09b5dfe5a8343300e6e925e0061c8ad2892
4
+ data.tar.gz: ab7380dca0974b5f07bbf8d9c12c38378fdf7f15
5
5
  SHA512:
6
- metadata.gz: 06483e64b65a4d5c50b945ac002dc26923bc181e3f4ac7135738cbd17bfcd2dfa80ec11736973571898e004c8d60bd5e3052c8c2491741fc241e2759a36ea5a0
7
- data.tar.gz: 1473da73a1c476be4fe019da90ad20be2fb31cd29787950e1b61b9d94389a4066389a68cf488abc3aa81b68dd77945f431edfcf87265668fba8dbde9dd78ccd7
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
@@ -9,7 +9,15 @@ module Aws
9
9
  end
10
10
 
11
11
  def create_topic
12
- @topic_arn = sns.create_topic(name: @topic).topic_arn
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
@@ -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 = true
10
- self.queue_prefix = nil
9
+ self.enabled = true
10
+ self.queue_prefix = nil
11
+ self.topic_prefix = nil
11
12
  end
12
13
 
13
14
  end
@@ -26,9 +26,9 @@ module Aws
26
26
 
27
27
  def queue_name
28
28
  if config.queue_prefix
29
- "#{config.queue_prefix}-#{@topic}"
29
+ "#{config.queue_prefix}-#{topic_name}"
30
30
  else
31
- @topic
31
+ topic_name
32
32
  end
33
33
  end
34
34
 
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.5
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-27 00:00:00.000000000 Z
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.5.1
77
+ rubygems_version: 2.6.13
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: AWS Broker