Skip to content

Commit 4acefb4

Browse files
author
dmitrii.buk
committed
updated rabbit-messaging gem
1 parent 26f244e commit 4acefb4

File tree

5 files changed

+46
-14
lines changed

5 files changed

+46
-14
lines changed

Gemfile.lock

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
PATH
22
remote: .
33
specs:
4-
table_sync (6.6.3)
4+
table_sync (6.7.0)
55
memery
6-
rabbit_messaging (>= 1.1.0)
6+
rabbit_messaging (>= 1.6.1)
77
rails
88
self_data
9+
tainbox
910

1011
GEM
1112
remote: https://rubygems.org/
@@ -148,6 +149,22 @@ GEM
148149
nokogiri (1.18.8)
149150
mini_portile2 (~> 2.8.2)
150151
racc (~> 1.4)
152+
nokogiri (1.18.8-aarch64-linux-gnu)
153+
racc (~> 1.4)
154+
nokogiri (1.18.8-aarch64-linux-musl)
155+
racc (~> 1.4)
156+
nokogiri (1.18.8-arm-linux-gnu)
157+
racc (~> 1.4)
158+
nokogiri (1.18.8-arm-linux-musl)
159+
racc (~> 1.4)
160+
nokogiri (1.18.8-arm64-darwin)
161+
racc (~> 1.4)
162+
nokogiri (1.18.8-x86_64-darwin)
163+
racc (~> 1.4)
164+
nokogiri (1.18.8-x86_64-linux-gnu)
165+
racc (~> 1.4)
166+
nokogiri (1.18.8-x86_64-linux-musl)
167+
racc (~> 1.4)
151168
ostruct (0.6.1)
152169
parallel (1.27.0)
153170
parser (3.3.8.0)
@@ -164,10 +181,9 @@ GEM
164181
psych (5.2.6)
165182
date
166183
stringio
167-
rabbit_messaging (1.5.0)
184+
rabbit_messaging (1.6.1)
168185
bunny (~> 2.0)
169186
kicks
170-
tainbox
171187
racc (1.8.1)
172188
rack (3.1.15)
173189
rack-session (2.1.1)
@@ -312,7 +328,15 @@ GEM
312328
zeitwerk (2.6.18)
313329

314330
PLATFORMS
331+
aarch64-linux-gnu
332+
aarch64-linux-musl
333+
arm-linux-gnu
334+
arm-linux-musl
335+
arm64-darwin
315336
ruby
337+
x86_64-darwin
338+
x86_64-linux-gnu
339+
x86_64-linux-musl
316340

317341
DEPENDENCIES
318342
activejob

lib/table_sync.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
require "rabbit/event_handler" # NOTE: from rabbit_messaging"
77
require "active_support/core_ext/object/blank"
88
require "active_support/core_ext/numeric/time"
9+
require "tainbox"
910

1011
module TableSync
1112
require_relative "table_sync/event"

lib/table_sync/receiving/handler.rb

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
class TableSync::Receiving::Handler < Rabbit::EventHandler
44
extend TableSync::Receiving::DSL
55

6-
# Rabbit::EventHandler uses Tainbox and performs `handler.new(message).call`
7-
attribute :event
8-
attribute :model
9-
attribute :version
6+
attr_accessor :version
7+
attr_reader :event, :model
8+
9+
def initialize(message)
10+
super
11+
12+
self.event = message.data[:event]
13+
self.model = message.data[:model]
14+
self.version = message.data[:version]
15+
end
1016

1117
def call
1218
configs.each do |config|
@@ -40,22 +46,22 @@ def call
4046
private
4147

4248
# redefine setter from Rabbit::EventHandler
43-
def data=(data)
44-
super(Array.wrap(data[:attributes]))
49+
def data=(raw_data)
50+
super(Array.wrap(raw_data[:attributes]))
4551
end
4652

4753
def event=(event_name)
4854
event_name = event_name.to_sym
4955

5056
if event_name.in?(TableSync::Event::VALID_RESOLVED_EVENTS)
51-
super
57+
@event = event_name
5258
else
5359
raise TableSync::UndefinedEvent.new(event)
5460
end
5561
end
5662

5763
def model=(model_name)
58-
super(model_name.to_s)
64+
@model = model_name.to_s
5965
end
6066

6167
def configs

lib/table_sync/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module TableSync
4-
VERSION = "6.6.3"
4+
VERSION = "6.7.0"
55
end

table_sync.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Gem::Specification.new do |spec|
2727
end
2828

2929
spec.add_dependency "memery"
30-
spec.add_dependency "rabbit_messaging", ">= 1.1.0"
30+
spec.add_dependency "rabbit_messaging", ">= 1.6.1"
3131
spec.add_dependency "rails"
3232
spec.add_dependency "self_data"
33+
spec.add_dependency "tainbox"
3334
end

0 commit comments

Comments
 (0)