event_store_client 0.1.17 → 0.1.18

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
  SHA256:
3
- metadata.gz: '049769fdedefd4418bf5416d98b7fc594402bc58d252322f0d4719991b606959'
4
- data.tar.gz: 95e079d13ebc780e7f4aa0bbfc3552afaff18a757ef0e0c7f209e83f5d8b98da
3
+ metadata.gz: 9fe215b6cb4223f0045c80024230b91abbf911b497c7680209ba9fce087d23b7
4
+ data.tar.gz: 01e1b42502fa7d2f8750cd15362d78246690228282139f96c7b3e22c2c09807c
5
5
  SHA512:
6
- metadata.gz: '038d09d78ca867bcc280035aea884556346e114d89776e5e98866cbb432b1de835bae795489a5041f53f1dd4dd9c3b380432fc9b630f40897169253ff4ff8ddb'
7
- data.tar.gz: 0d95de8176178c7f7e2826db65a04ff9778fd63c30b7e620b1abcfd026a99d0c561af6526b4e91f66e6be3d1247a98078eb2295bd7b79d55d8d13814fc0c95b9
6
+ metadata.gz: 7d7ddaa9efd38ff16f618e0878e3b1039d49a389f112624a31b142a7faa1cede30ed2295456b7e0681319f3e01466647e4ee78112a7e6abaa4d1e1d62282a476
7
+ data.tar.gz: 65fef0ec5e3cd8ef1a98c6ddcff0f19fe94ab80a2706de39879792b8e943fb19af91e751c063a0d0ad70ba152710a13800035bb9ed51df4b5d103ff22dbef652
data/README.md CHANGED
@@ -45,6 +45,14 @@ Before you start, add this to the `initializer` or to the top of your script:
45
45
 
46
46
  `EventStoreClient.configure`
47
47
 
48
+ For testing, you can use the InMemory adapter. To do it you should change the configuration.
49
+
50
+ ```ruby
51
+ EventStoreClient.configure do |config|
52
+ config.adapter = EventStoreClient::StoreAdapter::InMemory.new(host: 'http://localhost', port: '2113')
53
+ end
54
+ ```
55
+
48
56
  ### Create Dummy event and dummy Handler
49
57
 
50
58
  To test out the behavior, you'll need a sample event and handler to work with:
@@ -7,7 +7,8 @@ module EventStoreClient
7
7
  class Configuration
8
8
  include Singleton
9
9
 
10
- attr_accessor :host, :port, :per_page, :service_name, :mapper, :error_handler, :pid_path
10
+ attr_accessor :host, :port, :per_page, :service_name, :mapper, :error_handler, :pid_path,
11
+ :adapter
11
12
 
12
13
  def configure
13
14
  yield(self) if block_given?
@@ -23,6 +24,8 @@ module EventStoreClient
23
24
  @mapper = Mapper::Default.new
24
25
  @service_name = 'default'
25
26
  @error_handler = nil
27
+ @adapter =
28
+ EventStoreClient::StoreAdapter::Api::Client.new(host: host, port: port, per_page: per_page)
26
29
  end
27
30
  end
28
31
  end
@@ -50,7 +50,7 @@ module EventStoreClient
50
50
 
51
51
  private
52
52
 
53
- attr_reader :host, :port, :mapper, :per_page
53
+ attr_reader :host, :port, :mapper, :per_page, :client
54
54
 
55
55
  def config
56
56
  EventStoreClient::Configuration.instance
@@ -61,13 +61,7 @@ module EventStoreClient
61
61
  @port = config.port
62
62
  @per_page = config.per_page
63
63
  @mapper = config.mapper
64
- end
65
-
66
- def client
67
- @client ||=
68
- EventStoreClient::StoreAdapter::Api::Client.new(
69
- host: host, port: port, per_page: per_page
70
- )
64
+ @client = config.adapter
71
65
  end
72
66
 
73
67
  def read_from_stream(stream, direction:, start:, resolve_links:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EventStoreClient
4
- VERSION = '0.1.17'
4
+ VERSION = '0.1.18'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_store_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Wilgosz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2020-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-schema