grape-shaman_cache 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -0
- data/lib/grape-shaman_cache/formatter.rb +1 -1
- data/lib/grape-shaman_cache/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eabdcd8ad65aeed91129f697c70d86cb43dd90a9
|
4
|
+
data.tar.gz: fd6ac474a8a5c3ef8d09139302ef834721aa4a5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a112d9187f92e4f07b28699c2b3141ca059d1b14f2bf2254ee6c8047e739966e4936e2983538c611a32b4a05b70d102699533361e2cee39fa9d3b0913654cee
|
7
|
+
data.tar.gz: b461843ef20841a3c9f70688b7b37c97ab5c348dfac74b2d65b5b58036e46f6bf6d49ed235adb48ea91e3e630cfa4689cc732a48e979bce72c2f7d3fb8aaf8c3
|
data/README.md
CHANGED
@@ -52,6 +52,25 @@ class Welcome < Grape::API
|
|
52
52
|
end
|
53
53
|
```
|
54
54
|
|
55
|
+
or
|
56
|
+
|
57
|
+
```
|
58
|
+
class Welcome < Grape::API
|
59
|
+
|
60
|
+
include Grape::ShamanCache
|
61
|
+
|
62
|
+
format :json
|
63
|
+
formatter :json, Grape::Formatter::Jbuilder
|
64
|
+
|
65
|
+
get :home, jbuilder: 'welcome/home' do
|
66
|
+
cache(key: [:v2, :home], expires_in: 2.hours) do
|
67
|
+
@banners = Article.banner.without_gifts
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
```
|
73
|
+
|
55
74
|
## Configuration
|
56
75
|
|
57
76
|
By default `Grape::ShamanCache` will use an instance of `ActiveSupport::Cache::MemoryStore` in a non-Rails application. You can configure it to use any other cache store.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-shaman_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Wang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|