evt-messaging 0.18.0.0 → 0.18.1.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: 49528cadeb7d747582de5116b7b59f3cd6956c1d
4
- data.tar.gz: be3e0543cf292677a619eba7a64c09f30e11b379
3
+ metadata.gz: 807b9bba85a11cfbcb4882e089fd579082d62029
4
+ data.tar.gz: 42d4aebb0205a6756c9f74b2066db41c7c622726
5
5
  SHA512:
6
- metadata.gz: d26d59c955a8afa5d2fe93f237fe58b6ea858295c4e7b90dade28a02a1a5246d692a5be0c53c3c223aae3437a39748482515f532ff82187dd5139d83c05ce3fc
7
- data.tar.gz: 50289e28a9146860f29ae2a833c40fb5a7236d238628a7ae707dae0aa891ccb3a99b6050eaddaeb9f6cc8bbe8f90e34c0f3a5e7633144dc3dd3043c710e4cbd6
6
+ metadata.gz: 43091c83ebf1292f0fec90d4d9ace5fc45c68ec10a0a0ff007c394d6b0a93fd0693dc121d5bccab2b2f4f3fb6deb516d98c3fcb60af63cc7d55a41ded8d76a95
7
+ data.tar.gz: f5a1ea112a849a754e547ad9dbff7d091917f6f9ca7c18d13f73135d73cad081ebb33254c92240a23a1f9ceb570ef728e3da8b9326717e78f2e470da9bc57da1
@@ -9,18 +9,34 @@ module Messaging
9
9
  end
10
10
 
11
11
  class Write
12
- Error = Class.new(RuntimeError)
13
-
14
12
  include Messaging::Write
15
13
 
14
+ Error = Class.new(RuntimeError)
15
+
16
16
  attr_accessor :sink
17
17
 
18
+ def raise_expected_version_error
19
+ @raise_expected_version_error ||= false
20
+ end
21
+ attr_writer :raise_expected_version_error
22
+
18
23
  def self.build(session: nil)
19
24
  new.tap do |instance|
20
25
  ::Telemetry.configure instance
21
26
  end
22
27
  end
23
28
 
29
+ def call(*args, **keyword_args)
30
+ raise MessageStore::ExpectedVersion::Error if raise_expected_version_error
31
+ super(*args, **keyword_args)
32
+ end
33
+ alias :write :call
34
+
35
+ def raise_expected_version_error!
36
+ self.raise_expected_version_error = true
37
+ nil
38
+ end
39
+
24
40
  def writes(&blk)
25
41
  if blk.nil?
26
42
  return sink.written_records
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0.0
4
+ version: 0.18.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-17 00:00:00.000000000 Z
11
+ date: 2017-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-message_store