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: 8da465da7092111154500ccd3ec88eae4eb8461b014c90d3870b7b2dee883f7a
4
- data.tar.gz: 312567bb360f73eaeb91ad50e62a200c87aca4c4fa1a48115cf89f3494c4fd0a
3
+ metadata.gz: 3c9054228b49fc2e9ac46b139d4c0a195691a27fc8119da6ad38bb09747ad5f9
4
+ data.tar.gz: 8ee4904c625b30479719129311f031b0ecc1590177a6fe312d463a2488130a46
5
5
  SHA512:
6
- metadata.gz: d067b2d847ad674e4ebf8a4fba4dcadd0d4f2a06ccade434b2df4d2673c379f37cbb1661c611a23bca55fb74af2c32ba159cff8281705008a9594a2a58851868
7
- data.tar.gz: c281a5344b1a81ea8f9782bd0968f9ad970021d8362ee40f9c47ee04989563c681cf6a2d52070599ffcde23d0b1f9876bdec9f173d9ef10f9a9d8782206a339b
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
- expiration_date = Rails.cache.send(:read_entry, @key, {}).expires_at
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 { |c| c.include?(params[:query]) }
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
- # Replaced call of value because of https://github.com/redis-store/redis-store/issues/96
26
- # value = Rails.cache.read(key.to_s)
27
- value = Rails.cache.fetch(key.to_s, raw: true) { 0 }
25
+ # Only include keys that rails can read
26
+ begin
27
+ value = Rails.cache.read(key)
28
28
 
29
- @cached << {
30
- cache_key: key,
31
- cache_value: value,
32
- expiration: (Time.at(expiration_date) if expiration_date.present?)
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
 
@@ -1,3 +1,3 @@
1
1
  module Fastentry
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Alves