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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48a6c0d1e828eaa6eefac9eed828466a5525ad60
4
- data.tar.gz: ce86db1515f0ad152b3cd7f4e445ceda64193a33
3
+ metadata.gz: dc93d3b8eb2fe3d40a0b2918f4a597600c70d53c
4
+ data.tar.gz: 4eee36757eaad1a0663e456dca44050c8f16a3b9
5
5
  SHA512:
6
- metadata.gz: f8e112687abae593e99a5842217cfbcbed137104499fe861d04a9815641a566421932b5c0de859bc87e896766c0093bbb16b9308f6209bb75b12efcd38aa2b59
7
- data.tar.gz: 2c7e5e9a749b8a555e77e307eb160269f706cee93553d747af46ef0c89c57a6a15c9ca42f5966ba3b83a5d937de11bec6e4a952a1cf0815eb5dab6b2d2dc23b9
6
+ metadata.gz: fc84c07137a6395b0bc3e74ea676d9b35ca19fb9ba452031120bbcf51b2fb417812f02978c7c45fac0e9e65db3f6e024483883ff0f75124c2a83555d0d2baa65
7
+ data.tar.gz: 8824836bd934e712b3ba724e1b2235b0c1e93d74d02b1ba409bf687d70603675f1e610763549dca269079a4d5f01731f69b2b48749e44da709fac57fce989d37
@@ -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
@@ -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 = Repositories::EventRepository.new, page_size = PAGE_SIZE)
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 = nil)
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 appent_to_stream(event, stream_name = GLOBAL_STREAM, expected_version = nil)
15
- event_store.appent_to_stream(stream_name, event, expected_version)
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
@@ -8,7 +8,7 @@ module RailsEventStore
8
8
  attr_reader :adapter
9
9
 
10
10
  def create(event, stream_name)
11
- data = event.to_h.merge!(stream: stream_name)
11
+ data = event.to_h.merge!(stream: stream_name, event_type: event.class.name)
12
12
  adapter.create(data)
13
13
  event
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module RailsEventStore
2
- VERSION = '0.4.1'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -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.4.0'
30
- spec.add_dependency 'aggregate_root', '~> 0.2.0'
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.1
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-17 00:00:00.000000000 Z
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.4.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.4.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.0
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.0
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
@@ -1,3 +0,0 @@
1
- module RailsEventStore
2
- Event = RubyEventStore::Event
3
- end