hanami-events-cloud_pubsub 2.1.2 → 2.1.3

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
  SHA256:
3
- metadata.gz: 2997a85c87293786353e655a95ac3f30d17cd04352970f09b7813b23bbc72de9
4
- data.tar.gz: 631538f4ba353a996862c2b55a7020f6f886bdb5a6217fdb5afa1e0f06913eb0
3
+ metadata.gz: 9b535cead0f43738abd37ba5487c71c04fe58dfc0af3c22cc0860f86ca8c3036
4
+ data.tar.gz: 2b0175b75fa4caed47c2b592a674b39ccd2ee392adf715a52211a70b4a633ba2
5
5
  SHA512:
6
- metadata.gz: 16fe26dc4fc1593ecb5c5013ff06366ca3a4e86fbdd5bc5fadb3fd0cc7a25b3ab5de7ccc90d34af1bcb61579df462de9878978b76e41184822af99ccaa36807c
7
- data.tar.gz: f550ac05a5e90a6076c611455bb038668c6b117e742daee11297facc05c367566213692b2cd9cacb2f08030a347afa9927a4e5137d3776a07fbe2a6e8f586bb8
6
+ metadata.gz: f8916a647db7d0d14c8b56fa3e359fc553cb022d28b989de6f1442aaa18dd96605f16eb089dec0ccdcb0aea9f6730c950907e3fd5b6bae8c801c194f87c61a7b
7
+ data.tar.gz: 3002bd4edceba5fd9a85dfbd0b0e58407283775b37cf301e97a08f95c2a13bf1257ab274d7aedea1ad44c5da42ac1e7ae46cb0b7a35c82051a167ec630ac95a4
data/Gemfile.lock CHANGED
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- hanami-events-cloud_pubsub (2.1.2)
11
+ hanami-events-cloud_pubsub (2.1.3)
12
12
  dry-configurable (~> 0.8.0)
13
13
  google-cloud-pubsub (~> 0.34.0)
14
14
  hanami-cli (~> 0.2)
@@ -82,7 +82,6 @@ module Hanami
82
82
  data = message.data
83
83
  payload = serializer.deserialize(data)
84
84
  event_name = message.attributes['event_name']
85
- payload['id'] = message.attributes['id']
86
85
 
87
86
  @subscribers.each do |subscriber|
88
87
  subscriber.call(event_name, payload)
@@ -93,6 +92,7 @@ module Hanami
93
92
  @serializer ||= Hanami::Events::Serializer[@serializer_type].new
94
93
  end
95
94
 
95
+ # rubocop:disable Metrics/LineLength
96
96
  def topic_for(name)
97
97
  @topic_registry[name.to_s] ||= begin
98
98
  @pubsub.find_topic(name) ||
@@ -100,6 +100,7 @@ module Hanami
100
100
  raise(CloudPubsub::Errors::TopicNotFoundError, "no topic named: #{name}")
101
101
  end
102
102
  end
103
+ # rubocop:enable Metrics/LineLength
103
104
 
104
105
  def namespaced(val, sep: '.')
105
106
  [Hanami::Events::CloudPubsub.namespace, val].compact.join(sep)
@@ -17,6 +17,7 @@ module Hanami
17
17
  :event_name,
18
18
  :subscriber_opts,
19
19
  :middleware
20
+ # rubocop:disable Metrics/ParameterLists
20
21
  def initialize(topic:,
21
22
  logger:,
22
23
  handler:,
@@ -32,6 +33,7 @@ module Hanami
32
33
  @subscriber_opts = CloudPubsub.config.subscriber.to_h.merge(subscriber_opts)
33
34
  @middleware = middleware
34
35
  end
36
+ # rubocop:enable Metrics/ParameterLists
35
37
 
36
38
  def register
37
39
  subscription = subscription_for(subscriber_id)
@@ -40,14 +40,14 @@ module Hanami
40
40
  @entries.shift
41
41
  end
42
42
 
43
- def invoke(*base_args)
43
+ def invoke(message)
44
44
  stack = entries.dup
45
45
 
46
46
  traverse_stack = proc do |**opts|
47
47
  if stack.empty?
48
- yield(*base_args, **opts)
48
+ yield(message)
49
49
  else
50
- stack.shift.call(*base_args, **opts, &traverse_stack)
50
+ stack.shift.call(message, **opts, &traverse_stack)
51
51
  end
52
52
  end
53
53
 
@@ -3,7 +3,7 @@
3
3
  module Hanami
4
4
  module Events
5
5
  module CloudPubsub
6
- VERSION = '2.1.2'
6
+ VERSION = '2.1.3'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-events-cloud_pubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-19 00:00:00.000000000 Z
11
+ date: 2019-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable