File tree Expand file tree Collapse file tree 5 files changed +46
-14
lines changed Expand file tree Collapse file tree 5 files changed +46
-14
lines changed Original file line number Diff line number Diff line change 11PATH
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
1011GEM
1112 remote: https://rubygems.org/
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 )
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 )
312328 zeitwerk (2.6.18 )
313329
314330PLATFORMS
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
317341DEPENDENCIES
318342 activejob
Original file line number Diff line number Diff line change 66require "rabbit/event_handler" # NOTE: from rabbit_messaging"
77require "active_support/core_ext/object/blank"
88require "active_support/core_ext/numeric/time"
9+ require "tainbox"
910
1011module TableSync
1112 require_relative "table_sync/event"
Original file line number Diff line number Diff line change 33class 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
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module TableSync
4- VERSION = "6.6.3 "
4+ VERSION = "6.7.0 "
55end
Original file line number Diff line number Diff 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"
3334end
You can’t perform that action at this time.
0 commit comments