rails_event_store 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/rails_event_store.rb +6 -1
- data/lib/rails_event_store/client.rb +9 -6
- data/lib/rails_event_store/repositories/event_repository.rb +1 -1
- data/lib/rails_event_store/version.rb +1 -1
- data/rails_event_store.gemspec +2 -2
- metadata +6 -7
- data/lib/rails_event_store/event.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc93d3b8eb2fe3d40a0b2918f4a597600c70d53c
|
4
|
+
data.tar.gz: 4eee36757eaad1a0663e456dca44050c8f16a3b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc84c07137a6395b0bc3e74ea676d9b35ca19fb9ba452031120bbcf51b2fb417812f02978c7c45fac0e9e65db3f6e024483883ff0f75124c2a83555d0d2baa65
|
7
|
+
data.tar.gz: 8824836bd934e712b3ba724e1b2235b0c1e93d74d02b1ba409bf687d70603675f1e610763549dca269079a4d5f01731f69b2b48749e44da709fac57fce989d37
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
### HEAD
|
2
2
|
|
3
|
+
### 0.5.0 (21.03.2016)
|
4
|
+
|
5
|
+
* Align with cnages in `ruby_event_store` 0.5.0:
|
6
|
+
* Change: Event class refactoring to make default values more explicit
|
7
|
+
* Change: Let event broker to be given as a dependency
|
8
|
+
* Change: No nils, use symbols instead - :any & :none replaced meaningless nil value
|
9
|
+
* Change: Remove Event#event_type - use class instead
|
10
|
+
* Fix: Typo fix (appent_to_stream corrected to append_to_stream)
|
11
|
+
* Change: Encapsulate internals fo RailsEventStore::Client
|
12
|
+
* Change: Hide `ruby_event_store` internals by adding classes in RailsEventStore module
|
13
|
+
|
3
14
|
### 0.4.1 (17.03.2016)
|
4
15
|
|
5
16
|
* Fix: aggregate_root gem aligned with changes in rails_event_store
|
data/lib/rails_event_store.rb
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
require 'ruby_event_store'
|
2
2
|
|
3
|
+
module RailsEventStore
|
4
|
+
Event = RubyEventStore::Event
|
5
|
+
InMemoryRepository = RubyEventStore::InMemoryRepository
|
6
|
+
EventBroker = RubyEventStore::PubSub::Broker
|
7
|
+
end
|
8
|
+
|
3
9
|
require 'rails_event_store/models/event'
|
4
10
|
require 'rails_event_store/generators/migrate_generator'
|
5
11
|
require 'rails_event_store/generators/templates/migration_template'
|
6
12
|
require 'rails_event_store/version'
|
7
|
-
require 'rails_event_store/event'
|
8
13
|
require 'rails_event_store/repositories/event_repository'
|
9
14
|
require 'rails_event_store/event_handlers/slack_event_handler'
|
10
15
|
require 'rails_event_store/errors'
|
@@ -1,18 +1,20 @@
|
|
1
1
|
module RailsEventStore
|
2
2
|
class Client
|
3
3
|
|
4
|
-
def initialize(repository
|
4
|
+
def initialize(repository: Repositories::EventRepository.new,
|
5
|
+
event_broker: EventBroker.new,
|
6
|
+
page_size: PAGE_SIZE)
|
5
7
|
@repository = repository
|
6
8
|
@page_size = page_size
|
9
|
+
@event_broker = event_broker
|
7
10
|
end
|
8
|
-
attr_reader :repository, :page_size
|
9
11
|
|
10
|
-
def publish_event(event, stream_name = GLOBAL_STREAM, expected_version =
|
12
|
+
def publish_event(event, stream_name = GLOBAL_STREAM, expected_version = :any)
|
11
13
|
event_store.publish_event(event, stream_name, expected_version)
|
12
14
|
end
|
13
15
|
|
14
|
-
def
|
15
|
-
event_store.
|
16
|
+
def append_to_stream(event, stream_name = GLOBAL_STREAM, expected_version = :any)
|
17
|
+
event_store.append_to_stream(stream_name, event, expected_version)
|
16
18
|
end
|
17
19
|
|
18
20
|
def delete_stream(stream_name)
|
@@ -43,9 +45,10 @@ module RailsEventStore
|
|
43
45
|
end
|
44
46
|
|
45
47
|
private
|
48
|
+
attr_reader :repository, :page_size, :event_broker
|
46
49
|
|
47
50
|
def event_store
|
48
|
-
@event_store ||= RubyEventStore::Facade.new(repository)
|
51
|
+
@event_store ||= RubyEventStore::Facade.new(repository, event_broker)
|
49
52
|
end
|
50
53
|
end
|
51
54
|
end
|
data/rails_event_store.gemspec
CHANGED
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency 'webmock', '~> 1.21'
|
27
27
|
spec.add_development_dependency 'sqlite3'
|
28
28
|
|
29
|
-
spec.add_dependency 'ruby_event_store', '~> 0.
|
30
|
-
spec.add_dependency 'aggregate_root', '~> 0.2.
|
29
|
+
spec.add_dependency 'ruby_event_store', '~> 0.5.0'
|
30
|
+
spec.add_dependency 'aggregate_root', '~> 0.2.1'
|
31
31
|
spec.add_dependency 'activesupport', '>= 3.0'
|
32
32
|
spec.add_dependency 'activemodel', '>= 3.0'
|
33
33
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_event_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rybex
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-03-
|
12
|
+
date: 2016-03-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -115,28 +115,28 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.
|
118
|
+
version: 0.5.0
|
119
119
|
type: :runtime
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
125
|
+
version: 0.5.0
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: aggregate_root
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: 0.2.
|
132
|
+
version: 0.2.1
|
133
133
|
type: :runtime
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: 0.2.
|
139
|
+
version: 0.2.1
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: activesupport
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,7 +184,6 @@ files:
|
|
184
184
|
- lib/rails_event_store/client.rb
|
185
185
|
- lib/rails_event_store/constants.rb
|
186
186
|
- lib/rails_event_store/errors.rb
|
187
|
-
- lib/rails_event_store/event.rb
|
188
187
|
- lib/rails_event_store/event_handlers/slack_event_handler.rb
|
189
188
|
- lib/rails_event_store/generators/migrate_generator.rb
|
190
189
|
- lib/rails_event_store/generators/templates/migration_template.rb
|