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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8960b3ed56b2a2a0a87bcc19d21a9b8c3d5775ab3e110d0dafa2e9bb9bbae54
4
- data.tar.gz: 87ea0f825d91cdc8fb0bd4c47924a47b5fef465c9034d3a6889b8132668b85bf
3
+ metadata.gz: a981cffad71bcec9a31feb1dd5380b28cfd84d85492eb8514f7170ebf6f39a87
4
+ data.tar.gz: 7021c52bc34f625b674fd54cd63e6fa3d76d01c5c9deb6c8c402bc30551c24ad
5
5
  SHA512:
6
- metadata.gz: c9ab03ee7df3bc9090c5d1ce2f190b4f6519946c8adbfe66ceb34e0d97ae374aa6f0d354d4b57570c66a28f361dfe4184d37f6b9231f3e65cc1dcb6f5f5cf6aa
7
- data.tar.gz: 4701c2be5484ba2e58609adb0d885c317f73719af5edb6284527cb22b9e6d58a9a5970e07ec0399b91f49bb237902e6e14f4fbfab1ec48cba46533683ec49a58
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 DEPRECATION_MESSAGE % event_type
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AggregateRoot
4
- VERSION = "2.19.1"
4
+ VERSION = "2.19.2"
5
5
  end
@@ -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.1
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.1
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.1
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.6
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: []