gcpc 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -10
- data/lib/gcpc/publisher.rb +1 -1
- data/lib/gcpc/publisher/engine.rb +20 -2
- data/lib/gcpc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b617d83445ce50725dbf992702e226b89f255f0760d969732e42c782b6af05e4
|
4
|
+
data.tar.gz: 6fd34095e7bee0b101d04daa6d6824dcd1977ff97e804463f86837d6ef8a4b67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e17d2db5ed5dc4818f7d4995024f5e9c16b42ceb9fbd6d4cb09008d929dedf3dce6937dab2105f0913731e34554be1cdc524b8b8cc8990b22d9829aebeb1d41
|
7
|
+
data.tar.gz: 4565614b54983a4b15bb16eff6570c526a29ca053c5d15459e5031602ab07b060cdb607a538e4246f0c6c615cc1eb28a15545a1cceaa02d6447e849470832d14
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gcpc (0.0.
|
4
|
+
gcpc (0.0.5)
|
5
5
|
google-cloud-pubsub
|
6
6
|
|
7
7
|
GEM
|
@@ -16,21 +16,21 @@ GEM
|
|
16
16
|
multipart-post (>= 1.2, < 3)
|
17
17
|
google-cloud-core (1.3.0)
|
18
18
|
google-cloud-env (~> 1.0)
|
19
|
-
google-cloud-env (1.
|
19
|
+
google-cloud-env (1.2.0)
|
20
20
|
faraday (~> 0.11)
|
21
|
-
google-cloud-pubsub (0.
|
22
|
-
concurrent-ruby (~> 1.
|
21
|
+
google-cloud-pubsub (0.38.0)
|
22
|
+
concurrent-ruby (~> 1.1)
|
23
23
|
google-cloud-core (~> 1.2)
|
24
|
-
google-gax (~> 1.
|
24
|
+
google-gax (~> 1.7)
|
25
25
|
googleapis-common-protos (>= 1.3.9, < 2.0)
|
26
26
|
grpc-google-iam-v1 (~> 0.6.9)
|
27
|
-
google-gax (1.
|
27
|
+
google-gax (1.7.0)
|
28
28
|
google-protobuf (~> 3.2)
|
29
29
|
googleapis-common-protos (>= 1.3.5, < 2.0)
|
30
30
|
googleauth (>= 0.6.2, < 0.10.0)
|
31
31
|
grpc (>= 1.7.2, < 2.0)
|
32
32
|
rly (~> 0.2.3)
|
33
|
-
google-protobuf (3.
|
33
|
+
google-protobuf (3.9.0)
|
34
34
|
googleapis-common-protos (1.3.9)
|
35
35
|
google-protobuf (~> 3.0)
|
36
36
|
googleapis-common-protos-types (~> 1.0)
|
@@ -44,8 +44,8 @@ GEM
|
|
44
44
|
multi_json (~> 1.11)
|
45
45
|
os (>= 0.9, < 2.0)
|
46
46
|
signet (~> 0.7)
|
47
|
-
grpc (1.
|
48
|
-
google-protobuf (~> 3.
|
47
|
+
grpc (1.22.0)
|
48
|
+
google-protobuf (~> 3.8)
|
49
49
|
googleapis-common-protos-types (~> 1.0)
|
50
50
|
grpc-google-iam-v1 (0.6.9)
|
51
51
|
googleapis-common-protos (>= 1.3.1, < 2.0)
|
@@ -59,7 +59,7 @@ GEM
|
|
59
59
|
pry (0.12.2)
|
60
60
|
coderay (~> 1.1.0)
|
61
61
|
method_source (~> 0.9.0)
|
62
|
-
public_suffix (3.1.
|
62
|
+
public_suffix (3.1.1)
|
63
63
|
rake (10.5.0)
|
64
64
|
rly (0.2.3)
|
65
65
|
rspec (3.8.0)
|
data/lib/gcpc/publisher.rb
CHANGED
@@ -8,6 +8,8 @@ module Gcpc
|
|
8
8
|
@interceptors = interceptors.map { |i| (i.class == Class) ? i.new : i }
|
9
9
|
end
|
10
10
|
|
11
|
+
attr_reader :topic
|
12
|
+
|
11
13
|
# @param [String] data
|
12
14
|
# @param [Hash] attributes
|
13
15
|
def publish(data, attributes = {})
|
@@ -15,7 +17,16 @@ module Gcpc
|
|
15
17
|
a = attributes.dup
|
16
18
|
|
17
19
|
intercept!(@interceptors, d, a) do |dd, aa|
|
18
|
-
|
20
|
+
do_publish(dd, aa)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def publish_async(data, attributes = {}, &block)
|
25
|
+
d = data.dup
|
26
|
+
a = attributes.dup
|
27
|
+
|
28
|
+
intercept!(@interceptors, d, a) do |dd, aa|
|
29
|
+
do_publish_async(dd, aa, &block)
|
19
30
|
end
|
20
31
|
end
|
21
32
|
|
@@ -40,9 +51,16 @@ module Gcpc
|
|
40
51
|
|
41
52
|
# @param [String] data
|
42
53
|
# @param [Hash] attributes
|
43
|
-
def
|
54
|
+
def do_publish(data, attributes)
|
44
55
|
@topic.publish(data, attributes)
|
45
56
|
end
|
57
|
+
|
58
|
+
# @param [String] data
|
59
|
+
# @param [Hash] attributes
|
60
|
+
# @param [Proc] block
|
61
|
+
def do_publish_async(data, attributes, &block)
|
62
|
+
@topic.publish_async(data, attributes, &block)
|
63
|
+
end
|
46
64
|
end
|
47
65
|
end
|
48
66
|
end
|
data/lib/gcpc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gcpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nao Minami
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|