ruby_event_store 2.0.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/ruby_event_store/client.rb +37 -6
- data/lib/ruby_event_store/errors.rb +1 -0
- data/lib/ruby_event_store/event.rb +5 -2
- data/lib/ruby_event_store/in_memory_repository.rb +67 -15
- data/lib/ruby_event_store/instrumented_dispatcher.rb +12 -2
- data/lib/ruby_event_store/instrumented_repository.rb +17 -11
- data/lib/ruby_event_store/mappers/default.rb +1 -28
- data/lib/ruby_event_store/mappers/encryption_mapper.rb +2 -0
- data/lib/ruby_event_store/mappers/forgotten_data.rb +1 -1
- data/lib/ruby_event_store/mappers/in_memory_encryption_key_repository.rb +1 -1
- data/lib/ruby_event_store/mappers/instrumented_mapper.rb +0 -4
- data/lib/ruby_event_store/mappers/json_mapper.rb +7 -5
- data/lib/ruby_event_store/mappers/pipeline.rb +2 -26
- data/lib/ruby_event_store/mappers/pipeline_mapper.rb +0 -4
- data/lib/ruby_event_store/mappers/transformation/domain_event.rb +13 -3
- data/lib/ruby_event_store/mappers/transformation/upcast.rb +37 -0
- data/lib/ruby_event_store/metadata.rb +3 -3
- data/lib/ruby_event_store/projection.rb +2 -2
- data/lib/ruby_event_store/spec/broker_lint.rb +11 -11
- data/lib/ruby_event_store/spec/event_lint.rb +9 -9
- data/lib/ruby_event_store/spec/event_repository_lint.rb +338 -281
- data/lib/ruby_event_store/spec/subscriptions_lint.rb +41 -33
- data/lib/ruby_event_store/subscriptions.rb +24 -9
- data/lib/ruby_event_store/transform_keys.rb +5 -5
- data/lib/ruby_event_store/version.rb +1 -1
- data/lib/ruby_event_store.rb +43 -44
- metadata +26 -17
- data/.mutant.yml +0 -1
- data/CHANGELOG.md +0 -93
- data/Gemfile +0 -9
- data/Gemfile.lock +0 -118
- data/Makefile +0 -32
- data/lib/ruby_event_store/mappers/deprecated_wrapper.rb +0 -33
- data/lib/ruby_event_store/mappers/transformation/serialization.rb +0 -36
- data/ruby_event_store.gemspec +0 -27
data/CHANGELOG.md
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
Further changes can be tracked at [releases page](https://github.com/RailsEventStore/rails_event_store/releases).
|
2
|
-
|
3
|
-
### 0.14.0 (21.08.2017)
|
4
|
-
|
5
|
-
* Change: Add lint for 3rd party implementations of dispatcher
|
6
|
-
* Change: Deprecated MethodNotDefined error, use InvalidHandler instead
|
7
|
-
|
8
|
-
### 0.13.0 (15.10.2016)
|
9
|
-
|
10
|
-
* Change: Dropped ClosedStruct event (meta)data wrapping PR #34
|
11
|
-
Fix for Issue with ClosedStruct and object_id #33
|
12
|
-
* Change: Refactor RubyEventStore::Client to have the same methods signatures as RailsEventStore::Client (PR #35),
|
13
|
-
this will allow to remove most of the code form RailsEventStore::Client without breaking current
|
14
|
-
applications that use RailsEventStore::Client. This change is however a breaking one for RubyEventStore.
|
15
|
-
|
16
|
-
### 0.12.1 (11.08.2016)
|
17
|
-
|
18
|
-
* Fix: improve EventRepository specification tests (mutation tests)
|
19
|
-
|
20
|
-
### 0.12.0 (10.08.2016)
|
21
|
-
|
22
|
-
* Change: all public methods arguments with default values are now keyword arguments
|
23
|
-
|
24
|
-
### 0.11.0 (12.07.2016)
|
25
|
-
|
26
|
-
* Change: Call instead of handle_event, handle_event marked as deprecated in PR #18 is now removed PR #25
|
27
|
-
* Change: Rename RubyEventStore::Facade to RubyEventStore::Client PR #26
|
28
|
-
|
29
|
-
### 0.10.1 (12.07.2016)
|
30
|
-
|
31
|
-
* Added few new tests for repositories
|
32
|
-
|
33
|
-
### 0.10.0 (12.07.2016)
|
34
|
-
|
35
|
-
* Fix: When using `append_to_stream`, expected version is no longer compared using `equal?` commit bdbe4600073d278cbf1024e8d49801fec768f6a7
|
36
|
-
* Change: Creating events with data is now done using `data` keyword argument. Previously events were created using the syntax `OrderCreated.new(order_id: 123)`, now it has to be `OrderCreated.new(data: { order_id: 123 })`. PR #24
|
37
|
-
* Change: Access to `data` attributes in an event is now using `event.data.some_attribute` syntax. `event.data[:some_attribute]` won't work either. PR #24
|
38
|
-
* Change: Only events with the same name, event_id and data are equal - metadata is no longer taken into account PR #24
|
39
|
-
* Change: `metadata[:timestamp]` is now set when event is appended to the stream, not when it is initialized PR #24
|
40
|
-
* Change: Initialization of `RubyEventStore::Facade` is now using keyword arguments PR #24
|
41
|
-
* Add support to `metadata_proc` PR #24
|
42
|
-
* `ClosedStruct` is now a dependency PR #24
|
43
|
-
|
44
|
-
### 0.9.0 (24.06.2016)
|
45
|
-
|
46
|
-
* Change: Call instead of handle_event, handle_event stays for now but is deprecated PR #18
|
47
|
-
* Fix: Clarify Licensing terms #23 - MIT licence it is from now
|
48
|
-
|
49
|
-
### 0.8.0 (21.06.2016)
|
50
|
-
|
51
|
-
* Change: Possibility to create projection based on all events PR #19
|
52
|
-
|
53
|
-
### 0.7.0 (21.06.2016)
|
54
|
-
|
55
|
-
* Change: support for Dynamic subscriptions PR #20
|
56
|
-
* Change: Add lint for 3rd party implementations of event broker PR #21
|
57
|
-
|
58
|
-
### 0.6.0 (25.05.2016)
|
59
|
-
|
60
|
-
* Ability to provide a custom dispatcher to PubSub::Broker PR #12
|
61
|
-
* Add support for projections PR #13
|
62
|
-
* Added prettier message for case of missing #handle_event method. PR #14
|
63
|
-
* Make file to run all the things PR #15
|
64
|
-
|
65
|
-
### 0.5.0 (21.03.2016)
|
66
|
-
|
67
|
-
* Change: Event class refactoring to make default values more explicit PR #11
|
68
|
-
* Change: No nils, use symbols instead - :any & :none replaced meaningless nil value
|
69
|
-
* Change: Let event broker to be given as a dependency
|
70
|
-
* Change: Remove Event#event_type - use class instead PR #10
|
71
|
-
|
72
|
-
### 0.4.0 (17.03.2016)
|
73
|
-
|
74
|
-
* Change: Use class names to subscribe events PR #8
|
75
|
-
|
76
|
-
### 0.3.1 (13.03.2016)
|
77
|
-
|
78
|
-
* Fix Don't overwrite timestamps when reading from repository
|
79
|
-
|
80
|
-
### 0.3.0 (03.03.2016)
|
81
|
-
|
82
|
-
* Change: read_all_streams won't group_by results by stream name PR #4
|
83
|
-
* Change: new way of define attributes of domain event PR #5
|
84
|
-
* Change: reading forward and backward, refactored facade interface #6
|
85
|
-
* Change: in memory event repository is now part of the gem, with shared specification PR #7
|
86
|
-
|
87
|
-
### 0.2.0 (27.01.2016)
|
88
|
-
|
89
|
-
* Change: Return the event that the repository returns PR #2
|
90
|
-
|
91
|
-
### 0.1.0 (26.05.2015)
|
92
|
-
|
93
|
-
Initial version
|
data/Gemfile
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
3
|
-
|
4
|
-
gemspec
|
5
|
-
|
6
|
-
eval_gemfile '../support/bundler/Gemfile.shared'
|
7
|
-
|
8
|
-
gem 'activesupport', '6.0.3.4'
|
9
|
-
gem 'concurrent-ruby', github: 'ruby-concurrency/concurrent-ruby', ref: 'c4cbc968c55e5b983dae953095761896220c46d1'
|
data/Gemfile.lock
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: https://github.com/ruby-concurrency/concurrent-ruby.git
|
3
|
-
revision: c4cbc968c55e5b983dae953095761896220c46d1
|
4
|
-
ref: c4cbc968c55e5b983dae953095761896220c46d1
|
5
|
-
specs:
|
6
|
-
concurrent-ruby (1.1.7)
|
7
|
-
|
8
|
-
PATH
|
9
|
-
remote: .
|
10
|
-
specs:
|
11
|
-
ruby_event_store (2.0.0)
|
12
|
-
concurrent-ruby (~> 1.0, >= 1.1.6)
|
13
|
-
|
14
|
-
GEM
|
15
|
-
remote: https://rubygems.org/
|
16
|
-
remote: https://oss:7AXfeZdAfCqL1PvHm2nvDJO6Zd9UW8IK@gem.mutant.dev/
|
17
|
-
specs:
|
18
|
-
abstract_type (0.0.7)
|
19
|
-
activesupport (6.0.3.4)
|
20
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
21
|
-
i18n (>= 0.7, < 2)
|
22
|
-
minitest (~> 5.1)
|
23
|
-
tzinfo (~> 1.1)
|
24
|
-
zeitwerk (~> 2.2, >= 2.2.2)
|
25
|
-
adamantium (0.2.0)
|
26
|
-
ice_nine (~> 0.11.0)
|
27
|
-
memoizable (~> 0.4.0)
|
28
|
-
anima (0.3.2)
|
29
|
-
abstract_type (~> 0.0.7)
|
30
|
-
adamantium (~> 0.2)
|
31
|
-
equalizer (~> 0.0.11)
|
32
|
-
ast (2.4.1)
|
33
|
-
concord (0.1.6)
|
34
|
-
adamantium (~> 0.2.0)
|
35
|
-
equalizer (~> 0.0.9)
|
36
|
-
diff-lcs (1.4.4)
|
37
|
-
equalizer (0.0.11)
|
38
|
-
i18n (1.8.5)
|
39
|
-
concurrent-ruby (~> 1.0)
|
40
|
-
ice_nine (0.11.2)
|
41
|
-
memoizable (0.4.2)
|
42
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
43
|
-
minitest (5.14.2)
|
44
|
-
mprelude (0.1.0)
|
45
|
-
abstract_type (~> 0.0.7)
|
46
|
-
adamantium (~> 0.2.0)
|
47
|
-
concord (~> 0.1.5)
|
48
|
-
equalizer (~> 0.0.9)
|
49
|
-
ice_nine (~> 0.11.1)
|
50
|
-
procto (~> 0.0.2)
|
51
|
-
mutant (0.10.22)
|
52
|
-
abstract_type (~> 0.0.7)
|
53
|
-
adamantium (~> 0.2.0)
|
54
|
-
anima (~> 0.3.1)
|
55
|
-
ast (~> 2.2)
|
56
|
-
concord (~> 0.1.5)
|
57
|
-
diff-lcs (~> 1.3)
|
58
|
-
equalizer (~> 0.0.9)
|
59
|
-
ice_nine (~> 0.11.1)
|
60
|
-
memoizable (~> 0.4.2)
|
61
|
-
mprelude (~> 0.1.0)
|
62
|
-
parser (~> 3.0.0)
|
63
|
-
procto (~> 0.0.2)
|
64
|
-
unparser (~> 0.5.6)
|
65
|
-
variable (~> 0.0.1)
|
66
|
-
mutant-license (0.1.1.2.1627430819213747598431630701693729869473.0)
|
67
|
-
mutant-rspec (0.10.22)
|
68
|
-
mutant (= 0.10.22)
|
69
|
-
rspec-core (>= 3.8.0, < 4.0.0)
|
70
|
-
parser (3.0.0.0)
|
71
|
-
ast (~> 2.4.1)
|
72
|
-
procto (0.0.3)
|
73
|
-
rake (13.0.3)
|
74
|
-
rspec (3.10.0)
|
75
|
-
rspec-core (~> 3.10.0)
|
76
|
-
rspec-expectations (~> 3.10.0)
|
77
|
-
rspec-mocks (~> 3.10.0)
|
78
|
-
rspec-core (3.10.1)
|
79
|
-
rspec-support (~> 3.10.0)
|
80
|
-
rspec-expectations (3.10.1)
|
81
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
82
|
-
rspec-support (~> 3.10.0)
|
83
|
-
rspec-mocks (3.10.1)
|
84
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
85
|
-
rspec-support (~> 3.10.0)
|
86
|
-
rspec-support (3.10.1)
|
87
|
-
thread_safe (0.3.6)
|
88
|
-
tzinfo (1.2.9)
|
89
|
-
thread_safe (~> 0.1)
|
90
|
-
unparser (0.5.6)
|
91
|
-
abstract_type (~> 0.0.7)
|
92
|
-
adamantium (~> 0.2.0)
|
93
|
-
anima (~> 0.3.1)
|
94
|
-
concord (~> 0.1.5)
|
95
|
-
diff-lcs (~> 1.3)
|
96
|
-
equalizer (~> 0.0.9)
|
97
|
-
mprelude (~> 0.1.0)
|
98
|
-
parser (>= 3.0.0)
|
99
|
-
procto (~> 0.0.2)
|
100
|
-
variable (0.0.1)
|
101
|
-
equalizer (~> 0.0.11)
|
102
|
-
zeitwerk (2.4.2)
|
103
|
-
|
104
|
-
PLATFORMS
|
105
|
-
ruby
|
106
|
-
|
107
|
-
DEPENDENCIES
|
108
|
-
activesupport (= 6.0.3.4)
|
109
|
-
concurrent-ruby!
|
110
|
-
mutant (~> 0.10.21)
|
111
|
-
mutant-license!
|
112
|
-
mutant-rspec (~> 0.10.21)
|
113
|
-
rake (>= 10.0)
|
114
|
-
rspec (~> 3.6)
|
115
|
-
ruby_event_store!
|
116
|
-
|
117
|
-
BUNDLED WITH
|
118
|
-
2.1.4
|
data/Makefile
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
GEM_VERSION = $(shell cat ../RES_VERSION)
|
2
|
-
GEM_NAME = ruby_event_store
|
3
|
-
REQUIRE = $(GEM_NAME)
|
4
|
-
IGNORE = RubyEventStore::InMemoryRepository\#with_synchronize \
|
5
|
-
RubyEventStore::Client\#initialize \
|
6
|
-
RubyEventStore::Client\#default_clock \
|
7
|
-
RubyEventStore::Client\#default_correlation_id_generator \
|
8
|
-
RubyEventStore::Client::Within\#add_thread_subscribers \
|
9
|
-
RubyEventStore::Client::Within\#add_thread_global_subscribers \
|
10
|
-
RubyEventStore::Client::Within\#call \
|
11
|
-
RubyEventStore::Mappers::InMemoryEncryptionKeyRepository\#prepare_encrypt \
|
12
|
-
RubyEventStore::Mappers::EncryptionKey\#prepare_encrypt \
|
13
|
-
RubyEventStore::Mappers::EncryptionKey\#prepare_decrypt \
|
14
|
-
RubyEventStore::Mappers::EncryptionKey\#prepare_auth_data \
|
15
|
-
RubyEventStore::Mappers::EncryptionKey\#encrypt_authenticated \
|
16
|
-
RubyEventStore::Mappers::EncryptionKey\#ciphertext_from_authenticated \
|
17
|
-
RubyEventStore::Mappers::Default\#serializer \
|
18
|
-
RubyEventStore::Mappers::JSONMapper\#serializer \
|
19
|
-
RubyEventStore::Mappers::NullMapper\#serializer \
|
20
|
-
RubyEventStore::Mappers::EncryptionMapper\#serializer \
|
21
|
-
RubyEventStore::Mappers::PipelineMapper\#serializer \
|
22
|
-
RubyEventStore::Mappers::DeprecatedWrapper\#serializer \
|
23
|
-
RubyEventStore::Mappers::InstrumentedMapper\#serializer \
|
24
|
-
RubyEventStore::Mappers::Transformation::Serialization*
|
25
|
-
|
26
|
-
SUBJECT ?= RubyEventStore*
|
27
|
-
|
28
|
-
include ../support/make/install.mk
|
29
|
-
include ../support/make/test.mk
|
30
|
-
include ../support/make/mutant.mk
|
31
|
-
include ../support/make/gem.mk
|
32
|
-
include ../support/make/help.mk
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module RubyEventStore
|
2
|
-
module Mappers
|
3
|
-
class DeprecatedWrapper
|
4
|
-
def initialize(mapper)
|
5
|
-
@mapper = mapper
|
6
|
-
end
|
7
|
-
|
8
|
-
def serializer
|
9
|
-
@mapper.serializer
|
10
|
-
end
|
11
|
-
|
12
|
-
def event_to_record(any)
|
13
|
-
@mapper.event_to_record(any)
|
14
|
-
rescue NoMethodError => e
|
15
|
-
raise unless e.message =~ /undefined method `event_to_record/
|
16
|
-
warn <<~EOW
|
17
|
-
Deprecation: Please rename #{@mapper.class}#event_to_serialized_record to #{@mapper.class}#event_to_record.
|
18
|
-
EOW
|
19
|
-
@mapper.event_to_serialized_record(any)
|
20
|
-
end
|
21
|
-
|
22
|
-
def record_to_event(any)
|
23
|
-
@mapper.record_to_event(any)
|
24
|
-
rescue NoMethodError => e
|
25
|
-
raise unless e.message =~ /undefined method `record_to_event/
|
26
|
-
warn <<~EOW
|
27
|
-
Deprecation: Please rename #{@mapper.class}#serialized_record_to_event to #{@mapper.class}#record_to_event.
|
28
|
-
EOW
|
29
|
-
@mapper.serialized_record_to_event(any)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
|
5
|
-
module RubyEventStore
|
6
|
-
module Mappers
|
7
|
-
module Transformation
|
8
|
-
class Serialization
|
9
|
-
def initialize(serializer: YAML)
|
10
|
-
warn <<~EOW
|
11
|
-
#{self.class} has been deprecated and is effectively no-op. You should remove this transformation from your pipeline.
|
12
|
-
|
13
|
-
Instead, pass the serializer directly to the repository and the scheduler. For example:
|
14
|
-
|
15
|
-
Rails.configuration.event_store = RailsEventStore::Client.new(
|
16
|
-
mapper: RubyEventStore::Mappers::Default.new,
|
17
|
-
repository: RailsEventStoreActiveRecord::EventRepository.new(serializer: #{serializer}),
|
18
|
-
dispatcher: RubyEventStore::ComposedDispatcher.new(
|
19
|
-
RubyEventStore::ImmediateAsyncDispatcher.new(scheduler: ActiveJobScheduler.new(serializer: #{serializer}),
|
20
|
-
RubyEventStore::Dispatcher.new
|
21
|
-
)
|
22
|
-
)
|
23
|
-
EOW
|
24
|
-
end
|
25
|
-
|
26
|
-
def dump(item)
|
27
|
-
item
|
28
|
-
end
|
29
|
-
|
30
|
-
def load(item)
|
31
|
-
item
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
data/ruby_event_store.gemspec
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'ruby_event_store/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'ruby_event_store'
|
8
|
-
spec.version = RubyEventStore::VERSION
|
9
|
-
spec.licenses = ['MIT']
|
10
|
-
spec.authors = ['Arkency']
|
11
|
-
spec.email = ['dev@arkency.com']
|
12
|
-
|
13
|
-
spec.summary = %q{Event Store in Ruby}
|
14
|
-
spec.description = %q{Implementation of Event Store in Ruby}
|
15
|
-
spec.homepage = 'https://railseventstore.org'
|
16
|
-
spec.metadata = {
|
17
|
-
"homepage_uri" => "https://railseventstore.org/",
|
18
|
-
"changelog_uri" => "https://github.com/RailsEventStore/rails_event_store/releases",
|
19
|
-
"source_code_uri" => "https://github.com/RailsEventStore/rails_event_store",
|
20
|
-
"bug_tracker_uri" => "https://github.com/RailsEventStore/rails_event_store/issues",
|
21
|
-
}
|
22
|
-
|
23
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
-
spec.require_paths = ['lib']
|
25
|
-
|
26
|
-
spec.add_dependency 'concurrent-ruby', '~> 1.0', '>= 1.1.6'
|
27
|
-
end
|