aws-broker 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws/broker.rb +5 -0
- data/lib/aws/broker/base.rb +5 -5
- data/lib/aws/broker/naming.rb +34 -0
- data/lib/aws/broker/subscriber.rb +1 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19cdefb5feb597317a3522f00f6e7b7455b2d869
|
4
|
+
data.tar.gz: 422c3f690d2cd8a905cb38447fa032e15228825e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da16a81357f08fe560b1b05eb0e04d438cdaa17e1b86653c78fb8d4cd46d7665916206300355e6401040ac36106a2b84063bbc606a66f0014e143e081c6063b0
|
7
|
+
data.tar.gz: 93de674cd455119869fe4eb118069ddfd628a93761d65f0ef64913bd47d357a79b21b859a3c7ad7ffb25c13b87a6f009a8bd74c953abb33b49bd9ab60fd8121e
|
data/lib/aws/broker.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'aws/broker/config'
|
2
|
+
require 'aws/broker/naming'
|
2
3
|
require 'aws/broker/publisher'
|
3
4
|
require 'aws/broker/subscriber'
|
4
5
|
|
@@ -14,6 +15,10 @@ module Aws
|
|
14
15
|
Subscriber.new(*params).subscribe
|
15
16
|
end
|
16
17
|
|
18
|
+
def naming
|
19
|
+
Naming.new
|
20
|
+
end
|
21
|
+
|
17
22
|
def config
|
18
23
|
@config ||= Broker::Config.new
|
19
24
|
end
|
data/lib/aws/broker/base.rb
CHANGED
@@ -18,11 +18,7 @@ module Aws
|
|
18
18
|
# lowercase ASCII letters, numbers, underscores, and hyphens, and must
|
19
19
|
# be between 1 and 256 characters long.
|
20
20
|
def topic_name
|
21
|
-
|
22
|
-
"#{config.topic_prefix}_#{@topic}"
|
23
|
-
else
|
24
|
-
@topic
|
25
|
-
end
|
21
|
+
naming.topic(@topic)
|
26
22
|
end
|
27
23
|
|
28
24
|
def sns
|
@@ -33,6 +29,10 @@ module Aws
|
|
33
29
|
Broker.config
|
34
30
|
end
|
35
31
|
|
32
|
+
def naming
|
33
|
+
Broker.naming
|
34
|
+
end
|
35
|
+
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Aws
|
2
|
+
class Broker
|
3
|
+
class Naming
|
4
|
+
|
5
|
+
def queue(topic)
|
6
|
+
if config.queue_prefix
|
7
|
+
"#{config.queue_prefix}-#{topic(topic)}"
|
8
|
+
else
|
9
|
+
topic(topic)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# http://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SNS/Resource.html
|
14
|
+
#
|
15
|
+
# Constraints: Topic names must be made up of only uppercase and
|
16
|
+
# lowercase ASCII letters, numbers, underscores, and hyphens, and must
|
17
|
+
# be between 1 and 256 characters long.
|
18
|
+
def topic(topic)
|
19
|
+
if config.topic_prefix
|
20
|
+
"#{config.topic_prefix}_#{topic}"
|
21
|
+
else
|
22
|
+
topic
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def config
|
29
|
+
Broker.config
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
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.10
|
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-12-
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-sns
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- lib/aws/broker/base.rb
|
51
51
|
- lib/aws/broker/config.rb
|
52
52
|
- lib/aws/broker/matchers.rb
|
53
|
+
- lib/aws/broker/naming.rb
|
53
54
|
- lib/aws/broker/publisher.rb
|
54
55
|
- lib/aws/broker/publishing.rb
|
55
56
|
- lib/aws/broker/railtie.rb
|