evt-entity_cache 2.0.1.1 → 2.0.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a65dee7e03fdffdece4718fe1d50e5cdf3f5e59466dfb224068b84c8356b6fc
|
4
|
+
data.tar.gz: b5f966733c02ad8280f954d10226ae99656788514d522e66e3b7750b1670ed62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad5d326c349c724b90b47fc8e4c5bfbf9c6558be071d9a61b1363266284a084b4a4ff2e5cde5eeb9596570252927e7cbb8038e610f3d9d5d4229e4232384072
|
7
|
+
data.tar.gz: fc18bafad76966151ff5029c4af0996e1b763113efc50a47e7f740f2c94b5030fc58bbe0fac5e8a73617e4014f20ea65bcba755e754d9762e26302541c02b827
|
@@ -18,13 +18,9 @@ class EntityCache
|
|
18
18
|
|
19
19
|
text = File.read(path)
|
20
20
|
|
21
|
-
entity_data, version, time_iso8601 =
|
21
|
+
entity_data, version, time_iso8601 = JSON.parse(text, symbolize_names: true)
|
22
22
|
|
23
|
-
entity = Entity::Example.new(
|
24
|
-
entity_data[:id],
|
25
|
-
entity_data[:some_attr],
|
26
|
-
entity_data[:other_attr]
|
27
|
-
)
|
23
|
+
entity = Entity::Example.new(*entity_data)
|
28
24
|
|
29
25
|
time = Clock.parse(time_iso8601)
|
30
26
|
|
@@ -34,11 +30,17 @@ class EntityCache
|
|
34
30
|
def put(id, entity, version, time)
|
35
31
|
path = path(id)
|
36
32
|
|
37
|
-
entity_data = entity
|
33
|
+
entity_data = Transform::Write.raw_data(entity)
|
38
34
|
|
39
35
|
time_iso8601 = Clock.iso8601(time)
|
40
36
|
|
41
|
-
|
37
|
+
data = [
|
38
|
+
entity_data,
|
39
|
+
version,
|
40
|
+
time_iso8601
|
41
|
+
]
|
42
|
+
|
43
|
+
text = JSON.generate(data)
|
42
44
|
|
43
45
|
File.write(path, text)
|
44
46
|
end
|
@@ -6,15 +6,18 @@ class EntityCache
|
|
6
6
|
def self.call
|
7
7
|
subject = Subject.example
|
8
8
|
|
9
|
-
|
9
|
+
entity = Controls::Entity.example
|
10
|
+
entity_data = Transform::Write.raw_data(entity)
|
10
11
|
|
11
12
|
persisted_time_iso8601 = Controls::Record.persisted_time.iso8601(5)
|
12
13
|
|
13
|
-
|
14
|
+
data = [
|
14
15
|
entity_data,
|
15
16
|
Controls::Record.persisted_version,
|
16
17
|
persisted_time_iso8601
|
17
|
-
]
|
18
|
+
]
|
19
|
+
|
20
|
+
text = JSON.generate(data)
|
18
21
|
|
19
22
|
path = External.path(subject)
|
20
23
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-entity_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.1.
|
4
|
+
version: 2.0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
requirements: []
|
144
|
-
rubygems_version: 3.3.
|
144
|
+
rubygems_version: 3.3.4
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Cache of entities retrieved by an entity-store, with in-memory temporary
|