rails_web_cache 0.4.0 → 0.5.0

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: b6f95ce1ca704946626e06d6ac9d2a7a4033d102a6486c5aa871916342075604
4
- data.tar.gz: 3b4167a3c6eaa24f19e9004bc3716f603e81e8bf4025db8447f3eaa688c9530e
3
+ metadata.gz: c354bf2c12dd1308f2b8a98b862a430adde71cb495975670412ab7c32c2049d4
4
+ data.tar.gz: 799df3985a7a88bc64ae1abd843e32f6f4be40662aa44f3bb8e683b8d408a85a
5
5
  SHA512:
6
- metadata.gz: d9bffb10206976efebc38ec5b0cc916aef79dc36c91df6925f2cb5fea565d020d121acf08a63aea16a0266c93bf5fdd519fa4413a719cdaf27cbb65fc48567bc
7
- data.tar.gz: c94b26e0d851ec620c400ec19a1d96a81985188e8aa8b26f49d140c07b346cf87f5716d6ef7f4bb274d874e244b04d0ba8484d1982469957da040df827eb6214
6
+ metadata.gz: 01d6be63e87ac22f22fb15481d010015047c24d40de4ef62b98deda5302e06c530ae342682c8f772ff288b6c366647ba99371d24e7ac11c0420a7675d9ddcbf1
7
+ data.tar.gz: 4efce77da94e5e340948ef4d0c918a9e30d743e8a4c64418103aacf74c6985f6af1d48292315ef36c24e8006fa5458779433b58f864fe241f741d46033cf0518
@@ -1,7 +1,7 @@
1
1
  <div class="container mt-4">
2
2
  <div class="row">
3
3
  <div class="col-12">
4
- <%= form_tag(root_path, method: :get, class: 'mb-4') do %>
4
+ <%= form_tag(root_path, method: :get, class: 'mb-4', enforce_utf8: false) do %>
5
5
  <div class="input-group">
6
6
  <%= text_field_tag :query, params[:query], class: 'form-control', placeholder: 'Search key(s)' %>
7
7
  <div class="input-group-append">
@@ -13,7 +13,7 @@
13
13
  </div>
14
14
  <div class="row">
15
15
  <div class="col-12">
16
- <%= form_tag(destroy_all_keys_path, method: :delete) do %>
16
+ <%= form_tag(destroy_all_keys_path, method: :delete, enforce_utf8: false) do %>
17
17
  <div class="table-responsive">
18
18
  <table class="table table-striped table-bordered">
19
19
  <thead>
@@ -25,9 +25,9 @@ module RailsWebCache
25
25
  end
26
26
 
27
27
  def entry(key, options = {})
28
- return nil unless key
28
+ return unless key
29
29
  entry = read_entry(key, options)
30
- return nil unless entry
30
+ return unless entry
31
31
  RailsWebCache::Entry.new(entry)
32
32
  end
33
33
 
@@ -10,15 +10,20 @@ module RailsWebCache
10
10
  redis.keys
11
11
  end
12
12
 
13
+ def read(key)
14
+ return unless type(key) == 'string'
15
+ cache.read(key) if key
16
+ end
17
+
13
18
  def search(query = '')
14
19
  redis.scan_each(match: "*#{query.downcase}*").to_a if query
15
20
  end
16
21
 
17
22
  def entry(key, options = {})
18
- return nil unless key
19
- return nil unless type(key) == 'string'
23
+ return unless key
24
+ return unless type(key) == 'string'
20
25
  entry = read_entry(key, options)
21
- return nil unless entry
26
+ return unless entry
22
27
  RailsWebCache::Entry.new(entry)
23
28
  end
24
29
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsWebCache
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_web_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris BRESCIANI