multi_cache-rails 4.2.2 → 4.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/multi_cache/rails.rb +1 -1
- data/lib/multi_cache/version.rb +1 -1
- data/spec/rails_spec.rb +2 -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: 160364f3e99d10a1c74b8a11969a738b86dd9b99
|
4
|
+
data.tar.gz: c90a5b5a669685649d2cf659aff56af6521ff7cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36743f59e6d212207b804c81b23a04ccb27d4b3f106d3d07ceb3f0ceeb9e0b69886215bd07229f008a60ec6f0e342c616e5005316681b7d374d9e2ab10d417d1
|
7
|
+
data.tar.gz: 7c6c0a84eec84be83ae7f6d90523617ea70227be2b4db6332c00a10686f91752c528964347d12f5aebaf4a7bd5766ae01082f40c258e58ba6e5fa10f28cf825a
|
data/README.md
CHANGED
@@ -25,7 +25,6 @@ And then add "require" on 'project_root/config/application.rb'
|
|
25
25
|
```ruby
|
26
26
|
require 'rails/all'
|
27
27
|
require 'multi_cache'
|
28
|
-
|
29
28
|
```
|
30
29
|
|
31
30
|
## Usage
|
@@ -35,7 +34,7 @@ On `Application.configure` , it's like `project_root/config/emvironments/product
|
|
35
34
|
```ruby
|
36
35
|
YourProject::Application.configure do
|
37
36
|
|
38
|
-
config.cache_store = :dalli_store, 'localhost', { :
|
37
|
+
config.cache_store = :dalli_store, 'localhost', { compress: true }
|
39
38
|
config.cache_store = {
|
40
39
|
name: :secondary,
|
41
40
|
setting: :memory_store
|
@@ -44,6 +43,7 @@ end
|
|
44
43
|
```
|
45
44
|
|
46
45
|
Then, In your project, you can use the caches like below,
|
46
|
+
|
47
47
|
```ruby
|
48
48
|
Rails.cache.read("something") # fetch cached object from :dalli_store
|
49
49
|
Rails.cache(:secondary).read("something") # fetch cached object from :memory_store
|
data/lib/multi_cache/rails.rb
CHANGED
data/lib/multi_cache/version.rb
CHANGED
data/spec/rails_spec.rb
CHANGED
@@ -5,11 +5,12 @@ module Rails
|
|
5
5
|
let!(:set2) { Rails.cache = { name: :secondary, cache: 'cache_object2' } }
|
6
6
|
let!(:set3) { Rails.cache = { name: :tertiary, cache: 'cache_object3' } }
|
7
7
|
|
8
|
-
it '
|
8
|
+
it 'returns cache object' do
|
9
9
|
expect(Rails.cache).to eq 'cache_object1'
|
10
10
|
expect(Rails.cache(:default)).to eq 'cache_object1'
|
11
11
|
expect(Rails.cache(:secondary)).to eq 'cache_object2'
|
12
12
|
expect(Rails.cache(:tertiary)).to eq 'cache_object3'
|
13
|
+
expect(Rails.cache(:nothing)).to eq 'cache_object1'
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi_cache-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Uesugi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|