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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9a50e9a74f5d7fc98c82445092674bba4dcbc3b
4
- data.tar.gz: bee6530e0ad8ce1d9b10ee2547aa16f685d5ddcd
3
+ metadata.gz: 160364f3e99d10a1c74b8a11969a738b86dd9b99
4
+ data.tar.gz: c90a5b5a669685649d2cf659aff56af6521ff7cc
5
5
  SHA512:
6
- metadata.gz: 707b37a6662f4306b749550651f8f39344009785c790d602e0357963feb5fc027654759c855d2d7e3876cc816eb0265b713faa911c897e94d3a504232f3aa2be
7
- data.tar.gz: 0674c29eb30c0b2b0e74139ff0799e7bd6aeb7abe6e2047c03f03ac9bc24f3478804a710adaf70aee77c9c7b318e6fc39d3d1af93457db69efe10b291cedc34c
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', { :namespace => 'Fril', :compress => true }
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
@@ -14,7 +14,7 @@ module Rails
14
14
 
15
15
  def cache(name = :default)
16
16
  return nil unless defined? @cache
17
- @cache[name]
17
+ @cache[name] || @cache[:default]
18
18
  end
19
19
  end
20
20
  end
@@ -1,5 +1,5 @@
1
1
  module MultiCache
2
2
  module Rails
3
- VERSION = '4.2.2'
3
+ VERSION = '4.2.3'
4
4
  end
5
5
  end
@@ -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 'retyrns cache object' do
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.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-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