aggregate_root 0.18.2 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/aggregate_root.gemspec +2 -2
- data/lib/aggregate_root.rb +7 -3
- data/lib/aggregate_root/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 367ccbb494947fa3c5cd994cbecf41375c58701e
|
4
|
+
data.tar.gz: 97a6c86b8074cdff743719b2766964d1b94fe97e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b72579fe560266eea0e3bbb324bad7f8f8ba96a6850b9cfb19b1246d60924e10a2b526d7002356856a9d65c0e75b66ea6829de6fbc808f7bc1c46b34269a7d7
|
7
|
+
data.tar.gz: d3d2cfddb592ee8050820a49a97e31a6bc756b884202b31fcda568d10f8009d285f0dae74fbdc582dbf41a51995b4941791ea79e68129a3f97af76544e367cb4
|
data/Gemfile
CHANGED
data/aggregate_root.gemspec
CHANGED
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.15'
|
23
23
|
spec.add_development_dependency 'rake', '~> 10.0'
|
24
24
|
spec.add_development_dependency 'rspec', '~> 3.6'
|
25
|
-
spec.add_development_dependency 'rails', '~>
|
26
|
-
spec.add_development_dependency 'ruby_event_store', '= 0.
|
25
|
+
spec.add_development_dependency 'rails', '~> 5.1'
|
26
|
+
spec.add_development_dependency 'ruby_event_store', '= 0.19.0'
|
27
27
|
spec.add_development_dependency 'mutant-rspec', '~> 0.8.14'
|
28
28
|
|
29
29
|
spec.add_dependency 'activesupport', '>= 3.0'
|
data/lib/aggregate_root.rb
CHANGED
@@ -17,14 +17,14 @@ module AggregateRoot
|
|
17
17
|
events.each do |event|
|
18
18
|
apply(event)
|
19
19
|
end
|
20
|
+
@version = events.size - 1
|
20
21
|
@unpublished_events = nil
|
21
22
|
self
|
22
23
|
end
|
23
24
|
|
24
25
|
def store(stream_name = loaded_from_stream_name, event_store: default_event_store)
|
25
|
-
unpublished_events
|
26
|
-
|
27
|
-
end
|
26
|
+
event_store.publish_events(unpublished_events, stream_name: stream_name, expected_version: version)
|
27
|
+
@version += unpublished_events.size
|
28
28
|
@unpublished_events = nil
|
29
29
|
end
|
30
30
|
|
@@ -39,6 +39,10 @@ module AggregateRoot
|
|
39
39
|
@unpublished_events ||= []
|
40
40
|
end
|
41
41
|
|
42
|
+
def version
|
43
|
+
@version ||= -1
|
44
|
+
end
|
45
|
+
|
42
46
|
def apply_strategy
|
43
47
|
DefaultApplyStrategy.new
|
44
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aggregate_root
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arkency
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,28 +58,28 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '5.1'
|
62
62
|
type: :development
|
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: '
|
68
|
+
version: '5.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: ruby_event_store
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.19.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.19.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: mutant-rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|