evt-messaging 2.5.7.0 → 2.5.8.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
  SHA256:
3
- metadata.gz: 4a5c611f9683e1398927dd4223a8cba0f1520ff54523aef003ccd5d86a00ab0a
4
- data.tar.gz: 1263fa3a97c59fcaabe62b4f0699fb3128117be0fd847f7df3dbd4419f6a8a0a
3
+ metadata.gz: ed29a0c35879e58829f90553574808b36c4925450725c0e6b312e45cbb75abc7
4
+ data.tar.gz: 5c3649886b569d050834f02391672745595611a83a3a6fed8958070bab1ddaea
5
5
  SHA512:
6
- metadata.gz: 78f3bdccb3a7fdb31a46426223810cc9b6ef5108c4ac803ba1ba54cb2452a6e5a0bbe7e8209eaed03f8c35192bba484cd5d7983e26ff0f4544934a14eec936a0
7
- data.tar.gz: 29ecd80c4d0a941b29d8b1081f21032ca3d82c8327c0e7fe8777555d77401e03d1e6d7f7f9bf2e63dc2ccb43415391ad1160a8b6f80965d404213922e93075ce
6
+ metadata.gz: '04208a998e7aa313e679e41d064d8a8945b613dc6b2a3bea74cd2d53717cd69445d4824bd9c989ed42969798677f84bf756b1ed0989f385700d1e3dc3d467745'
7
+ data.tar.gz: a090214c089d0052e5a904b4e7c01b0537f4c7f5978e65766e89bf342c2c889294f438f3a07d59ef1c2f5f2381cfc0cfb715e0317a764c94763097fb7233a68f
@@ -4,6 +4,8 @@ module Messaging
4
4
  def self.example
5
5
  data = self.data
6
6
 
7
+ ## Remove this once Metadata can be built
8
+ ## from Raw data (Scott, Fri Feb 5 20201)
7
9
  data[:properties] = Properties.example
8
10
 
9
11
  Messaging::Message::Metadata.build(data)
@@ -4,14 +4,14 @@ module Messaging
4
4
  def self.example
5
5
  [
6
6
  SomeProperty.example,
7
- SomeTransientProperty.example
7
+ SomeLocalProperty.example
8
8
  ]
9
9
  end
10
10
 
11
11
  def self.data
12
12
  [
13
13
  SomeProperty.data,
14
- SomeTransientProperty.data
14
+ SomeLocalProperty.data
15
15
  ]
16
16
  end
17
17
 
@@ -36,7 +36,7 @@ module Messaging
36
36
  end
37
37
  end
38
38
 
39
- module SomeTransientProperty
39
+ module SomeLocalProperty
40
40
  def self.example
41
41
  Messaging::Message::Metadata::Property.new(name, value, true)
42
42
  end
@@ -44,16 +44,17 @@ module Messaging
44
44
  def self.data
45
45
  {
46
46
  name: name,
47
- value: value
47
+ value: value,
48
+ local: true
48
49
  }
49
50
  end
50
51
 
51
52
  def self.name
52
- :some_transient_property
53
+ :some_local_property
53
54
  end
54
55
 
55
56
  def self.value
56
- 'some transient property value'
57
+ 'some local property value'
57
58
  end
58
59
  end
59
60
  end
@@ -32,8 +32,13 @@ module Messaging
32
32
  end
33
33
 
34
34
  if metadata
35
- metadata_include = source.metadata.class.attribute_names
35
+ metadata_include = source.metadata.class.attribute_names - [:properties]
36
+
36
37
  SetAttributes.(receiver.metadata, source.metadata, include: metadata_include)
38
+
39
+ source.metadata.properties.each do |property|
40
+ receiver.metadata.properties << property.dup
41
+ end
37
42
  end
38
43
 
39
44
  receiver
@@ -61,15 +61,11 @@ module Messaging
61
61
  self.reply_stream_name = preceding_metadata.reply_stream_name
62
62
 
63
63
  preceding_metadata.properties.each do |property|
64
- if property.transient?
64
+ if property.local?
65
65
  next
66
66
  end
67
67
 
68
- set_property(
69
- property.name,
70
- property.value,
71
- transient: property.transient
72
- )
68
+ properties << property.dup
73
69
  end
74
70
  end
75
71
 
@@ -140,20 +136,20 @@ module Messaging
140
136
  end
141
137
  alias :correlates? :correlated?
142
138
 
143
- def set_property(name, value, transient: nil)
144
- transient ||= false
139
+ def set_property(name, value, local: nil)
140
+ local ||= false
145
141
 
146
142
  delete_property(name)
147
143
 
148
- property = Property.new(name, value, transient)
144
+ property = Property.new(name, value, local)
149
145
 
150
146
  properties << property
151
147
 
152
148
  property
153
149
  end
154
150
 
155
- def set_transient_property(name, value, transient: nil)
156
- set_property(name, value, transient: true)
151
+ def set_local_property(name, value, local: nil)
152
+ set_property(name, value, local: true)
157
153
  end
158
154
 
159
155
  def get_property(name)
@@ -4,17 +4,17 @@ module Messaging
4
4
  Property = Struct.new(
5
5
  :name,
6
6
  :value,
7
- :transient
7
+ :local
8
8
  ) do
9
- def transient?
10
- transient == true
9
+ def local?
10
+ local == true
11
11
  end
12
12
 
13
13
  def ==(other)
14
14
  equal =
15
15
  name == other.name &&
16
16
  value == other.value &&
17
- !!transient == !!other.transient
17
+ !!local == !!other.local
18
18
  end
19
19
  end
20
20
  end
@@ -46,8 +46,8 @@ module Messaging
46
46
  properties.map do |property|
47
47
  property_hash = property.to_h
48
48
 
49
- if not property_hash[:transient]
50
- property_hash.delete(:transient)
49
+ if not property_hash[:local]
50
+ property_hash.delete(:local)
51
51
  end
52
52
 
53
53
  property_hash
@@ -58,6 +58,7 @@ module Messaging
58
58
  def self.read(message_data)
59
59
  data = message_data.to_h
60
60
 
61
+ ## TODO change to positive "if"
61
62
  unless data[:metadata].nil?
62
63
  data[:metadata] = data[:metadata].clone
63
64
  else
@@ -72,6 +73,16 @@ module Messaging
72
73
  metadata[:global_position] = data[:global_position]
73
74
  metadata[:time] = data[:time]
74
75
 
76
+ if metadata[:properties].nil?
77
+ metadata[:properties] = []
78
+ end
79
+
80
+ properties = metadata[:properties].map do |property_data|
81
+ Metadata::Property.new(*property_data.values_at(*Metadata::Property.members))
82
+ end
83
+
84
+ metadata[:properties] = properties
85
+
75
86
  data
76
87
  end
77
88
  end
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: 2.5.7.0
4
+ version: 2.5.8.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: 2021-01-22 00:00:00.000000000 Z
11
+ date: 2021-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-message_store
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.1.4
111
+ rubygems_version: 3.1.2
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Common primitives for platform-specific messaging implementations for Eventide