3d_cache 0.0.02a → 0.0.021
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/three_d/model_fragments.rb +20 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26df33753782e99c53879e49329a28f79e8d0fc1
|
4
|
+
data.tar.gz: 50ca94e5a5c5c270a5ba40da991a8c3a68ab69a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2275c64ff359373cd6485f55ccd052428afd679aac28988050037043151a18c6cc7dbac5f586d6304ea942e2052c67908e6f13415ae5899fc1beecc06d0dfaaf
|
7
|
+
data.tar.gz: d1f6e614d8c058446699099fcb44ab0694bebdc41e6cf80502ec3e8e9484c21f51f153606a400ada0ef2a4282c508b88975d716961ca6ed1d43b162bed4bfb5b
|
@@ -18,11 +18,19 @@ module ThreeD
|
|
18
18
|
if ActionController::Base.cache_store.inspect.match("FileStore")
|
19
19
|
|
20
20
|
self.send :include, InstanceMethods
|
21
|
-
cattr_accessor :caching_path
|
21
|
+
cattr_accessor :caching_path, :allowed_fragments
|
22
22
|
|
23
23
|
self.caching_path = ActionController::Base.cache_store.cache_path
|
24
24
|
self.after_save :clear_view_cache
|
25
25
|
self.after_destroy :clear_view_cache
|
26
|
+
|
27
|
+
# TODO: Build hash or array based settings
|
28
|
+
# to allow only specified fragments to get called.
|
29
|
+
# Provide group ability to clear groups of fragments like
|
30
|
+
# :customers => %w(frag_a frag_b frag_c)
|
31
|
+
# user.clear_view_cache_group(:customers)
|
32
|
+
# => frag_a, frag_b frag_c get wiped!
|
33
|
+
self.allowed_fragments = []
|
26
34
|
else
|
27
35
|
raise "Currently, ModelFragments only support FileStore\nPlease set 'ActionController::Base.cache_store = :file_store, /path/to/cache'"
|
28
36
|
end
|
@@ -32,10 +40,20 @@ module ThreeD
|
|
32
40
|
def has_model_fragments?
|
33
41
|
self.included_modules.include?(InstanceMethods)
|
34
42
|
end
|
43
|
+
|
44
|
+
def cache_helper
|
45
|
+
# TODO: Here should be the real ActionController caching funtionality
|
46
|
+
#ActionController::Caching::Fragments.new
|
47
|
+
end
|
35
48
|
end
|
36
49
|
|
37
50
|
module InstanceMethods
|
38
|
-
|
51
|
+
|
52
|
+
def cache(data, scope_data=nil, &block)
|
53
|
+
# TODO: Implement Cache function directly from model instance
|
54
|
+
end
|
55
|
+
|
56
|
+
|
39
57
|
def cache_name(data, scope_data=nil)
|
40
58
|
data = data.to_s
|
41
59
|
x = "#{self.class.name.parameterize}_#{self.id}_cache_#{data}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 3d_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.021
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Eck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Cache results of method calls for a class in RAM
|
14
14
|
email:
|
@@ -36,9 +36,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
36
36
|
version: '0'
|
37
37
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: '0'
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
44
|
rubygems_version: 2.2.1
|