aggregate_root 2.19.1 → 2.19.2
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/lib/aggregate_root/configuration.rb +0 -4
- data/lib/aggregate_root/default_apply_strategy.rb +4 -1
- data/lib/aggregate_root/deprecated.rb +33 -0
- data/lib/aggregate_root/repository.rb +0 -4
- data/lib/aggregate_root/version.rb +1 -1
- data/lib/aggregate_root.rb +3 -6
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a981cffad71bcec9a31feb1dd5380b28cfd84d85492eb8514f7170ebf6f39a87
|
|
4
|
+
data.tar.gz: 7021c52bc34f625b674fd54cd63e6fa3d76d01c5c9deb6c8c402bc30551c24ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6130d6ab8071b2a0a33f0cd80e09be49cf8529eb816f03dfbc66167a1166724d3dc8371fa59584e11bb9766a11ad5464bcdc4a167640b450ff739b615e540e3c
|
|
7
|
+
data.tar.gz: b15afa9d209eba616e46c4fc317faf498e9a6e749c31c62f27c74b2c1eef43c985936706dd35567c00942f7993406dcda34080c31690a25ac4216b8936ff56d9
|
|
@@ -6,10 +6,6 @@ module AggregateRoot
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def self.configure
|
|
9
|
-
warn <<~EOW
|
|
10
|
-
DEPRECATION WARNING: `AggregateRoot.configure` and `AggregateRoot::Configuration` are deprecated and will be removed in the next major release.
|
|
11
|
-
Use `AggregateRoot::Repository.new(event_store)` with explicit event store injection instead.
|
|
12
|
-
EOW
|
|
13
9
|
self.configuration ||= Configuration.new
|
|
14
10
|
yield(configuration)
|
|
15
11
|
end
|
|
@@ -41,7 +41,10 @@ module AggregateRoot
|
|
|
41
41
|
def apply_handler_name(aggregate, event_type)
|
|
42
42
|
name = "apply_#{Transform.to_snake_case(event_type(event_type))}"
|
|
43
43
|
if aggregate.respond_to?(name, true)
|
|
44
|
-
warn
|
|
44
|
+
RubyEventStore::Deprecations.warn(
|
|
45
|
+
:"apply_naming_convention_#{event_type}",
|
|
46
|
+
message: DEPRECATION_MESSAGE % event_type,
|
|
47
|
+
)
|
|
45
48
|
end
|
|
46
49
|
name
|
|
47
50
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module AggregateRoot
|
|
4
|
+
RubyEventStore::Deprecations.register(
|
|
5
|
+
:with_default_apply_strategy,
|
|
6
|
+
"Please replace include AggregateRoot.with_default_apply_strategy with include AggregateRoot",
|
|
7
|
+
)
|
|
8
|
+
RubyEventStore::Deprecations.deprecate_class_method(
|
|
9
|
+
AggregateRoot,
|
|
10
|
+
:with_default_apply_strategy,
|
|
11
|
+
key: :with_default_apply_strategy,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
RubyEventStore::Deprecations.register(
|
|
15
|
+
:with_strategy,
|
|
16
|
+
"Please replace include AggregateRoot.with_strategy(...) with include AggregateRoot.with(strategy: ...)",
|
|
17
|
+
)
|
|
18
|
+
RubyEventStore::Deprecations.deprecate_class_method(AggregateRoot, :with_strategy, key: :with_strategy)
|
|
19
|
+
|
|
20
|
+
RubyEventStore::Deprecations.register(
|
|
21
|
+
:aggregate_root_configure,
|
|
22
|
+
"`AggregateRoot.configure` and `AggregateRoot::Configuration` are deprecated and will be removed in the next major release.\n" \
|
|
23
|
+
"Use `AggregateRoot::Repository.new(event_store)` with explicit event store injection instead.",
|
|
24
|
+
)
|
|
25
|
+
RubyEventStore::Deprecations.deprecate_class_method(AggregateRoot, :configure, key: :aggregate_root_configure)
|
|
26
|
+
|
|
27
|
+
RubyEventStore::Deprecations.register(
|
|
28
|
+
:repository_default_event_store,
|
|
29
|
+
"Calling `AggregateRoot::Repository.new` without an event store argument relies on `AggregateRoot::Configuration` which is deprecated and will be removed in the next major release.\n" \
|
|
30
|
+
"Use `AggregateRoot::Repository.new(event_store)` with explicit event store injection instead.",
|
|
31
|
+
)
|
|
32
|
+
RubyEventStore::Deprecations.deprecate(Repository, :default_event_store, key: :repository_default_event_store)
|
|
33
|
+
end
|
|
@@ -33,10 +33,6 @@ module AggregateRoot
|
|
|
33
33
|
attr_reader :event_store
|
|
34
34
|
|
|
35
35
|
def default_event_store
|
|
36
|
-
warn <<~EOW
|
|
37
|
-
DEPRECATION WARNING: Calling `AggregateRoot::Repository.new` without an event store argument relies on `AggregateRoot::Configuration` which is deprecated and will be removed in the next major release.
|
|
38
|
-
Use `AggregateRoot::Repository.new(event_store)` with explicit event store injection instead.
|
|
39
|
-
EOW
|
|
40
36
|
AggregateRoot.configuration.default_event_store
|
|
41
37
|
end
|
|
42
38
|
end
|
data/lib/aggregate_root.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "ruby_event_store/deprecations"
|
|
3
4
|
require_relative "aggregate_root/version"
|
|
4
5
|
require_relative "aggregate_root/configuration"
|
|
5
6
|
require_relative "aggregate_root/transform"
|
|
@@ -81,18 +82,12 @@ module AggregateRoot
|
|
|
81
82
|
def self.with_default_apply_strategy
|
|
82
83
|
Module.new do
|
|
83
84
|
def self.included(host_class)
|
|
84
|
-
warn <<~EOW
|
|
85
|
-
Please replace include AggregateRoot.with_default_apply_strategy with include AggregateRoot
|
|
86
|
-
EOW
|
|
87
85
|
host_class.include AggregateRoot
|
|
88
86
|
end
|
|
89
87
|
end
|
|
90
88
|
end
|
|
91
89
|
|
|
92
90
|
def self.with_strategy(strategy)
|
|
93
|
-
warn <<~EOW
|
|
94
|
-
Please replace include AggregateRoot.with_strategy(...) with include AggregateRoot.with(strategy: ...)
|
|
95
|
-
EOW
|
|
96
91
|
with(strategy: strategy)
|
|
97
92
|
end
|
|
98
93
|
|
|
@@ -117,3 +112,5 @@ module AggregateRoot
|
|
|
117
112
|
host_class.include with
|
|
118
113
|
end
|
|
119
114
|
end
|
|
115
|
+
|
|
116
|
+
require_relative "aggregate_root/deprecated"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aggregate_root
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.19.
|
|
4
|
+
version: 2.19.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Arkency
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 2.19.
|
|
18
|
+
version: 2.19.2
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 2.19.
|
|
25
|
+
version: 2.19.2
|
|
26
26
|
email: dev@arkency.com
|
|
27
27
|
executables: []
|
|
28
28
|
extensions: []
|
|
@@ -33,6 +33,7 @@ files:
|
|
|
33
33
|
- lib/aggregate_root.rb
|
|
34
34
|
- lib/aggregate_root/configuration.rb
|
|
35
35
|
- lib/aggregate_root/default_apply_strategy.rb
|
|
36
|
+
- lib/aggregate_root/deprecated.rb
|
|
36
37
|
- lib/aggregate_root/instrumented_apply_strategy.rb
|
|
37
38
|
- lib/aggregate_root/instrumented_repository.rb
|
|
38
39
|
- lib/aggregate_root/repository.rb
|
|
@@ -62,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
62
63
|
- !ruby/object:Gem::Version
|
|
63
64
|
version: '0'
|
|
64
65
|
requirements: []
|
|
65
|
-
rubygems_version: 4.0.
|
|
66
|
+
rubygems_version: 4.0.10
|
|
66
67
|
specification_version: 4
|
|
67
68
|
summary: Event sourced aggregate root implementation for RubyEventStore
|
|
68
69
|
test_files: []
|