google-pubsub-enhancer 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google_pubsub_enhancer/publisher.rb +2 -4
- data/lib/google_pubsub_enhancer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcbdcd5a108f70005e0cdbba99a86ba2d1c28ae2
|
4
|
+
data.tar.gz: d7aad5dc5694aa7b68ec0280060ade50d39cf610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d75738727b12692e418c96928a4d30b25af903f2f265972f993d6c176a8eeac7f175c91dbdb362ab1a39b0a4dc7e113838f5e2c1a45825da27d0ea61d2b6280d
|
7
|
+
data.tar.gz: bb1953a40da13522700e0f761c0ef88dc72fd2dbc9576b4a22f71652867ed953b44155f476fcd8bb277a6250121b9c8af2152b1dda4a7d44cfcb1907074cabc4
|
@@ -5,10 +5,11 @@ class GooglePubsubEnhancer::Publisher
|
|
5
5
|
@short_topic_name = opts[:short_topic_name] || raise
|
6
6
|
@full_topic_name = GooglePubsubEnhancer.name_by('topics',@short_topic_name)
|
7
7
|
@messages_key = opts[:messages] || raise
|
8
|
+
@google_cloud_pubsub ||= Google::Cloud::Pubsub.new
|
8
9
|
end
|
9
10
|
|
10
11
|
def call(env)
|
11
|
-
google_cloud_pubsub.publish(@full_topic_name) do |publisher|
|
12
|
+
@google_cloud_pubsub.publish(@full_topic_name) do |publisher|
|
12
13
|
[*env[@messages_key]].each do |m|
|
13
14
|
publisher.publish(m)
|
14
15
|
end
|
@@ -16,7 +17,4 @@ class GooglePubsubEnhancer::Publisher
|
|
16
17
|
@app.call(env)
|
17
18
|
end
|
18
19
|
|
19
|
-
def google_cloud_pubsub
|
20
|
-
Google::Cloud::Pubsub.new
|
21
|
-
end
|
22
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-pubsub-enhancer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bejczib
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|