blobsterix 0.0.30 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.txt +3 -0
- data/lib/blobsterix/storage/cache.rb +5 -2
- data/lib/blobsterix/storage/file_system_meta_data.rb +11 -7
- data/lib/blobsterix/version.rb +1 -1
- data/lib/blobsterix.rb +1 -1
- data/spec/lib/storage/cache_spec.rb +3 -3
- data/templates/app/config/environments/development.rb +1 -1
- data/templates/app/config/environments/production.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1b4e9b58a1661c708d9ac142fc024e6d8a9ade4
|
4
|
+
data.tar.gz: 65864bd8e7ba85eea992a657c6dac5278e733e21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a093e1ba033c6ccc930bd12196c8dacc378840a669e8fcf7cacf7cda92bdeda9eeb41a0b39a6a465cb9e1c3b30745053c923258f17cace08af72481495940df
|
7
|
+
data.tar.gz: 101beace4d57ba6454d8937144250db5ed97b21e22e35b3cbb284ae7da0f662e31f655ea1b2c7d120a5dc7d93bd98ae626b714af9dbf5c4469bf7c61f5b71211
|
data/CHANGELOG.txt
CHANGED
@@ -5,11 +5,14 @@ module Blobsterix
|
|
5
5
|
|
6
6
|
def invalidation
|
7
7
|
each_meta_file do |meta_file|
|
8
|
+
meta_data = Blobsterix::SimpleProxy.new(Proc.new {
|
9
|
+
FileSystemMetaData.new(meta_file)
|
10
|
+
})
|
8
11
|
blob_access = Blobsterix::SimpleProxy.new(Proc.new {
|
9
12
|
meta_to_blob_access(FileSystemMetaData.new(meta_file))
|
10
13
|
})
|
11
|
-
if Blobsterix.cache_checker.call(blob_access,File.atime(meta_file),File.ctime(meta_file))
|
12
|
-
|
14
|
+
if Blobsterix.cache_checker.call(blob_access, meta_data, File.atime(meta_file), File.ctime(meta_file))
|
15
|
+
meta_data.delete
|
13
16
|
end
|
14
17
|
end
|
15
18
|
end
|
@@ -147,13 +147,17 @@ module Blobsterix
|
|
147
147
|
if not File.exists?(meta_path)
|
148
148
|
save_meta_file
|
149
149
|
else
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
150
|
+
begin
|
151
|
+
data = JSON.load(File.read(meta_path)) || {}
|
152
|
+
@mimetype = data["mimetype"]
|
153
|
+
@mediatype = data["mediatype"]
|
154
|
+
@etag = data["etag"]
|
155
|
+
@size = data["size"]
|
156
|
+
@payload = JSON.load(data["payload"]) || {}
|
157
|
+
@mimeclass = @mimetype ? MimeMagic.new(@mimetype) : nil
|
158
|
+
rescue JSON::ParserError => e
|
159
|
+
save_meta_file
|
160
|
+
end
|
157
161
|
end
|
158
162
|
end
|
159
163
|
end
|
data/lib/blobsterix/version.rb
CHANGED
data/lib/blobsterix.rb
CHANGED
@@ -26,13 +26,13 @@ describe Blobsterix::Storage::Cache do
|
|
26
26
|
|
27
27
|
after :each do
|
28
28
|
clear_cache
|
29
|
-
Blobsterix.cache_checker=lambda{|blob_access, last_accessed_at, created_at|
|
29
|
+
Blobsterix.cache_checker=lambda{|blob_access, meta_data, last_accessed_at, created_at|
|
30
30
|
false
|
31
31
|
}
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should follow invalidation structure" do
|
35
|
-
Blobsterix.cache_checker=lambda{|blob_access_, last_accessed_at, created_at|
|
35
|
+
Blobsterix.cache_checker=lambda{|blob_access_, meta_data, last_accessed_at, created_at|
|
36
36
|
blob_access_1.equals?(blob_access_) || blob_access_3.equals?(blob_access_)
|
37
37
|
}
|
38
38
|
Blobsterix.cache.invalidation
|
@@ -43,7 +43,7 @@ describe Blobsterix::Storage::Cache do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should invalidate all" do
|
46
|
-
Blobsterix.cache_checker=lambda{|blob_access_, last_accessed_at, created_at|
|
46
|
+
Blobsterix.cache_checker=lambda{|blob_access_, meta_data, last_accessed_at, created_at|
|
47
47
|
true
|
48
48
|
}
|
49
49
|
Blobsterix.cache.invalidation
|
@@ -24,7 +24,7 @@
|
|
24
24
|
# }
|
25
25
|
|
26
26
|
# # Use a specific cache checker for invalidation
|
27
|
-
# Blobsterix.cache_checker= lambda { |blob_access, last_accessed_at, created_at|
|
27
|
+
# Blobsterix.cache_checker= lambda { |blob_access, meta_data, last_accessed_at, created_at|
|
28
28
|
# false # return true to invalidate the cache entry
|
29
29
|
# }
|
30
30
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
# }
|
25
25
|
|
26
26
|
# # Use a specific cache checker for invalidation
|
27
|
-
# Blobsterix.cache_checker= lambda { |blob_access, last_accessed_at, created_at|
|
27
|
+
# Blobsterix.cache_checker= lambda { |blob_access, meta_data, last_accessed_at, created_at|
|
28
28
|
# false # return true to invalidate the cache entry
|
29
29
|
# }
|
30
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blobsterix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Sudmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|