cache_box 0.0.1.pre.preview4 → 0.0.1.pre.preview5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cache_box.gemspec +1 -1
- data/lib/cache_box.rb +7 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2696a6649dcad9e95fd86414bda8423a5616be25bf26d305a453f2b51e451b6
|
4
|
+
data.tar.gz: fa0a66aa95e7fe7f22cfd4b432f17fd7f6fb803ad48ad4c867a0069da511ff21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 187afed6548e4184dd5b8468f4f12bc4de6a7ded494e17dca21429097054c9b57f362a4ad4ddc0e07e849f95c61641826b8f4920417791da6d22e59c063f5eea
|
7
|
+
data.tar.gz: c0a15319d4d63e135d216fe50cefc4256ccb0b465d642a7595b75c021733fee554c45d704cc3ecfe2d18f819e887c268fcaa9557d2ae1b59df110253f5b7d895
|
data/cache_box.gemspec
CHANGED
data/lib/cache_box.rb
CHANGED
@@ -159,9 +159,9 @@ class CacheBox
|
|
159
159
|
if File.exist?(file)
|
160
160
|
data = Marshal.load(File.read(file))
|
161
161
|
|
162
|
-
@state[:complete][name] = data[:complete]
|
163
|
-
@state[:result][name] = data[:result]
|
164
|
-
@state[:storage][name] = data[:storage]
|
162
|
+
@state[:complete][name] = data[:complete] if data.key?(:complete)
|
163
|
+
@state[:result][name] = data[:result] if data.key?(:result)
|
164
|
+
@state[:storage][name] = data[:storage] if data.key?(:storage)
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
@@ -183,11 +183,10 @@ class CacheBox
|
|
183
183
|
#
|
184
184
|
# Output: N/A
|
185
185
|
def store!(name, file)
|
186
|
-
data = {
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
data[:storage] = @state[:storage][name] unless @state[:complete][name]
|
186
|
+
data = {}
|
187
|
+
data[:complete] = @state[:complete][name] if @state[:complete][name]
|
188
|
+
data[:result] = @state[:result][name] if @state[:result][name]
|
189
|
+
data[:storage] = @state[:storage][name] if @state[:complete][name]
|
191
190
|
|
192
191
|
content = Marshal.dump(data)
|
193
192
|
|