evt-messaging 0.7.2.1 → 0.8.0.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: d7d58ba9a758976aaf0d734d46ece0d5be5e7016
4
- data.tar.gz: 41a563011fc0fd906d7a7a8b2d4b485dc1ba7683
3
+ metadata.gz: 850842d35f74a120e91ac6e7fd03a4c7c1076cb8
4
+ data.tar.gz: daf3058d22ec599a543b375e6ad530a69fe9f34c
5
5
  SHA512:
6
- metadata.gz: 3a8eace2595b0bebdef741f13aee16e885739ad4ed7624161d45ad1e9e894439a7626959260b0e0643d18258f6e575ecd679c3d5a7772a053f46d87eaec6f4a5
7
- data.tar.gz: 48e168b5924a2bb912e5c819b144ea5a5d7ad807c667459a6ced1d6b8c70f853a8ecef9927fdc36b01e921d860f567130f93b95479beb6488a0e9a020405551d
6
+ metadata.gz: 8242050c1c4da5ff26fca9ce8684290144b2eb840cedd622df69c5f79eca175856b2ee59f8c84e817a5778a89da8d36a9b101e4ec2e10520d928d09ed96d2af0
7
+ data.tar.gz: 74b8b105d92eb9fd280457fdb22c1dfdb7a6a8d36ddf10cc8cced1ffb1d2b1c09e144c422ada8d7bb681b01ae332645b89ed9f4f3e7478f0180fc2eb5f8d780a
@@ -30,7 +30,7 @@ module Messaging
30
30
  end
31
31
 
32
32
  def self.schema_version
33
- 11
33
+ '1.1'
34
34
  end
35
35
 
36
36
  def self.source_event_identifier
@@ -83,12 +83,7 @@ module Messaging
83
83
  def self.data
84
84
  data = Metadata.data
85
85
 
86
- [
87
- :source_event_stream_name,
88
- :source_event_position,
89
- :global_position,
90
- :time
91
- ].each do |not_written_attribute|
86
+ Messaging::Message::Metadata.transient_attributes.each do |not_written_attribute|
92
87
  data.delete(not_written_attribute)
93
88
  end
94
89
 
@@ -3,17 +3,22 @@ module Messaging
3
3
  def self.included(cls)
4
4
  cls.class_exec do
5
5
  include Schema::DataStructure
6
- end
7
6
 
8
- ## TODO put this in the included block, and remove the cls.
9
- cls.extend Info
10
- cls.extend Build
11
- cls.extend Copy
12
- cls.extend Follow
13
- cls.extend Transformer
14
- end
7
+ extend Info
8
+ extend Build
9
+ extend Copy
10
+ extend Follow
11
+ extend Transformer
12
+
13
+ attribute :id, String
15
14
 
16
- attr_accessor :id
15
+ def self.transient_attributes
16
+ [
17
+ :id
18
+ ]
19
+ end
20
+ end
21
+ end
17
22
 
18
23
  attr_writer :metadata
19
24
  def metadata
@@ -5,24 +5,24 @@ module Messaging
5
5
 
6
6
  include Schema::DataStructure
7
7
 
8
- attribute :source_event_stream_name
8
+ attribute :source_event_stream_name, String
9
9
  alias :stream_name :source_event_stream_name
10
- attribute :source_event_position
10
+ attribute :source_event_position, Fixnum
11
11
  alias :sequence :source_event_position
12
12
  alias :position :source_event_position
13
13
  alias :position= :source_event_position=
14
14
 
15
- attribute :causation_event_stream_name
16
- attribute :causation_event_position
15
+ attribute :causation_event_stream_name, String
16
+ attribute :causation_event_position, Fixnum
17
17
 
18
- attribute :correlation_stream_name
18
+ attribute :correlation_stream_name, String
19
19
 
20
- attribute :reply_stream_name
20
+ attribute :reply_stream_name, String
21
21
 
22
- attribute :global_position
23
- attribute :time
22
+ attribute :global_position, Fixnum
23
+ attribute :time, Time
24
24
 
25
- attribute :schema_version
25
+ attribute :schema_version, String
26
26
 
27
27
  def source_event_identifier
28
28
  return nil if source_event_stream_name.nil? || source_event_position.nil?
@@ -45,7 +45,6 @@ module Messaging
45
45
 
46
46
  def follows?(other_metadata)
47
47
  causation_event_identifier == other_metadata.source_event_identifier &&
48
-
49
48
  correlation_stream_name == other_metadata.correlation_stream_name &&
50
49
  reply_stream_name == other_metadata.reply_stream_name
51
50
  end
@@ -53,6 +52,15 @@ module Messaging
53
52
  def clear_reply_stream_name
54
53
  self.reply_stream_name = nil
55
54
  end
55
+
56
+ def self.transient_attributes
57
+ [
58
+ :source_event_stream_name,
59
+ :source_event_position,
60
+ :global_position,
61
+ :time
62
+ ]
63
+ end
56
64
  end
57
65
  end
58
66
  end
@@ -25,7 +25,7 @@ module Messaging
25
25
  event_data.data = message.to_h
26
26
 
27
27
  metadata = message.metadata.to_h
28
- metadata.delete_if { |k, v| v.nil? || k == :source_event_stream_name || k == :source_event_position}
28
+ metadata.delete_if { |k, v| v.nil? }
29
29
 
30
30
  event_data.metadata = metadata
31
31
 
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.7.2.1
4
+ version: 0.8.0.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-01-13 00:00:00.000000000 Z
11
+ date: 2017-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-event_source