evt-entity_cache 2.0.1.0 → 2.0.1.1

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: bcdf7aa3489308ed84b73822573806208b675aa88a696234b8a883c0eda03cc2
4
- data.tar.gz: 04c895524f043e2092a4853a478ebfb61ba73de99f616fe564e975a0d36d1623
3
+ metadata.gz: 4ccf37e36c243d747764757e86a6552c649f157b1feabb174fd025d4019ecdff
4
+ data.tar.gz: 41ab27c85c699eacffd6cca4122eb44db0fa537a5ff033f73eca29ace4937f16
5
5
  SHA512:
6
- metadata.gz: c54ed18483b733b23872f2237f6d694e6b9e7dc373b602a08b9166f827e48a0b29983f4c5c25aa9c52bd9098798138b3fcca22b32eee2924698727b751fbe541
7
- data.tar.gz: e017489372a170d34d6d616daffa67a736847e537b425730a36c7601fa753dd3117ee3e580efb3d54ae7999efa8b09fc6ccb42aa618cdb8a86398533591cd5fe
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
- entity, version, time = YAML.load(text)
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
- text = YAML.dump([entity, version, time])
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
- Controls::Entity.example,
14
+ entity_data,
11
15
  Controls::Record.persisted_version,
12
- Controls::Record.persisted_time
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.0
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: 2020-12-01 00:00:00.000000000 Z
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.1.2
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