fastentry 0.1.4 → 0.1.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c9054228b49fc2e9ac46b139d4c0a195691a27fc8119da6ad38bb09747ad5f9
|
4
|
+
data.tar.gz: 8ee4904c625b30479719129311f031b0ecc1590177a6fe312d463a2488130a46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e16635fc0e2c81889455e6d42fd78d0641e46fe5857e5d6415aa7e2b2151d36336451e81e6b859ad33b71ee30e6a32f18bdea11434bf3773474947ae9dcb803e
|
7
|
+
data.tar.gz: 85c328b0499f3dfce1d19afa32bb539a920136006c6d70386b4acf2b8232f9443b04b2579bc29ea17fc82e7a19685910865e8c9e23055304423df407ce820968
|
@@ -2,7 +2,13 @@ module Fastentry
|
|
2
2
|
class CacheController < ApplicationController
|
3
3
|
def show
|
4
4
|
@key = params[:key]
|
5
|
-
|
5
|
+
|
6
|
+
begin
|
7
|
+
expiration_date = Rails.cache.send(:read_entry, key, {}).expires_at
|
8
|
+
rescue
|
9
|
+
expiration_date = nil
|
10
|
+
end
|
11
|
+
|
6
12
|
@expiration = (Time.at(expiration_date).strftime("%a, %e %b %Y %H:%M:%S %z") if expiration_date.present?)
|
7
13
|
@cache_item = Rails.cache.read(@key)
|
8
14
|
end
|
@@ -6,7 +6,7 @@ module Fastentry
|
|
6
6
|
@keys = Rails.cache.instance_variable_get(:@data).keys
|
7
7
|
|
8
8
|
if params[:query].present?
|
9
|
-
@keys = @keys.select { |
|
9
|
+
@keys = @keys.select { |key| key.downcase.include?(params[:query].downcase) }
|
10
10
|
end
|
11
11
|
|
12
12
|
@number_of_pages = (@keys.count / @per_page.to_f).ceil
|
@@ -22,15 +22,16 @@ module Fastentry
|
|
22
22
|
expiration_date = nil
|
23
23
|
end
|
24
24
|
|
25
|
-
#
|
26
|
-
|
27
|
-
|
25
|
+
# Only include keys that rails can read
|
26
|
+
begin
|
27
|
+
value = Rails.cache.read(key)
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
@cached << {
|
30
|
+
cache_key: key,
|
31
|
+
cache_value: value,
|
32
|
+
expiration: (Time.at(expiration_date) if expiration_date.present?)
|
33
|
+
}
|
34
|
+
end
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
data/lib/fastentry/version.rb
CHANGED