aggregate_root 0.4.0 → 0.15.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/CHANGELOG.md +2 -0
- data/Gemfile +2 -1
- data/Makefile +4 -0
- data/README.md +0 -28
- data/aggregate_root.gemspec +3 -2
- data/lib/aggregate_root/default_apply_strategy.rb +19 -2
- data/lib/aggregate_root/version.rb +1 -1
- metadata +25 -15
- data/.gitignore +0 -9
- data/.travis.yml +0 -13
- data/CONTRIBUTING.md +0 -27
- data/LICENSE +0 -22
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: febd2065a584498efd38815e15ef932c6e85f5e4
|
|
4
|
+
data.tar.gz: 149285e9f0f3f6c700349d21f3171bc15ae0db58
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: db3ea233608ec7290a3b3b6c8f84e83f6d7a950bb9b5ba91394e51f2f49a943b551f98bab79d7d958f4873e056104dcc89ff0a13ba2e30c576d07a37b144cbf9
|
|
7
|
+
data.tar.gz: 1fd3f7a28739ea3e0ead978fbab1122660ba3fae8c3a6422c2f7f5a84c917600944f368bb93cd0e9e0aadff775a106e5e574e4981ffa813268a5f5d9c505e6c2
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Makefile
CHANGED
|
@@ -12,6 +12,10 @@ mutate: test ## Run mutation tests
|
|
|
12
12
|
@echo "Running mutation tests - only 100% free mutation will be accepted"
|
|
13
13
|
@bundle exec mutant --include lib --require aggregate_root --use rspec "AggregateRoot*"
|
|
14
14
|
|
|
15
|
+
release:
|
|
16
|
+
@rake build
|
|
17
|
+
@rake release:rubygem_push
|
|
18
|
+
|
|
15
19
|
.PHONY: help
|
|
16
20
|
|
|
17
21
|
help:
|
data/README.md
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
[](https://travis-ci.org/arkency/aggregate_root)
|
|
2
|
-
[](https://badge.fury.io/rb/aggregate_root)
|
|
3
|
-
[](https://codeclimate.com/github/arkency/aggregate_root)
|
|
4
|
-
[](https://codeclimate.com/github/arkency/aggregate_root/coverage)
|
|
5
|
-
[](https://gitter.im/arkency/rails_event_store?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
6
|
-
|
|
7
1
|
# AggregateRoot
|
|
8
2
|
|
|
9
3
|
Event sourced (with Rails Event Store) aggregate root implementation.
|
|
@@ -128,25 +122,3 @@ There're already few blog posts about building an event sourced applications wit
|
|
|
128
122
|
* [Testing an Event Sourced application](http://blog.arkency.com/2015/07/testing-event-sourced-application/)
|
|
129
123
|
* [Testing Event Sourced application - the read side](http://blog.arkency.com/2015/09/testing-event-sourced-application-the-read-side/)
|
|
130
124
|
* [One event to rule them all](http://blog.arkency.com/2016/01/one-event-to-rule-them-all/)
|
|
131
|
-
|
|
132
|
-
# Contributing
|
|
133
|
-
|
|
134
|
-
Check the contribution guide on [CONTRIBUTING.md](https://github.com/arkency/aggregate_root/blob/master/CONTRIBUTING.md)
|
|
135
|
-
|
|
136
|
-
We're aiming for 100% mutation coverage in this project.
|
|
137
|
-
Read the reasoning:
|
|
138
|
-
|
|
139
|
-
[Why I want to introduce mutation testing to the rails_event_store gem](http://blog.arkency.com/2015/04/why-i-want-to-introduce-mutation-testing-to-the-rails-event-store-gem/)
|
|
140
|
-
|
|
141
|
-
[Mutation testing and continuous integration](http://blog.arkency.com/2015/05/mutation-testing-and-continuous-integration/)
|
|
142
|
-
|
|
143
|
-
In practice, it means that we run `make mutate` as part of the CI process.
|
|
144
|
-
Whenever you fix a bug or add a new feature, we require that the coverage doesn't go down.
|
|
145
|
-
|
|
146
|
-
## About
|
|
147
|
-
|
|
148
|
-
<img src="http://arkency.com/images/arkency.png" alt="Arkency" width="20%" align="left" />
|
|
149
|
-
|
|
150
|
-
Rails Event Store is funded and maintained by Arkency. Check out our other [open-source projects](https://github.com/arkency).
|
|
151
|
-
|
|
152
|
-
You can also [hire us](http://arkency.com) or [read our blog](http://blog.arkency.com).
|
data/aggregate_root.gemspec
CHANGED
|
@@ -24,8 +24,9 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.add_development_dependency 'pry'
|
|
25
25
|
spec.add_development_dependency 'rspec'
|
|
26
26
|
spec.add_development_dependency 'rails', '~> 4.2.1'
|
|
27
|
-
spec.add_development_dependency 'ruby_event_store', '
|
|
28
|
-
spec.add_development_dependency 'mutant
|
|
27
|
+
spec.add_development_dependency 'ruby_event_store', '= 0.15.0'
|
|
28
|
+
spec.add_development_dependency 'mutant', '0.8.12'
|
|
29
|
+
spec.add_development_dependency 'mutant-rspec', '0.8.11'
|
|
29
30
|
|
|
30
31
|
spec.add_dependency 'activesupport', '>= 3.0'
|
|
31
32
|
end
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
module AggregateRoot
|
|
2
|
+
MissingHandler = Class.new(StandardError)
|
|
3
|
+
|
|
2
4
|
class DefaultApplyStrategy
|
|
5
|
+
def initialize(strict: true)
|
|
6
|
+
@strict = strict
|
|
7
|
+
end
|
|
8
|
+
|
|
3
9
|
def call(aggregate, event)
|
|
4
|
-
|
|
5
|
-
aggregate.
|
|
10
|
+
name = handler_name(event)
|
|
11
|
+
if aggregate.respond_to?(name, true)
|
|
12
|
+
aggregate.method(name).call(event)
|
|
13
|
+
else
|
|
14
|
+
raise MissingHandler.new("Missing handler method #{name} on aggregate #{aggregate.class}") if strict
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
attr_reader :strict
|
|
20
|
+
|
|
21
|
+
def handler_name(event)
|
|
22
|
+
"apply_#{event.class.name.demodulize.underscore}"
|
|
6
23
|
end
|
|
7
24
|
end
|
|
8
25
|
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.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Arkency
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-08-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -84,30 +84,44 @@ dependencies:
|
|
|
84
84
|
name: ruby_event_store
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- -
|
|
87
|
+
- - '='
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 0.
|
|
89
|
+
version: 0.15.0
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- -
|
|
94
|
+
- - '='
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 0.
|
|
96
|
+
version: 0.15.0
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: mutant
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - '='
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 0.8.12
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - '='
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: 0.8.12
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
112
|
name: mutant-rspec
|
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
|
100
114
|
requirements:
|
|
101
|
-
- -
|
|
115
|
+
- - '='
|
|
102
116
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
117
|
+
version: 0.8.11
|
|
104
118
|
type: :development
|
|
105
119
|
prerelease: false
|
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
121
|
requirements:
|
|
108
|
-
- -
|
|
122
|
+
- - '='
|
|
109
123
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
124
|
+
version: 0.8.11
|
|
111
125
|
- !ruby/object:Gem::Dependency
|
|
112
126
|
name: activesupport
|
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -129,12 +143,8 @@ executables: []
|
|
|
129
143
|
extensions: []
|
|
130
144
|
extra_rdoc_files: []
|
|
131
145
|
files:
|
|
132
|
-
- ".gitignore"
|
|
133
|
-
- ".travis.yml"
|
|
134
146
|
- CHANGELOG.md
|
|
135
|
-
- CONTRIBUTING.md
|
|
136
147
|
- Gemfile
|
|
137
|
-
- LICENSE
|
|
138
148
|
- Makefile
|
|
139
149
|
- README.md
|
|
140
150
|
- Rakefile
|
|
@@ -163,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
163
173
|
version: '0'
|
|
164
174
|
requirements: []
|
|
165
175
|
rubyforge_project:
|
|
166
|
-
rubygems_version: 2.6.
|
|
176
|
+
rubygems_version: 2.6.11
|
|
167
177
|
signing_key:
|
|
168
178
|
specification_version: 4
|
|
169
179
|
summary: Event sourced (with Rails Event Store) aggregate root implementation
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
language: ruby
|
|
2
|
-
rvm:
|
|
3
|
-
- 2.1.10
|
|
4
|
-
- 2.2.5
|
|
5
|
-
- 2.3.1
|
|
6
|
-
before_install: gem install bundler
|
|
7
|
-
gemfile: Gemfile
|
|
8
|
-
script: make mutate
|
|
9
|
-
env:
|
|
10
|
-
- CODECLIMATE_REPO_TOKEN=3af5c60b54fff033bf0dc1af4f26762647bcf3b78268a94d67ea9530b5b52a61
|
|
11
|
-
notifications:
|
|
12
|
-
slack:
|
|
13
|
-
secure: CFijr8ytPJGA5PqjABHTamy1b5YE0IoneBw0TemEFfatN4IYiTxRnItSmZDfVmgQLhK8EH5599j3cCsMPaC11Z10VKTCxZoxiLBJLmeVpAWPqTNL6MnHFSZ3ls/d5LkKCcbWlRKvqZpvtUW+PI7FuEWRT9ok/i1iabR5AwO1vwldKfcKgZII3PErDxIKzfIAQL45hVJsvkoTNPL0aOYnvtE6qBglCxJX6TcwAe7gwo+r6se/X0wI5gLGHz+t9NmH2PjEbG2iJ3YbrwXkAElI8TG3O4D9yUs7OaJ2yYDFs+oxseY4XwvKQtdKeu9QiFfexivLjB8FfUtgTlfmELbQ8bd3wltGxXjOdbGhR1bTHXiMtxwCJ8bB7hiDZFrYkpFn+vjmP/raXoD3o25GfEBE5dFtlm6ad+d+2rGpo9frbD3gQFYtx9LLEac2CkhCMoHAtsT3K6WqZ3VbvfG9K5iIhoGjLd3iWqsjZmFRSTrSdMskTwgochH6rx9UX1/p0MSPZ8gye7nAFMVkCoytogqJT9PAOPR+z7BfZHiD86UL+8LUrr1WneELJJDFgVZXdAV526mw/+6gsnNobj19PW4Ckgsxcz8kTzpepbmsFGGvFy6lIpIHdH8zvbOgIQlfaeLm/XQuvaudaqUtJzrNUskvon6B/f78CHV2zdUZWgCYIO0=
|
data/CONTRIBUTING.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Contributing to AggregateRoot
|
|
2
|
-
|
|
3
|
-
Any kind of contribution is welcomed. Here is a few guidelines that we need contributors to follow.
|
|
4
|
-
|
|
5
|
-
## Found a bug? Have a question?
|
|
6
|
-
|
|
7
|
-
* [Create a new issue](https://github.com/arkency/aggregate_root/issues/new), assuming one does not already exist.
|
|
8
|
-
* Clearly describe the issue including steps to reproduce when it is a bug.
|
|
9
|
-
* If possible provide a Pull Request with failing test case.
|
|
10
|
-
|
|
11
|
-
## Getting Started
|
|
12
|
-
|
|
13
|
-
* Make sure you have a [GitHub account](https://github.com/signup/free).
|
|
14
|
-
* [Fork the repository](https://help.github.com/articles/fork-a-repo/) on GitHub.
|
|
15
|
-
|
|
16
|
-
## Making Changes
|
|
17
|
-
|
|
18
|
-
* Create a feature branch from where you want to base your work.
|
|
19
|
-
* Do your work. Please try to keep your commits small and focused.
|
|
20
|
-
* Make sure you have added the necessary tests for your changes.
|
|
21
|
-
* Push your changes to a feature branch in your fork of the repository.
|
|
22
|
-
* Submit a pull request to the AggregateRoot repository.
|
|
23
|
-
|
|
24
|
-
# Additional Resources
|
|
25
|
-
|
|
26
|
-
* [General GitHub documentation](http://help.github.com/)
|
|
27
|
-
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
|
data/LICENSE
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2015 Arkency
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|