asset_id 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/asset_id/asset.rb +3 -1
- data/lib/asset_id/backend/s3.rb +5 -1
- data/lib/asset_id/cache.rb +4 -0
- metadata +1 -1
data/lib/asset_id/asset.rb
CHANGED
data/lib/asset_id/backend/s3.rb
CHANGED
data/lib/asset_id/cache.rb
CHANGED
@@ -15,6 +15,10 @@ module AssetID
|
|
15
15
|
File.join(Rails.root, 'log', 'asset_id_cache.yml')
|
16
16
|
end
|
17
17
|
|
18
|
+
def get(asset)
|
19
|
+
cache[asset.relative_path]
|
20
|
+
end
|
21
|
+
|
18
22
|
def self.hit?(asset)
|
19
23
|
return true if cache[asset.relative_path] and cache[asset.relative_path][:fingerprint] == asset.fingerprint
|
20
24
|
cache[asset.relative_path] = {:expires => asset.expiry_date.to_s, :fingerprint => asset.fingerprint}
|