rails_event_store 2.0.0 → 2.3.0

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: 0eba2a0d1c1131e1527c79a56af8c49c9f70a22dcab62b0d9672610ab5ef3f83
4
- data.tar.gz: 5a9995ee836d9de3ac018864c0bed6f604fa47ea91be8448fafd5a01cf700a27
3
+ metadata.gz: b956e083f03d6da44d1f82cdd1662a093b3f9526c846f38832a85f38daa698c7
4
+ data.tar.gz: 3a5202592d84ae5a63315b0badc598000c785bdf97f438425f699671da28f340
5
5
  SHA512:
6
- metadata.gz: be06d1c95facbd1193fb683cf3fc9361b5224d619e62dfd0e128f083311f556065372b0ebd4315478291028424959ddf10d190b69f0e0ea91fcb5d0b99e84305
7
- data.tar.gz: e9e9795ca9c3ba37b393082fce2af4ad6f8f3a9ec730c9c6a74c3901b8f9cd5fec79584c1f41d4eaeb51d6cb768e6699decde53e6bfc35d9ee01dc3db47cec62
6
+ metadata.gz: 39852a4cf687b8965d51fa364e46fff94d4d689f3b0c75ae8abdd84109b38728eb4f4c0fcca076cbadcd54c6f7c41f88a17383311654bee7918a586e3dc17a1b
7
+ data.tar.gz: 83e445adc6aa7937b2f535010908bb265fa5ca2d75100b2539e1247a0453e6924fd83065c6c56a960ebd42937e44c13e96742e474d409ea968ec022251050c6f
data/README.md CHANGED
@@ -1,3 +1,7 @@
1
1
  # RailsEventStore
2
2
 
