cache_key_for 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Gemfile.lock +1 -1
- data/README.md +17 -7
- data/bin/console +1 -1
- data/lib/cache_key_for.rb +1 -1
- data/lib/cache_key_for/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: fbcb149bca59e95a5a19e83a54c909ed3f4cd710
|
4
|
+
data.tar.gz: 8e4be33d6dfe2d03f96ae48b750e74e2b4a82625
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c13742c65e6b4aa0dbbdb1c5f378e26105b3f3f3a01b03c70af2e97985f593bf08d86b8351fc88e510604851a889a395acd53dd47053227703e0519189e2514
|
7
|
+
data.tar.gz: eb8a4cc4e1993454a55966bcd9aa2d7f0d46064a1ae3f0631778ed1f062ef996ed4c21c1fcd4ad5c442087a8a067e448c401b9d4c39c6f66845e723d9a62b517
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -27,21 +27,21 @@ Features:
|
|
27
27
|
* one key instead of many, but also unobtrusive (example in haml):
|
28
28
|
|
29
29
|
```haml
|
30
|
-
|
31
|
-
|
30
|
+
- cache [cache_key_for(@articles, 'articles'), @some_active_model_object, 'box-type-view'] do
|
31
|
+
(...)
|
32
32
|
```
|
33
33
|
* core concept of Russian Doll Caching is touching: `belongs_to :some_model, touch: true`, but if you do not use `touch`, you can still cache safely like this (example in haml):
|
34
34
|
|
35
35
|
```haml
|
36
|
-
|
37
|
-
|
36
|
+
- cache [cache_key_for(@articles, 'articles'), @some_model_instance] do
|
37
|
+
(...)
|
38
38
|
```
|
39
39
|
|
40
40
|
Example (haml):
|
41
41
|
|
42
42
|
```haml
|
43
|
-
|
44
|
-
|
43
|
+
- cache cache_key_for(@service.datacenters, 'datacenters', current_company.cache_key, Time.now.utc.to_date.to_s) do
|
44
|
+
(...)
|
45
45
|
```
|
46
46
|
|
47
47
|
Rails will generate cache at:
|
@@ -59,7 +59,8 @@ Features:
|
|
59
59
|
Example (haml):
|
60
60
|
|
61
61
|
```haml
|
62
|
-
|
62
|
+
- cache cache_key_for_view(__FILE__, @service.datacenters, 'datacenters', current_company.cache_key, Time.now.utc.to_date.to_s) do
|
63
|
+
(...)
|
63
64
|
```
|
64
65
|
|
65
66
|
Rails will generate cache at:
|
@@ -73,3 +74,12 @@ app_name:views/en/datacenters/5bd92bd352e7726d02175752913014711f5d412e/companies
|
|
73
74
|
|
74
75
|
./bin/setup
|
75
76
|
bundle exec rake
|
77
|
+
|
78
|
+
## Testing new versions
|
79
|
+
|
80
|
+
rm gemfiles/*.lock
|
81
|
+
bundle exec appraisal install
|
82
|
+
|
83
|
+
## TODO
|
84
|
+
|
85
|
+
- add coveralls
|
data/bin/console
CHANGED
data/lib/cache_key_for.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cache_key_for
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Kalita
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|