perma_cache 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile.lock +4 -1
- data/lib/perma_cache.rb +9 -6
- data/lib/perma_cache/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d57dc94561e4a76f37b4dab4a08e01f42dd17fdb
|
4
|
+
data.tar.gz: f8c5e17b1be038e08ad3037e154f9ed0f974a18a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e233fb321114f6a66e5956c5625503dec21030910c3cce754713b8ae542208a441000af438d4dd3bc27d590607d400699ddc4104d59ff5f69b4b051113a905e7
|
7
|
+
data.tar.gz: f30990120e9d68f1bffc15f23ee6476ccec4b027966edc79bd88ba23edfd19f460b411443d6d03f236f6a782e2ad6f84a56d6a69de6fdce6c69bfa607148be7e
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.4
|
data/Gemfile.lock
CHANGED
data/lib/perma_cache.rb
CHANGED
@@ -17,7 +17,7 @@ module PermaCache
|
|
17
17
|
@cache || raise(UndefinedCache, "Please define a cache object: (PermaCache.cache = Rails.cache)")
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.cache=
|
20
|
+
def self.cache=(c)
|
21
21
|
@cache = c
|
22
22
|
end
|
23
23
|
|
@@ -90,13 +90,14 @@ module PermaCache
|
|
90
90
|
PermaCache.cache.read(send("#{method_name}_perma_cache_key"))
|
91
91
|
end
|
92
92
|
|
93
|
-
|
93
|
+
with_perma_cache_method_name = "#{method_base}_with_perma_cache#{method_suffix}"
|
94
|
+
define_method with_perma_cache_method_name do
|
94
95
|
instance_variable_set(was_rebuilt_inst_var , false)
|
95
96
|
|
96
97
|
send("#{method_name}_get_perma_cache") ||
|
97
|
-
|
98
|
-
|
99
|
-
|
98
|
+
(
|
99
|
+
instance_variable_set(was_rebuilt_inst_var , true) &&
|
100
|
+
send("#{method_name}!")
|
100
101
|
)
|
101
102
|
end
|
102
103
|
|
@@ -104,7 +105,9 @@ module PermaCache
|
|
104
105
|
instance_variable_get(was_rebuilt_inst_var ) == true
|
105
106
|
end
|
106
107
|
|
107
|
-
|
108
|
+
base_name = [method_base, method_suffix].join
|
109
|
+
alias_method [[method_base, 'without', 'perma_cache'].compact.join('_'), method_suffix].join, base_name
|
110
|
+
alias_method base_name, with_perma_cache_method_name
|
108
111
|
end
|
109
112
|
end
|
110
113
|
end
|
data/lib/perma_cache/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perma_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Sharpe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
version: '0'
|
65
65
|
requirements: []
|
66
66
|
rubyforge_project:
|
67
|
-
rubygems_version: 2.4.
|
67
|
+
rubygems_version: 2.4.8
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: It's a perma cache, duh
|