evt-entity_cache 2.0.1.0 → 2.0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ccf37e36c243d747764757e86a6552c649f157b1feabb174fd025d4019ecdff
|
4
|
+
data.tar.gz: 41ab27c85c699eacffd6cca4122eb44db0fa537a5ff033f73eca29ace4937f16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96bfc7773f4e5e34c307315c8de52e2741b933c9f75bc49e7d96f34df3ac5dd5e024b4c8964c12afc019cc1fd8fbd675ca3dae069b220751fee89a215f1a0c4e
|
7
|
+
data.tar.gz: eb9c2b7ace7f89be4c7fd035a8b405b4be8c01b058f22fd694b0de0398a83295d364185c7950ae3b2b194e358100e90179d168c34ce482b10da3bb5bd3ac481b
|
@@ -18,7 +18,15 @@ class EntityCache
|
|
18
18
|
|
19
19
|
text = File.read(path)
|
20
20
|
|
21
|
-
|
21
|
+
entity_data, version, time_iso8601 = YAML.load(text)
|
22
|
+
|
23
|
+
entity = Entity::Example.new(
|
24
|
+
entity_data[:id],
|
25
|
+
entity_data[:some_attr],
|
26
|
+
entity_data[:other_attr]
|
27
|
+
)
|
28
|
+
|
29
|
+
time = Clock.parse(time_iso8601)
|
22
30
|
|
23
31
|
return entity, version, time
|
24
32
|
end
|
@@ -26,7 +34,11 @@ class EntityCache
|
|
26
34
|
def put(id, entity, version, time)
|
27
35
|
path = path(id)
|
28
36
|
|
29
|
-
|
37
|
+
entity_data = entity.to_h
|
38
|
+
|
39
|
+
time_iso8601 = Clock.iso8601(time)
|
40
|
+
|
41
|
+
text = YAML.dump([entity_data, version, time_iso8601])
|
30
42
|
|
31
43
|
File.write(path, text)
|
32
44
|
end
|
@@ -41,7 +53,9 @@ class EntityCache
|
|
41
53
|
|
42
54
|
filename = "#{subject.to_s.gsub('/', '-')}-#{id}.yaml"
|
43
55
|
|
44
|
-
File.join(tmpdir, filename)
|
56
|
+
full_name = File.join(tmpdir, filename)
|
57
|
+
|
58
|
+
full_name
|
45
59
|
end
|
46
60
|
|
47
61
|
def self.tmpdir
|
@@ -6,10 +6,14 @@ class EntityCache
|
|
6
6
|
def self.call
|
7
7
|
subject = Subject.example
|
8
8
|
|
9
|
+
entity_data = Controls::Entity.example.to_h
|
10
|
+
|
11
|
+
persisted_time_iso8601 = Controls::Record.persisted_time.iso8601(5)
|
12
|
+
|
9
13
|
text = YAML.dump([
|
10
|
-
|
14
|
+
entity_data,
|
11
15
|
Controls::Record.persisted_version,
|
12
|
-
|
16
|
+
persisted_time_iso8601
|
13
17
|
])
|
14
18
|
|
15
19
|
path = External.path(subject)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.1
|
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:
|
11
|
+
date: 2022-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-configure
|
@@ -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.
|
144
|
+
rubygems_version: 3.3.3
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Cache of entities retrieved by an entity-store, with in-memory temporary
|