ruby_event_store 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/ruby_event_store/mappers/protobuf.rb +0 -6
- data/lib/ruby_event_store/mappers/transformation/encryption.rb +2 -2
- data/lib/ruby_event_store/mappers/transformation/protobuf_nested_struct_metadata.rb +1 -2
- data/lib/ruby_event_store/projection.rb +1 -0
- data/lib/ruby_event_store/spec/event_lint.rb +2 -4
- data/lib/ruby_event_store/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36e7110d2b9570a081d8c27c092fb49f745e2fc52df0f5ac8a1fef43e9c947b5
|
4
|
+
data.tar.gz: eca5201fd1e093a988d0dbd405a46fbd78c1da27e2733fc263e6fcd4b474eed8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa50fda1e6bf1deb3d8ea4b22b39d4e039a18b3ad6fd325c1b6295195f435214f4210a14fb4f164ad5113db0a8f0bd8d27ff083bd2cccdb6a6714c01cda3239f
|
7
|
+
data.tar.gz: d7bf94647c93fa324249b63495a792bd56678037db5bc0a03fb654679e7298d8d15fbd4846e174a98335986c6eeccd9d326c4c8b67435b0e03edb84a94a2249d
|
data/Gemfile
CHANGED
@@ -5,12 +5,6 @@ module RubyEventStore
|
|
5
5
|
def event_type
|
6
6
|
data.class.descriptor.name
|
7
7
|
end
|
8
|
-
|
9
|
-
def ==(other_event)
|
10
|
-
other_event.instance_of?(self.class) &&
|
11
|
-
other_event.event_id.eql?(event_id) &&
|
12
|
-
other_event.data == data # https://github.com/google/protobuf/issues/4455
|
13
|
-
end
|
14
8
|
end
|
15
9
|
|
16
10
|
module Mappers
|
@@ -82,14 +82,14 @@ module RubyEventStore
|
|
82
82
|
|
83
83
|
def encrypt_data(data, meta)
|
84
84
|
meta.reduce(data) do |acc, (key, value)|
|
85
|
-
acc[key] = encrypt_attribute(acc, key, value)
|
85
|
+
acc[key] = encrypt_attribute(acc, key, value) if data.has_key?(key)
|
86
86
|
acc
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
90
|
def decrypt_data(data, meta)
|
91
91
|
meta.reduce(data) do |acc, (key, value)|
|
92
|
-
acc[key] = decrypt_attribute(data, key, value)
|
92
|
+
acc[key] = decrypt_attribute(data, key, value) if data.has_key?(key)
|
93
93
|
acc
|
94
94
|
end
|
95
95
|
end
|
@@ -9,8 +9,7 @@ module RubyEventStore
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def dump(item)
|
12
|
-
|
13
|
-
metadata = ProtobufNestedStruct::HashMapStringValue.dump(stringify.dump(item).metadata)
|
12
|
+
metadata = ProtobufNestedStruct::HashMapStringValue.dump(item.metadata)
|
14
13
|
item.merge(metadata: metadata)
|
15
14
|
end
|
16
15
|
|
@@ -1,9 +1,7 @@
|
|
1
|
-
RSpec.shared_examples :event do |event_class|
|
1
|
+
RSpec.shared_examples :event do |event_class, data, metadata|
|
2
2
|
it 'allows initialization' do
|
3
3
|
expect {
|
4
|
-
|
5
|
-
allow(metadata).to receive(:to_h).and_return({})
|
6
|
-
event_class.new(event_id: Object.new, data: Object.new, metadata: metadata)
|
4
|
+
event_class.new(event_id: Object.new, data: data || Object.new, metadata: metadata || {})
|
7
5
|
}.not_to raise_error
|
8
6
|
end
|
9
7
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_event_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arkency
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|