rails_event_store 0.14.0 → 0.14.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49d3d8b9204db16a4a52a39e947f0ef8c8c3f9c1
4
- data.tar.gz: 5de972817cde754e4f59e6933d7ada2b5c234d76
3
+ metadata.gz: 0ee6ef9f0a3a5aa3e01bc4e38ce52af3c885950a
4
+ data.tar.gz: 8178f8807b08e50bad8e4fd86d4ef32ab487b7f4
5
5
  SHA512:
6
- metadata.gz: 415b91d22d6b201658cc64718da9dc4aa51c5779afc563552d3cdb1c24b0cc16cc088b37e94db79bfd315f90e24956a1ba99db3120f3b757cad3cd9ec37bcd06
7
- data.tar.gz: 3dd3325e40b1863fb76d169352341a3aedc6c688fa21cc4232e242505de349e1ed703e3790a919063fbe06d44fe9106d125d4361039ef180cc0e7e805bddbdc3
6
+ metadata.gz: faacc6caeacc3bd6a3ee393e886a4a35e100efd287103ea2218c9bca3e4cdbb85b88e6377bcdcb00a419656dc25b3eb11f5e69394baa3160d55eb877f102342a
7
+ data.tar.gz: cf5753c56548181867316ff32949c17a1525f7649ac5613d0993de0e5d788a223ccc7c39e4710ab549124776c6954ee9cf540042afe5db14745b9d0310cfb999
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 0.14.1 (21.11.2016)
2
+
3
+ * Change: Allows to set the event repository used. #61
4
+ Allow to avoid ActiveRecord dependency when not using rails_event_store_active_record's
5
+ event repository. See documentation for mode details http://railseventstore.arkency.com/docs/repository.html
6
+
1
7
  ### 0.14.0 (28.10.2016)
2
8
 
3
9
  * Change: aggregate_root updated to 0.4.0
@@ -0,0 +1,20 @@
1
+ require 'ruby_event_store'
2
+ require 'rails_event_store/client'
3
+ require 'rails_event_store/version'
4
+
5
+ module RailsEventStore
6
+ Event = RubyEventStore::Event
7
+ InMemoryRepository = RubyEventStore::InMemoryRepository
8
+ EventBroker = RubyEventStore::PubSub::Broker
9
+ Projection = RubyEventStore::Projection
10
+ WrongExpectedEventVersion = RubyEventStore::WrongExpectedEventVersion
11
+ InvalidExpectedVersion = RubyEventStore::InvalidExpectedVersion
12
+ IncorrectStreamData = RubyEventStore::IncorrectStreamData
13
+ EventNotFound = RubyEventStore::EventNotFound
14
+ SubscriberNotExist = RubyEventStore::SubscriberNotExist
15
+ MethodNotDefined = RubyEventStore::MethodNotDefined
16
+ InvalidPageStart = RubyEventStore::InvalidPageStart
17
+ InvalidPageSize = RubyEventStore::InvalidPageSize
18
+ GLOBAL_STREAM = RubyEventStore::GLOBAL_STREAM
19
+ PAGE_SIZE = RubyEventStore::PAGE_SIZE
20
+ end
@@ -1,6 +1,6 @@
1
1
  module RailsEventStore
2
2
  class Client < RubyEventStore::Client
3
- def initialize(repository: RailsEventStoreActiveRecord::EventRepository.new,
3
+ def initialize(repository: RailsEventStore.event_repository,
4
4
  event_broker: EventBroker.new,
5
5
  page_size: PAGE_SIZE)
6
6
  capture_metadata = ->{ Thread.current[:rails_event_store] }
@@ -1,3 +1,3 @@
1
1
  module RailsEventStore
2
- VERSION = '0.14.0'
2
+ VERSION = '0.14.1'
3
3
  end
@@ -1,25 +1,15 @@
1
- require 'ruby_event_store'
1
+ require 'active_support/core_ext/class/attribute_accessors'
2
2
  require 'rails_event_store_active_record'
3
+ require 'rails_event_store/all'
3
4
 
4
5
  module RailsEventStore
5
- Event = RubyEventStore::Event
6
- InMemoryRepository = RubyEventStore::InMemoryRepository
7
- EventBroker = RubyEventStore::PubSub::Broker
8
- Projection = RubyEventStore::Projection
6
+ mattr_reader :event_repository
9
7
 
10
- GLOBAL_STREAM = RubyEventStore::GLOBAL_STREAM
11
- PAGE_SIZE = RubyEventStore::PAGE_SIZE
12
-
13
- WrongExpectedEventVersion = RubyEventStore::WrongExpectedEventVersion
14
- InvalidExpectedVersion = RubyEventStore::InvalidExpectedVersion
15
- IncorrectStreamData = RubyEventStore::IncorrectStreamData
16
- EventNotFound = RubyEventStore::EventNotFound
17
- SubscriberNotExist = RubyEventStore::SubscriberNotExist
18
- MethodNotDefined = RubyEventStore::MethodNotDefined
19
- InvalidPageStart = RubyEventStore::InvalidPageStart
20
- InvalidPageSize = RubyEventStore::InvalidPageSize
8
+ def self.event_repository=(event_repository)
9
+ raise ArgumentError unless event_repository
10
+ @@event_repository = event_repository
11
+ end
21
12
  end
22
13
 
23
- require 'rails_event_store/version'
24
- require 'rails_event_store/client'
25
- require 'rails_event_store/railtie' if defined?(Rails::Railtie)
14
+ # Use active record by default
15
+ RailsEventStore.event_repository = RailsEventStoreActiveRecord::EventRepository.new
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_event_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arkency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-28 00:00:00.000000000 Z
11
+ date: 2016-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -209,6 +209,7 @@ files:
209
209
  - README.md
210
210
  - Rakefile
211
211
  - lib/rails_event_store.rb
212
+ - lib/rails_event_store/all.rb
212
213
  - lib/rails_event_store/client.rb
213
214
  - lib/rails_event_store/middleware.rb
214
215
  - lib/rails_event_store/railtie.rb