evt-entity_cache 0.17.0.2 → 0.18.0.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: 76f5b244a298307755229bd2d919114b915bf59dcbc101fd21a612a56a627a3f
4
- data.tar.gz: 1f3bcc55d7e007d0c1bf5a527d95fede219c02c77742e5b8fba6c8082f272c7b
3
+ metadata.gz: ae771223b42527de66fc9419257d998984f89e5b020e78ed592b00dfba06d2f8
4
+ data.tar.gz: cbda82a45cd3188c808807bcfff540578ea98da9d51d6f1558408d746170a60f
5
5
  SHA512:
6
- metadata.gz: e0778b5ab3cad1cac65920b7240339e28b03d36b8ab47d29e48778c32e1ff2c02fe488ebb79af8846f4f8b24d73fbe49bad906c60b317d561d90048ae1a4f7e2
7
- data.tar.gz: 73824c0a380865e5933b377bfb2d3f0b896734339d47a19e99bcb495197962673d096cd0252276b55c976d00329113e09c6e241b01e4a8bccb5bacf652078645
6
+ metadata.gz: 92cee7b9ede8900a43312a1956fe2d9270706b26da5d52c0e42adb2510b5781d583a2738eef05bb9b5ed148b8d4534372f1138792fa6b4adcfcc909b78273c44
7
+ data.tar.gz: d832639518bca3fb8b6f016d888648e548e649a1f43c7560600925af377bed22d7a5313df3a08ab3b812c3808829964e90402ec9898c06db0555eafbb3303111
@@ -9,18 +9,8 @@ class EntityCache
9
9
  )
10
10
 
11
11
  class Record
12
- include Dependency
13
-
14
- dependency :clock, Clock::UTC
15
-
16
- def configure
17
- Clock::UTC.configure(self)
18
- end
19
-
20
12
  def self.build(id, entity, version, time, persisted_version: nil, persisted_time: nil)
21
- instance = new(id, entity, version, time, persisted_version, persisted_time)
22
- instance.configure
23
- instance
13
+ new(id, entity, version, time, persisted_version, persisted_time)
24
14
  end
25
15
 
26
16
  def self.destructure(instance, includes=nil)
@@ -28,26 +18,22 @@ class EntityCache
28
18
  end
29
19
 
30
20
  def age_milliseconds
31
- Clock::UTC.elapsed_milliseconds(time, clock.now)
21
+ Clock::UTC.elapsed_milliseconds(time, Clock::UTC.now)
32
22
  end
33
23
 
34
24
  def persisted_age_milliseconds
35
- if persisted_time.nil?
36
- nil
37
- else
38
- Clock::UTC.elapsed_milliseconds(
39
- persisted_time,
40
- time
41
- )
42
- end
25
+ return nil if persisted_time.nil?
26
+
27
+ Clock::UTC.elapsed_milliseconds(
28
+ persisted_time,
29
+ time
30
+ )
43
31
  end
44
32
 
45
33
  def persisted_age_versions
46
- if persisted_version.nil?
47
- nil
48
- else
49
- version - persisted_version
50
- end
34
+ return nil if persisted_version.nil?
35
+
36
+ version - persisted_version
51
37
  end
52
38
  end
53
39
  end
@@ -0,0 +1 @@
1
+ lib/entity_cache.rb
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: 0.17.0.2
4
+ version: 0.18.0.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: 2018-10-12 00:00:00.000000000 Z
11
+ date: 2018-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-configure
@@ -119,6 +119,7 @@ files:
119
119
  - lib/entity_cache/store/internal/scope/thread.rb
120
120
  - lib/entity_cache/store/internal/substitute.rb
121
121
  - lib/entity_cache/substitute.rb
122
+ - lib/loader.rb
122
123
  homepage: https://github.com/eventide-project/entity-cache
123
124
  licenses:
124
125
  - MIT
@@ -139,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
140
  version: '0'
140
141
  requirements: []
141
142
  rubyforge_project:
142
- rubygems_version: 2.7.6
143
+ rubygems_version: 2.7.3
143
144
  signing_key:
144
145
  specification_version: 4
145
146
  summary: Cache of entities retrieved by an entity-store, with in-memory temporary