3
- Rails wrapper for Ruby Event Store with batteries included.
3
+ Rails wrapper for RubyEventStore with batteries included.
4
+
5
+ Ships with asynchronous after-commit event dispatch on top of ActiveJob, ActiveSupport::Notifications instrumentation enabled, request metadata enrichment and opinionated directory structure generator for bounded contexts.
6
+
7
+ Find out more at [https://railseventstore.org](https://railseventstore.org/)
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/generators'
3
+ require "rails/generators"
4
4
 
5
5
  module RailsEventStore
6
6
  module Generators
7
7
  class BoundedContextGenerator < Rails::Generators::NamedBase
8
- source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates'))
8
+ source_root File.expand_path(File.join(File.dirname(__FILE__), "../templates"))
9
9
  hook_for :test_framework
10
10
 
11
11
  def create_bounded_context
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/generators'
3
+ require "rails/generators"
4
4
 
5
5
  module RailsEventStore
6
6
  module Generators
7
7
  class RspecGenerator < Rails::Generators::NamedBase
8
- source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates'))
8
+ source_root File.expand_path(File.join(File.dirname(__FILE__), "../templates"))
9
9
 
10
10
  def spec_helper
11
11
  template "spec_helper.rb", "#{bounded_context_name}/spec/spec_helper.rb"
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/generators'
3
+ require "rails/generators"
4
4
 
5
5
  module RailsEventStore
6
6
  module Generators
7
7
  class TestUnitGenerator < Rails::Generators::NamedBase
8
- source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates'))
8
+ source_root File.expand_path(File.join(File.dirname(__FILE__), "../templates"))
9
9
 
10
10
  def test_helper
11
11
  template "test_helper.rb", "#{bounded_context_name}/test/test_helper.rb"
@@ -1,6 +1,6 @@
1
- require 'rails_helper'
1
+ require "rails_helper"
2
2
 
3
- path = Rails.root.join('<%= bounded_context_name %>/spec')
3
+ path = Rails.root.join("<%= bounded_context_name %>/spec")
4
4
  Dir.glob("#{path}/**/*_spec.rb") do |file|
5
5
  require file
6
6
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_job'
3
+ require "active_job"
4
4
 
5
5
  module RailsEventStore
6
6
  class ActiveJobScheduler
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ruby_event_store'
4
- require 'rails_event_store/async_handler_helpers'
5
- require 'rails_event_store/link_by_metadata'
6
- require 'rails_event_store/after_commit_async_dispatcher'
7
- require 'rails_event_store/active_job_scheduler'
8
- require 'rails_event_store/client'
9
- require 'rails_event_store/version'
10
- require 'rails_event_store/railtie'
11
- require 'rails_event_store/browser'
3
+ require "ruby_event_store"
4
+ require_relative "async_handler_helpers"
5
+ require_relative "link_by_metadata"
6
+ require_relative "after_commit_async_dispatcher"
7
+ require_relative "active_job_scheduler"
8
+ require_relative "client"
9
+ require_relative "version"
10
+ require_relative "railtie"
11
+ require_relative "browser"
12
12
 
13
13
  module RailsEventStore
14
14
  Event = RubyEventStore::Event
@@ -10,7 +10,7 @@ module RailsEventStore
10
10
  end
11
11
  end
12
12
 
13
- def self.with(event_store: Rails.configuration.event_store, serializer: event_store.__send__(:mapper).serializer)
13
+ def self.with(event_store: Rails.configuration.event_store, serializer: YAML)
14
14
  Module.new do
15
15
  define_method :perform do |payload|
16
16
  super(event_store.deserialize(serializer: serializer, **payload.symbolize_keys))
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ruby_event_store/browser/app'
3
+ require "ruby_event_store/browser/app"
4
4
 
5
5
  module RailsEventStore
6
6
  Browser = RubyEventStore::Browser::App.for(event_store_locator: -> { Rails.configuration.event_store })
@@ -5,10 +5,10 @@ module RailsEventStore
5
5
  attr_reader :request_metadata
6
6
 
7
7
  def initialize(mapper: RubyEventStore::Mappers::Default.new,
8
- repository: RailsEventStoreActiveRecord::EventRepository.new(serializer: mapper.serializer),
8
+ repository: RailsEventStoreActiveRecord::EventRepository.new(serializer: YAML),
9
9
  subscriptions: RubyEventStore::Subscriptions.new,
10
10
  dispatcher: RubyEventStore::ComposedDispatcher.new(
11
- RailsEventStore::AfterCommitAsyncDispatcher.new(scheduler: ActiveJobScheduler.new(serializer: mapper.serializer)),
11
+ RailsEventStore::AfterCommitAsyncDispatcher.new(scheduler: ActiveJobScheduler.new(serializer: YAML)),
12
12
  RubyEventStore::Dispatcher.new),
13
13
  clock: default_clock,
14
14
  correlation_id_generator: default_correlation_id_generator,
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/railtie'
4
- require 'rails_event_store/middleware'
3
+ require "rails/railtie"
4
+ require_relative "middleware"
5
5
 
6
6
  module RailsEventStore
7
7
  class Railtie < ::Rails::Railtie
8
- initializer 'rails_event_store.middleware' do |rails|
8
+ initializer "rails_event_store.middleware" do |rails|
9
9
  rails.middleware.use(::RailsEventStore::Middleware)
10
10
  end
11
11
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsEventStore
4
- VERSION = "2.0.0"
4
+ VERSION = "2.3.0"
5
5
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails_event_store_active_record'
4
- require 'rails_event_store/all'
3
+ require "rails_event_store_active_record"
4
+ require_relative "rails_event_store/all"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_event_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-30 00:00:00.000000000 Z
11
+ date: 2021-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby_event_store
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.0
19
+ version: 2.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.0
26
+ version: 2.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ruby_event_store-browser
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.0
33
+ version: 2.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.0
40
+ version: 2.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rails_event_store_active_record
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.0.0
47
+ version: 2.3.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 2.0.0
54
+ version: 2.3.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: aggregate_root
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.0
61
+ version: 2.3.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 2.0.0
68
+ version: 2.3.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -122,26 +122,16 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0.4'
125
- description: Implementation of Event Store in Ruby
126
- email:
127
- - dev@arkency.com
125
+ description: |
126
+ Rails wrapper for RubyEventStore with batteries included. Ships with asynchronous after-commit event dispatch
127
+ on top of ActiveJob, ActiveSupport::Notifications instrumentation enabled, request metadata enrichment
128
+ and opinionated directory structure generator for bounded contexts.
129
+ email: dev@arkency.com
128
130
  executables: []
129
131
  extensions: []
130
- extra_rdoc_files: []
132
+ extra_rdoc_files:
133
+ - README.md
131
134
  files:
132
- - ".mutant.yml"
133
- - CHANGELOG.md
134
- - Gemfile
135
- - Gemfile.lock
136
- - Gemfile.rails_5_0
137
- - Gemfile.rails_5_0.lock
138
- - Gemfile.rails_5_1
139
- - Gemfile.rails_5_1.lock
140
- - Gemfile.rails_5_2
141
- - Gemfile.rails_5_2.lock
142
- - Gemfile.rails_6_0
143
- - Gemfile.rails_6_0.lock
144
- - Makefile
145
135
  - README.md
146
136
  - lib/generators/rails_event_store/bounded_context_generator.rb
147
137
  - lib/generators/rails_event_store/rspec_generator.rb
@@ -162,12 +152,11 @@ files:
162
152
  - lib/rails_event_store/middleware.rb
163
153
  - lib/rails_event_store/railtie.rb
164
154
  - lib/rails_event_store/version.rb
165
- - rails_event_store.gemspec
166
155
  homepage: https://railseventstore.org
167
156
  licenses:
168
157
  - MIT
169
158
  metadata:
170
- homepage_uri: https://railseventstore.org/
159
+ homepage_uri: https://railseventstore.org
171
160
  changelog_uri: https://github.com/RailsEventStore/rails_event_store/releases
172
161
  source_code_uri: https://github.com/RailsEventStore/rails_event_store
173
162
  bug_tracker_uri: https://github.com/RailsEventStore/rails_event_store/issues
@@ -179,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
168
  requirements:
180
169
  - - ">="
181
170
  - !ruby/object:Gem::Version
182
- version: '0'
171
+ version: '2.6'
183
172
  required_rubygems_version: !ruby/object:Gem::Requirement
184
173
  requirements:
185
174
  - - ">="
@@ -189,5 +178,5 @@ requirements: []
189
178
  rubygems_version: 3.1.4
190
179
  signing_key:
191
180
  specification_version: 4
192
- summary: Event Store in Ruby
181
+ summary: Rails wrapper for RubyEventStore with batteries included
193
182
  test_files: []
data/.mutant.yml DELETED
@@ -1 +0,0 @@
1
- ../.mutant.yml
data/CHANGELOG.md DELETED
@@ -1,159 +0,0 @@
1
- Further changes can be tracked at [releases page](https://github.com/RailsEventStore/rails_event_store/releases).
2
-
3
- ### 0.14.5 (24.08.2017)
4
-
5
- * Change: ruby_event_store updated to 0.14.0
6
-
7
- ### 0.14.4 (18.08.2017)
8
-
9
- * Change: rails_event_store_active_record updated to 0.6.11
10
- * Fix: Explicit order when querying forward. Leaving it implcit to database engine choice gives different results on different engines.
11
- * Fix: Explicitly require railtie to load middleware in Rails to enrich event metadata with request metadata (PR #65)
12
-
13
- ### 0.14.3 (24.11.2016)
14
-
15
- * Fix: Fixes where is initialized event repository #62
16
-
17
- ### 0.14.2 (23.11.2016)
18
-
19
- * Change: rails_event_store_active_record updated to 0.6.10
20
- This time it will really allow to avoid ActiveRecord dependency when not using rails_event_store_active_record's
21
- event repository.
22
-
23
- ### 0.14.1 (21.11.2016)
24
-
25
- * Change: Allows to set the event repository used. #61
26
- Allow to avoid ActiveRecord dependency when not using rails_event_store_active_record's
27
- event repository. See documentation for mode details https://railseventstore.arkency.com/docs/repository.html
28
-
29
- ### 0.14.0 (28.10.2016)
30
-
31
- * Change: aggregate_root updated to 0.4.0
32
- This is a breaking change only if you use aggregate_root gem.
33
- Nothing has changed in RailsEventStore however the aggregate_root gem
34
- has been redesigned completely.
35
-
36
- ### 0.13.0 (21.10.2016)
37
-
38
- * Change: ruby_event_store updated to 0.13.0
39
- * Change: RailsEventStore::Client methods signarures aligned with RubyEventStore::Client
40
- RailsEventStore::Client is just a specialization of RubyEventStore::Client
41
- with sensible defaults. Nothing more. This will ensure both are compatible.
42
- * Change: No more ClosedStruct in Event class, you need use hashes to access data & metadata.
43
- This is a breaking change.
44
-
45
- ### 0.12.1 (11.08.2016)
46
-
47
- * Fix: aggregate_root gem updated to 0.3.5 fixing invalid method name generated for events wrapped in namespace
48
-
49
- ### 0.12.0 (10.08.2016)
50
-
51
- * Change: Updated Ruby Event Store method calls according to the newer version PR #53
52
-
53
- ### 0.11.0 (12.07.2016)
54
-
55
- * Breaking change in domain event class (Part of PR #48)
56
- * no more simple `TestEvent.new(some_attr: 'some value')`
57
- use `TestEvent.new(data: { some_attr: 'some value' })` instead
58
- * all data & metadata attributes accessible via `data` & `metadata` properties
59
- of event class
60
- * This will avoid name clashes when defining domain event data,
61
- especially important for `event_id`
62
- * Breaking change: deprecated `handle_event` method removed, use `call` instead
63
- * some domain event handlers might need method rename
64
- * Change: Mark aliased methods as deprecated (soon to be removed)
65
- * Change: Update RubyEventStore to 0.11.0 PR #48
66
- * RubyEventStore::Facade renamed to RubyEventStore::Client
67
- * Fix: Improve mutation tests coverage PR #47
68
-
69
- ### 0.10.0 (30.06.2016)
70
-
71
- * Change: Rails request details in event metadata PR #39
72
- * Change: Add dynamic subscriptions (implemented by ruby_event_store 0.9.0) PR #43
73
- * Fix: In-memory sqlite3 with schema load over prebaked filesystem blob in testing PR #41
74
-
75
- ### 0.9.0 (24.06.2016)
76
-
77
- * Change: ruby_event_store updated to 0.9.0 (Call instead of handle_event)
78
- * Change: aggregate_root updated to 0.3.1 (licensing info)
79
- * Fix: Clarify Licensing terms #36 - MIT licence it is from now
80
-
81
- ### 0.8.0 (21.06.2016)
82
-
83
- * Change: ruby_event_store updated to 0.8.0 (dynamic subscriptions)
84
- * Change: aggregate_root updated to 0.3.0 (fix circular dependency)
85
- * Change: remove SlackEventHandler
86
-
87
- ### 0.7.0 (01.06.2016)
88
-
89
- * Change: ruby_event_store updated to 0.6.0 (adding basic projections support)
90
-
91
- ### 0.6.1 (25.05.2016)
92
-
93
- * Fix: Allow to read events backward PR #32 (bugfix)
94
-
95
- ### 0.6.0 (11.04.2016)
96
-
97
- * Change: EventRepository moved to separate gem [rails_event_store_active_record](https://github.com/RailsEventStore/rails_event_store_active_record)
98
- * Change: rails_event_store_active_record updated to version 0.5.1 - allows to use custom event class
99
-
100
- ### 0.5.0 (21.03.2016)
101
-
102
- * Align with changes in `ruby_event_store` 0.5.0:
103
- * Change: Event class refactoring to make default values more explicit
104
- * Change: Let event broker to be given as a dependency
105
- * Change: No nils, use symbols instead - :any & :none replaced meaningless nil value
106
- * Change: Remove Event#event_type - use class instead
107
- * Fix: Typo fix (appent_to_stream corrected to append_to_stream)
108
- * Change: Encapsulate internals fo RailsEventStore::Client
109
- * Change: Hide `ruby_event_store` internals by adding classes in RailsEventStore module
110
-
111
- ### 0.4.1 (17.03.2016)
112
-
113
- * Fix: aggregate_root gem aligned with changes in rails_event_store
114
-
115
- ### 0.4.0 (17.03.2016)
116
-
117
- * Change: Use class names to subscribe events (ruby_event_store update to 0.4.0)
118
- * Change: EventRepository now recreate events using orginal classes
119
-
120
- ### 0.3.1 (13.03.2016)
121
-
122
- * Update to ruby_event_store 0.3.1 - fix changing timestamp on reads from repository
123
-
124
- ### 0.3.0 (03.03.2016)
125
-
126
- * Update to ruby_event_store 0.3.0 - see ruby_event_store changelog for more details
127
- * Implement reading forward & backward (aliasold methods to read forward)
128
- * Implement paging when reading from all streams
129
-
130
- ### 0.2.2 (25.02.2016)
131
-
132
- * Restore AggregateRoot in RES, but this time as a dependency on aggregate_root gem
133
-
134
- ### 0.2.1 (25.02.2016)
135
-
136
- * Fix: Error when trying to #read_all_streams #20
137
-
138
- ### 0.2.0 (29.01.2016)
139
-
140
- * Removed EventEntity class
141
- * All read & returned events are not instances of RailsEventStore::Event class
142
- * RailsEventStore::Event class allows for easier events creation and access to data attributes
143
- * AggregateRoot module & repository extracted to new gem (aggregate_root)
144
-
145
- ### 0.1.2 (26.05.2015)
146
-
147
- * Moved most core features to the separate gem `ruby_event_store`. We left only rails related implementation here.
148
- * It's now assumed that `event_id` has a unique index in the database (the same is applied to the initial migration generator)
149
- * Model is no longer validating uniqueness of `event_id` via ActiveRecord
150
- * Event does not need any data now, it can be created just like `OrderCreated.new` (without any arguments)
151
- * Migration generator is no more generating the `updated_at` field in the `event_store_events` table. We also advise to remove this column, since events shouldn't be *ever* modified.
152
- * In the event's metadata there's a new field `published_at`
153
- * Added the `subscribe_to_all_events` method to `RailsEventStore::Client`
154
- * Subscribing to only one event via `client.subscribe(subscriber, 'OrderCreated')` no longer works. You should use `client.subscribe(subscriber, ['OrderCreated'])` instead.
155
- * Default event's name is no longer `OrderCreated` for the `OrderCreated` event in the `Orders` namespace, now it's `Orders::OrderCreated`
156
-
157
- ### 0.1.1 (22.04.2015)
158
-
159
- Initial release.