aggregate_root 0.24.0 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9ec71da7247356c6701e775b0b2707eef3d5425c
4
- data.tar.gz: acedf3d2ae77fdad48cf509bee939b47a99d6c32
2
+ SHA256:
3
+ metadata.gz: ab066456803359163627399f9a517412c5e80d7c231600880b44b54ea5a1740d
4
+ data.tar.gz: d053f139989bcae86ff120673c4518fb2c7ed1bde41732213551697b989d6ef8
5
5
  SHA512:
6
- metadata.gz: 1a473669b8e389740fbf240125011da1690b43f17d08e1f75d3c6c7dc856a96cd9d7663a2aafae35185cb84797f97f75dc1ed712965020809f1282b21342eee3
7
- data.tar.gz: e93c1439201dab276a19038b9167ee0b93c5ac4d3de67c3e465a2758e932ded5aae407b0f9a5f1d21d2d6e84455823a9c179733f575d7551b61455304d74ffb0
6
+ metadata.gz: 26009870db621184a5cb986c8ecc356799c57f0dc41d82ef9b8edf3d6fdea80b6bd14add53abe6e0da0dc198c7195b5ebaf8c9b0708e711f4185e4fe2e7cb99b
7
+ data.tar.gz: 787517a58ceed40a4a76efe67e4e4e19c5e6588da47202ff41f4c728b66a2712519403d01ef14ef95b5bcdde0f172772b291aea5185b49bdb2c5822ca7a38745
data/Makefile CHANGED
@@ -1,24 +1,37 @@
1
- GEM_VERSION = `cat ../RES_VERSION`
1
+ GEM_VERSION = $(shell cat ../RES_VERSION)
2
+ GEM_NAME = aggregate_root
3
+ REQUIRE = $(GEM_NAME)
4
+ IGNORE =
5
+ SUBJECT ?= AggregateRoot*
2
6
 
3
7
  install: ## Install gem dependencies
4
8
  @echo "Installing gem dependencies"
5
9
  @bundle install
6
10
 
7
- test: ## Run tests
8
- @echo "Running basic tests - beware: this won't guarantee build pass"
11
+ test: ## Run unit tests
12
+ @echo "Running unit tests"
9
13
  @bundle exec rspec
10
14
 
11
- mutate: test ## Run mutation tests
12
- @echo "Running mutation tests - only 100% free mutation will be accepted"
13
- @bundle exec mutant --include lib --require aggregate_root --use rspec "AggregateRoot*"
15
+ mutate: test ## Run mutation tests
16
+ @echo "Running mutation tests"
17
+ @bundle exec mutant --include lib \
18
+ $(addprefix --require ,$(REQUIRE)) \
19
+ $(addprefix --ignore-subject ,$(IGNORE)) \
20
+ --use rspec "$(SUBJECT)"
14
21
 
15
22
  build:
16
- @gem build -V aggregate_root.gemspec
23
+ @echo "Building gem package"
24
+ @gem build -V $(GEM_NAME).gemspec
17
25
  @mkdir -p pkg/
18
- @mv aggregate_root-$(GEM_VERSION).gem pkg/
26
+ @mv $(GEM_NAME)-$(GEM_VERSION).gem pkg/
19
27
 
20
- release: build
21
- @gem push pkg/aggregate_root-$(GEM_VERSION).gem
28
+ push:
29
+ @echo "Pushing package to RubyGems"
30
+ @gem push pkg/$(GEM_NAME)-$(GEM_VERSION).gem
31
+
32
+ clean:
33
+ @echo "Removing previously built package"
34
+ -rm pkg/$(GEM_NAME)-$(GEM_VERSION).gem
22
35
 
23
36
  help:
24
37
  @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@@ -22,7 +22,7 @@ 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 'ruby_event_store', '= 0.24.0'
25
+ spec.add_development_dependency 'ruby_event_store', '= 0.25.0'
26
26
  spec.add_development_dependency 'mutant-rspec', '~> 0.8.14'
27
27
 
28
28
  spec.add_dependency 'activesupport', '>= 3.0'
@@ -22,7 +22,7 @@ module AggregateRoot
22
22
  self
23
23
  end
24
24
 
25
- def store(stream_name = loaded_from_stream_name, event_store: default_event_store)
25
+ def store(stream_name = @loaded_from_stream_name, event_store: default_event_store)
26
26
  event_store.publish_events(unpublished_events, stream_name: stream_name, expected_version: version)
27
27
  @version += unpublished_events.size
28
28
  @unpublished_events = nil
@@ -33,7 +33,6 @@ module AggregateRoot
33
33
  end
34
34
 
35
35
  private
36
- attr_reader :loaded_from_stream_name
37
36
 
38
37
  def unpublished
39
38
  @unpublished_events ||= []
@@ -11,12 +11,11 @@ module AggregateRoot
11
11
  if aggregate.respond_to?(name, true)
12
12
  aggregate.method(name).call(event)
13
13
  else
14
- raise MissingHandler.new("Missing handler method #{name} on aggregate #{aggregate.class}") if strict
14
+ raise MissingHandler.new("Missing handler method #{name} on aggregate #{aggregate.class}") if @strict
15
15
  end
16
16
  end
17
17
 
18
18
  private
19
- attr_reader :strict
20
19
 
21
20
  def handler_name(event)
22
21
  "apply_#{event.class.name.demodulize.underscore}"
@@ -1,3 +1,3 @@
1
1
  module AggregateRoot
2
- VERSION = "0.24.0"
2
+ VERSION = "0.25.0"
3
3
  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.24.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-24 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.24.0
61
+ version: 0.25.0
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: 0.24.0
68
+ version: 0.25.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mutant-rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.6.13
133
+ rubygems_version: 2.7.5
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Event sourced (with Rails Event Store) aggregate root implementation