From c4c0270b823d75fb981fc3db7eba2422bc59bad2 Mon Sep 17 00:00:00 2001 From: Orien Madgwick Date: Sat, 17 Jan 2026 20:08:57 +0700 Subject: [PATCH 1/9] RuboCop: regenerate TODO configuration --- .rubocop.yml | 14 ++++++++++++++ .rubocop_todo.yml | 3 --- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 42659ba..6358661 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,18 @@ +# The behavior of RuboCop can be controlled via the .rubocop.yml +# configuration file. It makes it possible to enable/disable +# certain cops (checks) and to alter their behavior if they accept +# any parameters. The file can be placed either in your home +# directory or in some project directory. +# +# RuboCop will start looking for the configuration file in the directory +# where the inspected file is and continue its way up to the root directory. +# +# See https://docs.rubocop.org/rubocop/configuration + inherit_from: .rubocop_todo.yml +inherit_mode: + merge: + - Exclude AllCops: NewCops: disable diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index bffb860..307677d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -18,7 +18,6 @@ Metrics/AbcSize: # AllowedMethods: refine Metrics/BlockLength: Exclude: - - '**/*.gemspec' - 'spec/event_sourcery/postgres/config_spec.rb' - 'spec/event_sourcery/postgres/event_store_spec.rb' - 'spec/event_sourcery/postgres/optimised_event_poll_waiter_spec.rb' @@ -75,8 +74,6 @@ Naming/VariableNumber: # Configuration parameters: AllowedConstants. Style/Documentation: Exclude: - - 'spec/**/*' - - 'test/**/*' - 'lib/event_sourcery/postgres.rb' - 'lib/event_sourcery/postgres/config.rb' - 'lib/event_sourcery/postgres/event_store.rb' From 77f07c1cf5a4be81c8ed5af8807a66a6e8c26183 Mon Sep 17 00:00:00 2001 From: Orien Madgwick Date: Sat, 17 Jan 2026 20:12:25 +0700 Subject: [PATCH 2/9] RuboCop: resolve `Naming/MemoizedInstanceVariableName` --- .rubocop_todo.yml | 8 -------- lib/event_sourcery/postgres/reactor.rb | 2 +- spec/event_sourcery/postgres/reactor_spec.rb | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 307677d..b04e159 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -50,14 +50,6 @@ Metrics/ParameterLists: - 'lib/event_sourcery/postgres/event_store.rb' - 'spec/support/event_helpers.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyleForLeadingUnderscores. -# SupportedStylesForLeadingUnderscores: disallowed, required, optional -Naming/MemoizedInstanceVariableName: - Exclude: - - 'lib/event_sourcery/postgres/reactor.rb' - - 'spec/event_sourcery/postgres/reactor_spec.rb' - # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to Naming/MethodParameterName: diff --git a/lib/event_sourcery/postgres/reactor.rb b/lib/event_sourcery/postgres/reactor.rb index 9a04aa4..53189e3 100644 --- a/lib/event_sourcery/postgres/reactor.rb +++ b/lib/event_sourcery/postgres/reactor.rb @@ -22,7 +22,7 @@ def emits_events(*event_types) # @return [Array] an array of the types of events this reactor can emit def emit_events - @emits_event_types ||= [] + @emits_event_types ||= [] # rubocop:disable Naming/MemoizedInstanceVariableName end # This will tell you if this reactor emits any type of event. diff --git a/spec/event_sourcery/postgres/reactor_spec.rb b/spec/event_sourcery/postgres/reactor_spec.rb index 5390424..e994a02 100644 --- a/spec/event_sourcery/postgres/reactor_spec.rb +++ b/spec/event_sourcery/postgres/reactor_spec.rb @@ -173,7 +173,7 @@ def self.action(id) end def self.actioned - @actions ||= [] + @actioned ||= [] end end end From a113f8f16582eaa5c2e5c4d8cd68e35153a6847d Mon Sep 17 00:00:00 2001 From: Orien Madgwick Date: Sat, 17 Jan 2026 20:14:20 +0700 Subject: [PATCH 3/9] RuboCop: resolve `Naming/MethodParameterName` --- .rubocop_todo.yml | 6 ------ spec/event_sourcery/postgres/reactor_spec.rb | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b04e159..5c7d240 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -50,12 +50,6 @@ Metrics/ParameterLists: - 'lib/event_sourcery/postgres/event_store.rb' - 'spec/support/event_helpers.rb' -# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to -Naming/MethodParameterName: - Exclude: - - 'spec/event_sourcery/postgres/reactor_spec.rb' - # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, normalcase, non_integer # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 diff --git a/spec/event_sourcery/postgres/reactor_spec.rb b/spec/event_sourcery/postgres/reactor_spec.rb index e994a02..4435757 100644 --- a/spec/event_sourcery/postgres/reactor_spec.rb +++ b/spec/event_sourcery/postgres/reactor_spec.rb @@ -203,8 +203,8 @@ def event_count event_source.get_next_from(0, limit: 100).count end - def latest_events(n = 1) - event_source.get_next_from(0, limit: 100)[-n..] + def latest_events(index = 1) + event_source.get_next_from(0, limit: 100)[-index..] end context "when the event emitted doesn't take actions" do From 2868da611185cf24ed45548d9202b3c67e922800 Mon Sep 17 00:00:00 2001 From: Orien Madgwick Date: Sat, 17 Jan 2026 20:16:12 +0700 Subject: [PATCH 4/9] RuboCop: resolve `Naming/VariableNumber` --- .rubocop_todo.yml | 7 ---- spec/event_sourcery/postgres/reactor_spec.rb | 42 ++++++++++---------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5c7d240..f8c8993 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -50,13 +50,6 @@ Metrics/ParameterLists: - 'lib/event_sourcery/postgres/event_store.rb' - 'spec/support/event_helpers.rb' -# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. -# SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 -Naming/VariableNumber: - Exclude: - - 'spec/event_sourcery/postgres/reactor_spec.rb' - # Configuration parameters: AllowedConstants. Style/Documentation: Exclude: diff --git a/spec/event_sourcery/postgres/reactor_spec.rb b/spec/event_sourcery/postgres/reactor_spec.rb index 4435757..3facec1 100644 --- a/spec/event_sourcery/postgres/reactor_spec.rb +++ b/spec/event_sourcery/postgres/reactor_spec.rb @@ -144,7 +144,7 @@ end context 'with a reactor that emits events' do - let(:event_1) do + let(:event1) do TermsAccepted.new( id: 1, aggregate_id: aggregate_id, @@ -152,20 +152,20 @@ correlation_id: SecureRandom.uuid ) end - let(:event_2) do + let(:event2) do EchoEvent.new( id: 2, aggregate_id: aggregate_id, - body: event_1.body, - correlation_id: event_1.correlation_id, - causation_id: event_1.uuid + body: event1.body, + correlation_id: event1.correlation_id, + causation_id: event1.uuid ) end - let(:event_3) { TermsAccepted.new(id: 3, aggregate_id: aggregate_id, body: { time: Time.now }) } - let(:event_4) { TermsAccepted.new(id: 4, aggregate_id: aggregate_id, body: { time: Time.now }) } - let(:event_5) { TermsAccepted.new(id: 5, aggregate_id: aggregate_id, body: { time: Time.now }) } - let(:event_6) { EchoEvent.new(id: 6, aggregate_id: aggregate_id, body: event_3.body, causation_id: event_3.uuid) } - let(:events) { [event_1, event_2, event_3, event_4] } + let(:event3) { TermsAccepted.new(id: 3, aggregate_id: aggregate_id, body: { time: Time.now }) } + let(:event4) { TermsAccepted.new(id: 4, aggregate_id: aggregate_id, body: { time: Time.now }) } + let(:event5) { TermsAccepted.new(id: 5, aggregate_id: aggregate_id, body: { time: Time.now }) } + let(:event6) { EchoEvent.new(id: 6, aggregate_id: aggregate_id, body: event3.body, causation_id: event3.uuid) } + let(:events) { [event1, event2, event3, event4] } let(:action_stub_class) do Class.new do def self.action(id) @@ -221,20 +221,20 @@ def latest_events(index = 1) end it 'processes the events as usual' do - [event_1, event_2, event_3, event_4, event_5].each do |event| + [event1, event2, event3, event4, event5].each do |event| reactor.process(event) end expect(event_count).to eq 8 end it 'stores the event causation id' do - reactor.process(event_1) - expect(latest_events(1).first.causation_id).to eq event_1.uuid + reactor.process(event1) + expect(latest_events(1).first.causation_id).to eq event1.uuid end it 'stores the event correlation id' do - reactor.process(event_1) - expect(latest_events(1).first.correlation_id).to eq event_1.correlation_id + reactor.process(event1) + expect(latest_events(1).first.correlation_id).to eq event1.correlation_id end end @@ -252,7 +252,7 @@ def latest_events(index = 1) end it 'raises an error' do - expect { reactor.process(event_1) }.to raise_error(EventSourcery::EventProcessingError) + expect { reactor.process(event1) }.to raise_error(EventSourcery::EventProcessingError) end end @@ -273,18 +273,18 @@ def latest_events(index = 1) end it 'can manupulate the event body as part of the action' do - reactor.process(event_1) + reactor.process(event1) expect(latest_events(1).first.body['token']).to eq 'secret-identifier' end it 'stores the event causation id' do - reactor.process(event_1) - expect(latest_events(1).first.causation_id).to eq event_1.uuid + reactor.process(event1) + expect(latest_events(1).first.causation_id).to eq event1.uuid end it 'stores the event correlation id' do - reactor.process(event_1) - expect(latest_events(1).first.correlation_id).to eq event_1.correlation_id + reactor.process(event1) + expect(latest_events(1).first.correlation_id).to eq event1.correlation_id end end end From 58e2981a83552a9707d50143bda2e4ab18ac23b7 Mon Sep 17 00:00:00 2001 From: Orien Madgwick Date: Sat, 17 Jan 2026 20:20:50 +0700 Subject: [PATCH 5/9] RuboCop: resolve `Style/Documentation` --- .rubocop_todo.yml | 12 ------------ README.md | 4 +--- lib/event_sourcery/postgres.rb | 1 + lib/event_sourcery/postgres/config.rb | 1 + lib/event_sourcery/postgres/event_store.rb | 1 + lib/event_sourcery/postgres/projector.rb | 2 ++ .../postgres/queue_with_interval_callback.rb | 1 + lib/event_sourcery/postgres/reactor.rb | 3 +++ lib/event_sourcery/postgres/schema.rb | 1 + lib/event_sourcery/postgres/table_owner.rb | 2 ++ 10 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f8c8993..48e9738 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -50,18 +50,6 @@ Metrics/ParameterLists: - 'lib/event_sourcery/postgres/event_store.rb' - 'spec/support/event_helpers.rb' -# Configuration parameters: AllowedConstants. -Style/Documentation: - Exclude: - - 'lib/event_sourcery/postgres.rb' - - 'lib/event_sourcery/postgres/config.rb' - - 'lib/event_sourcery/postgres/event_store.rb' - - 'lib/event_sourcery/postgres/projector.rb' - - 'lib/event_sourcery/postgres/queue_with_interval_callback.rb' - - 'lib/event_sourcery/postgres/reactor.rb' - - 'lib/event_sourcery/postgres/schema.rb' - - 'lib/event_sourcery/postgres/table_owner.rb' - # Configuration parameters: AllowedVariables. Style/GlobalVars: Exclude: diff --git a/README.md b/README.md index 1fd866d..686294a 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,7 @@ ## Development Status -EventSourcery is currently being used in production by multiple apps but we -haven't finalized the API yet and things are still moving rapidly. Until we -release a 1.0 things may change without first being deprecated. +EventSourcery::Postgres is in production use at [Envato](http://envato.com). ## Installation diff --git a/lib/event_sourcery/postgres.rb b/lib/event_sourcery/postgres.rb index 9505a1f..be54989 100644 --- a/lib/event_sourcery/postgres.rb +++ b/lib/event_sourcery/postgres.rb @@ -17,6 +17,7 @@ require 'event_sourcery/postgres/tracker' module EventSourcery + # PostgreSQL adapter for EventSourcery providing event store and projection capabilities. module Postgres def self.configure yield config diff --git a/lib/event_sourcery/postgres/config.rb b/lib/event_sourcery/postgres/config.rb index b086af9..121f106 100644 --- a/lib/event_sourcery/postgres/config.rb +++ b/lib/event_sourcery/postgres/config.rb @@ -2,6 +2,7 @@ module EventSourcery module Postgres + # Configuration settings for the PostgreSQL event store and projections. class Config attr_accessor :lock_table_to_guarantee_linear_sequence_id_growth, :write_events_function_name, diff --git a/lib/event_sourcery/postgres/event_store.rb b/lib/event_sourcery/postgres/event_store.rb index 36d19e9..c05e263 100644 --- a/lib/event_sourcery/postgres/event_store.rb +++ b/lib/event_sourcery/postgres/event_store.rb @@ -2,6 +2,7 @@ module EventSourcery module Postgres + # PostgreSQL implementation of an event store for persisting and retrieving domain events. class EventStore include EventSourcery::EventStore::EachByRange diff --git a/lib/event_sourcery/postgres/projector.rb b/lib/event_sourcery/postgres/projector.rb index 5d85a3c..5c58620 100644 --- a/lib/event_sourcery/postgres/projector.rb +++ b/lib/event_sourcery/postgres/projector.rb @@ -2,6 +2,7 @@ module EventSourcery module Postgres + # Mixin providing projection capabilities for processing events into read models. module Projector def self.included(base) base.include(EventProcessing::EventStreamProcessor) @@ -17,6 +18,7 @@ class << self end end + # Instance methods for projector event processing and tracking. module InstanceMethods def initialize(tracker: EventSourcery::Postgres.config.event_tracker, db_connection: EventSourcery::Postgres.config.projections_database, diff --git a/lib/event_sourcery/postgres/queue_with_interval_callback.rb b/lib/event_sourcery/postgres/queue_with_interval_callback.rb index 8a02f24..f3c52eb 100644 --- a/lib/event_sourcery/postgres/queue_with_interval_callback.rb +++ b/lib/event_sourcery/postgres/queue_with_interval_callback.rb @@ -2,6 +2,7 @@ module EventSourcery module Postgres + # Queue that invokes a callback at regular intervals when no items are available. class QueueWithIntervalCallback < ::Queue attr_accessor :callback diff --git a/lib/event_sourcery/postgres/reactor.rb b/lib/event_sourcery/postgres/reactor.rb index 53189e3..f3dfbf5 100644 --- a/lib/event_sourcery/postgres/reactor.rb +++ b/lib/event_sourcery/postgres/reactor.rb @@ -2,6 +2,7 @@ module EventSourcery module Postgres + # Mixin providing reactor capabilities for processing events and emitting new events in response. module Reactor UndeclaredEventEmissionError = Class.new(StandardError) @@ -12,6 +13,7 @@ def self.included(base) base.include(InstanceMethods) end + # Class methods for declaring and querying emitted event types. module ClassMethods # Assign the types of events this reactor can emit. # @@ -41,6 +43,7 @@ def emits_event?(event_type) end end + # Instance methods for reactor initialisation and event emission. module InstanceMethods def initialize(tracker: EventSourcery::Postgres.config.event_tracker, db_connection: EventSourcery::Postgres.config.projections_database, diff --git a/lib/event_sourcery/postgres/schema.rb b/lib/event_sourcery/postgres/schema.rb index 6effc07..6ff65bf 100644 --- a/lib/event_sourcery/postgres/schema.rb +++ b/lib/event_sourcery/postgres/schema.rb @@ -2,6 +2,7 @@ module EventSourcery module Postgres + # Schema management for creating event store and projector tables in PostgreSQL. module Schema module_function diff --git a/lib/event_sourcery/postgres/table_owner.rb b/lib/event_sourcery/postgres/table_owner.rb index 73334ab..3aea8f6 100644 --- a/lib/event_sourcery/postgres/table_owner.rb +++ b/lib/event_sourcery/postgres/table_owner.rb @@ -2,6 +2,7 @@ module EventSourcery module Postgres + # Mixin providing table management capabilities for projectors and reactors. module TableOwner DefaultTableError = Class.new(StandardError) NoSuchTableError = Class.new(StandardError) @@ -10,6 +11,7 @@ def self.prepended(base) base.extend(ClassMethods) end + # Class methods for defining and managing database tables. module ClassMethods # Hash of the tables and their corresponding blocks. # From db67d5c8e3f82f504d6357526874bb7754b4b198 Mon Sep 17 00:00:00 2001 From: Orien Madgwick Date: Sat, 17 Jan 2026 20:23:16 +0700 Subject: [PATCH 6/9] RuboCop: resolve `Style/HashEachMethods` --- .rubocop_todo.yml | 7 ------- lib/event_sourcery/postgres/table_owner.rb | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 48e9738..dabd9e7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -55,13 +55,6 @@ Style/GlobalVars: Exclude: - 'spec/support/db_helpers.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowedReceivers. -# AllowedReceivers: Thread.current -Style/HashEachMethods: - Exclude: - - 'lib/event_sourcery/postgres/table_owner.rb' - # Configuration parameters: AllowedMethods. # AllowedMethods: respond_to_missing? Style/OptionalBooleanParameter: diff --git a/lib/event_sourcery/postgres/table_owner.rb b/lib/event_sourcery/postgres/table_owner.rb index 3aea8f6..11b226d 100644 --- a/lib/event_sourcery/postgres/table_owner.rb +++ b/lib/event_sourcery/postgres/table_owner.rb @@ -40,7 +40,7 @@ def setup # Reset by dropping each table. def reset - self.class.tables.keys.each do |table_name| + self.class.tables.each_key do |table_name| prefixed_name = table_name_prefixed(table_name) @db_connection.drop_table(prefixed_name, cascade: true) if @db_connection.table_exists?(prefixed_name) end @@ -51,7 +51,7 @@ def reset # This will truncate all the tables and reset the tracker back to 0, # done as a transaction. def truncate - self.class.tables.each do |table_name, _| + self.class.tables.each_key do |table_name| @db_connection.transaction do prefixed_name = table_name_prefixed(table_name) @db_connection[prefixed_name].truncate From d63c4812d35f905b1b2c335b5775b889fa620d9a Mon Sep 17 00:00:00 2001 From: Orien Madgwick Date: Sat, 17 Jan 2026 20:25:25 +0700 Subject: [PATCH 7/9] RuboCop: disable `Style/OptionalBooleanParameter` - it is in the public interface now --- .rubocop_todo.yml | 6 ------ lib/event_sourcery/postgres/queue_with_interval_callback.rb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index dabd9e7..e7b47e4 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -55,12 +55,6 @@ Style/GlobalVars: Exclude: - 'spec/support/db_helpers.rb' -# Configuration parameters: AllowedMethods. -# AllowedMethods: respond_to_missing? -Style/OptionalBooleanParameter: - Exclude: - - 'lib/event_sourcery/postgres/queue_with_interval_callback.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. # AllowedMethods: present?, blank?, presence, try, try! diff --git a/lib/event_sourcery/postgres/queue_with_interval_callback.rb b/lib/event_sourcery/postgres/queue_with_interval_callback.rb index f3c52eb..1cd0abb 100644 --- a/lib/event_sourcery/postgres/queue_with_interval_callback.rb +++ b/lib/event_sourcery/postgres/queue_with_interval_callback.rb @@ -17,7 +17,7 @@ def initialize( super() end - def pop(non_block_without_callback = false) + def pop(non_block_without_callback = false) # rubocop:disable Style/OptionalBooleanParameter return super if non_block_without_callback pop_with_interval_callback From 5345c3b5002e8baf8609effd53c8f061d0d6cf15 Mon Sep 17 00:00:00 2001 From: Orien Madgwick Date: Sat, 17 Jan 2026 20:27:10 +0700 Subject: [PATCH 8/9] RuboCop: resolve `Style/SafeNavigation` --- .rubocop_todo.yml | 8 -------- CHANGELOG.md | 3 +++ .../postgres/optimised_event_poll_waiter.rb | 2 +- lib/event_sourcery/postgres/reactor.rb | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e7b47e4..2ea6c40 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -54,11 +54,3 @@ Metrics/ParameterLists: Style/GlobalVars: Exclude: - 'spec/support/db_helpers.rb' - -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. -# AllowedMethods: present?, blank?, presence, try, try! -Style/SafeNavigation: - Exclude: - - 'lib/event_sourcery/postgres/optimised_event_poll_waiter.rb' - - 'lib/event_sourcery/postgres/reactor.rb' diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a5ed0c..e504cb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +- Resolve issues as identified by RuboCop ([#85]). + [Unreleased]: https://github.com/envato/event_sourcery-postgres/compare/v1.0.0...HEAD +[#85]: https://github.com/envato/event_sourcery-postgres/pull/85 ## [1.0.0] - 2025-12-28 diff --git a/lib/event_sourcery/postgres/optimised_event_poll_waiter.rb b/lib/event_sourcery/postgres/optimised_event_poll_waiter.rb index c574b0a..c9377c4 100644 --- a/lib/event_sourcery/postgres/optimised_event_poll_waiter.rb +++ b/lib/event_sourcery/postgres/optimised_event_poll_waiter.rb @@ -54,7 +54,7 @@ def start_async(after_listen: nil) after_listen_callback = if after_listen proc do after_listen.call - @after_listen.call if @after_listen + @after_listen&.call end else @after_listen diff --git a/lib/event_sourcery/postgres/reactor.rb b/lib/event_sourcery/postgres/reactor.rb index f3dfbf5..604b7ce 100644 --- a/lib/event_sourcery/postgres/reactor.rb +++ b/lib/event_sourcery/postgres/reactor.rb @@ -78,7 +78,7 @@ def emit_event(event_or_hash, &block) end def invoke_action_and_emit_event(event, action) - action.call(event.body) if action + action&.call(event.body) event_sink.sink(event) end end From c88f2316b764b07341307acb442141c260af92ef Mon Sep 17 00:00:00 2001 From: Orien Madgwick Date: Sat, 17 Jan 2026 20:42:34 +0700 Subject: [PATCH 9/9] Release 1.0.1 --- CHANGELOG.md | 8 +++++++- event_sourcery-postgres.gemspec | 2 +- lib/event_sourcery/postgres/version.rb | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e504cb8..ae6f5f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +[Unreleased]: https://github.com/envato/event_sourcery-postgres/compare/v1.0.1...HEAD + +## [1.0.1] - 2026-01-17 + +### Changed + - Resolve issues as identified by RuboCop ([#85]). -[Unreleased]: https://github.com/envato/event_sourcery-postgres/compare/v1.0.0...HEAD +[1.0.0]: https://github.com/envato/event_sourcery-postgres/compare/v1.0.0...v1.0.1 [#85]: https://github.com/envato/event_sourcery-postgres/pull/85 ## [1.0.0] - 2025-12-28 diff --git a/event_sourcery-postgres.gemspec b/event_sourcery-postgres.gemspec index cb6ab21..4883ea7 100644 --- a/event_sourcery-postgres.gemspec +++ b/event_sourcery-postgres.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| 'allowed_push_host' => 'https://rubygems.org', 'bug_tracker_uri' => "#{spec.homepage}/issues", 'changelog_uri' => "#{spec.homepage}/blob/HEAD/CHANGELOG.md", - 'documentation_uri' => "https://www.rubydoc.info/gems/event_sourcery-postgres/#{spec.version}", + 'documentation_uri' => "https://www.rubydoc.info/gems/#{spec.name}/#{spec.version}", 'source_code_uri' => "#{spec.homepage}/tree/v#{spec.version}" } diff --git a/lib/event_sourcery/postgres/version.rb b/lib/event_sourcery/postgres/version.rb index 2fd4dc7..a80d114 100644 --- a/lib/event_sourcery/postgres/version.rb +++ b/lib/event_sourcery/postgres/version.rb @@ -2,6 +2,6 @@ module EventSourcery module Postgres - VERSION = '1.0.0' + VERSION = '1.0.1' end end