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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7818d6e5ddd1404043ab18424dc717dc618fda1b
4
- data.tar.gz: ed53fba22b6a833a978ab8e640789e8379837819
3
+ metadata.gz: d57dc94561e4a76f37b4dab4a08e01f42dd17fdb
4
+ data.tar.gz: f8c5e17b1be038e08ad3037e154f9ed0f974a18a
5
5
  SHA512:
6
- metadata.gz: 34c9f6b10aedf2dfd165c5614d50468646e1ea4670f957c4c691a6ab4b88ef071cf4476ecc774b88c7677bfd1a562e6ecfdf9d5e4b3b1f5531dba1791f6de347
7
- data.tar.gz: b874c832786108ae990fab1dc105b4aaa161f249d4469cf142ba88257783792533c3383db9f3131ad80b7926ff67fbf7969fbaa5bed6cc864242771fc9e95619
6
+ metadata.gz: e233fb321114f6a66e5956c5625503dec21030910c3cce754713b8ae542208a441000af438d4dd3bc27d590607d400699ddc4104d59ff5f69b4b051113a905e7
7
+ data.tar.gz: f30990120e9d68f1bffc15f23ee6476ccec4b027966edc79bd88ba23edfd19f460b411443d6d03f236f6a782e2ad6f84a56d6a69de6fdce6c69bfa607148be7e
@@ -1 +1 @@
1
- 2.1.6
1
+ 2.3.4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- perma_cache (0.0.8)
4
+ perma_cache (0.0.9)
5
5
  rails
6
6
 
7
7
  GEM
@@ -120,3 +120,6 @@ DEPENDENCIES
120
120
  perma_cache!
121
121
  rake
122
122
  shoulda
123
+
124
+ BUNDLED WITH
125
+ 1.15.1
@@ -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= c
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
- define_method "#{method_base}_with_perma_cache#{method_suffix}" do
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
- instance_variable_set(was_rebuilt_inst_var , true) &&
99
- send("#{method_name}!")
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
- alias_method_chain [method_base, method_suffix].join, :perma_cache
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
@@ -1,3 +1,3 @@
1
1
  module PermaCache
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
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.8
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: 2015-05-07 00:00:00.000000000 Z
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.6
67
+ rubygems_version: 2.4.8
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: It's a perma cache, duh