rails_web_cache 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c354bf2c12dd1308f2b8a98b862a430adde71cb495975670412ab7c32c2049d4
|
4
|
+
data.tar.gz: 799df3985a7a88bc64ae1abd843e32f6f4be40662aa44f3bb8e683b8d408a85a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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>
|
data/lib/rails_web_cache/base.rb
CHANGED
@@ -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
|
19
|
-
return
|
23
|
+
return unless key
|
24
|
+
return unless type(key) == 'string'
|
20
25
|
entry = read_entry(key, options)
|
21
|
-
return
|
26
|
+
return unless entry
|
22
27
|
RailsWebCache::Entry.new(entry)
|
23
28
|
end
|
24
29
|
|