multi_cache-rails 3.2.0 → 3.2.1

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
  SHA1:
3
- metadata.gz: 569ea9889b901d3f0b97f2f1d606c7b4117b032b
4
- data.tar.gz: 4c3c841a42a65947015522e6e0e95e3498a31c2d
3
+ metadata.gz: 59eca02809a426975afff0519d87d6c1c1ac28bb
4
+ data.tar.gz: 4385cf909f18177a290e84516d2d267a9a3728ee
5
5
  SHA512:
6
- metadata.gz: b26737996cd9c302e3cc2072b26a55abd99f9c62f1dd2dd3f7ca7e1096d6b74c4b7ea91fe803874df9292c474f63b67a920783a12a7c26b06296bf379d674ceb
7
- data.tar.gz: 4a7eb1480e19670d628de6c79e1ceeb0be1b2569663440657eb9188cb6b327e589e3a5277444a229e6eb8cd9a55d00e0af88bfb9167afcb6944273d9da975282
6
+ metadata.gz: 87d3d85aa07dfc7d9f3aa95dc55aa5362c4c88fbad7526c9fc36087e00975a6033ac3aab87db9f180724407508af04dbde03eaae6b77885448e09f40532b47e4
7
+ data.tar.gz: 7ef0cbce67561e229d50f069fdb6e8056732f5ff263e915160ce904b99c48a2c1c6e611c515efca54ccd970e20d936bbc2fc1c6d04613123ab69119db05cc1ca
data/README.md CHANGED
@@ -19,14 +19,22 @@ Or install it yourself as:
19
19
 
20
20
  $ gem install multi_cache-rails
21
21
 
22
+
23
+ And then add "require" on 'project_root/config/application.rb'
24
+
25
+ ```ruby
26
+ require 'rails/all'
27
+ require 'multi_cache'
28
+ ```
29
+
22
30
  ## Usage
23
31
 
24
32
  On `Application.configure` , it's like `project_root/config/emvironments/production.rb`
25
33
 
26
- ```
34
+ ```ruby
27
35
  YourProject::Application.configure do
28
36
 
29
- config.cache_store = :dalli_store, 'localhost', { :namespace => 'Fril', :compress => true }
37
+ config.cache_store = :dalli_store, 'localhost', { compress: true }
30
38
  config.cache_store = {
31
39
  name: :secondary,
32
40
  setting: :memory_store
@@ -35,7 +43,8 @@ end
35
43
  ```
36
44
 
37
45
  Then, In your project, you can use the caches like below,
38
- ```
46
+
47
+ ```ruby
39
48
  Rails.cache.read("something") # fetch cached object from :dalli_store
40
49
  Rails.cache(:secondary).read("something") # fetch cached object from :memory_store
41
50
  ```
@@ -16,7 +16,7 @@ module Rails
16
16
  def cache(name = :default)
17
17
  return nil unless defined? @cache
18
18
  return RAILS_CACHE if name == :default
19
- @cache[name]
19
+ @cache[name] || RAILS_CACHE
20
20
  end
21
21
  end
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module MultiCache
2
2
  module Rails
3
- VERSION = '3.2.0'
3
+ VERSION = '3.2.1'
4
4
  end
5
5
  end
data/spec/rails_spec.rb CHANGED
@@ -10,6 +10,7 @@ module Rails
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: 3.2.0
4
+ version: 3.2.1
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-09 00:00:00.000000000 Z
11
+ date: 2015-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler