background_cache 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/background_cache.gemspec +1 -1
- data/lib/background_cache.rb +0 -2
- data/lib/background_cache/helper.rb +4 -4
- metadata +3 -3
data/background_cache.gemspec
CHANGED
data/lib/background_cache.rb
CHANGED
@@ -44,8 +44,6 @@ module BackgroundCache
|
|
44
44
|
::Dalli::Client.send(:include, BackgroundCache::Memcache) if defined?(::Dalli::Client)
|
45
45
|
::MemCache.send(:include, BackgroundCache::Memcache) if defined?(::MemCache)
|
46
46
|
::Memcached::Rails.send(:include, BackgroundCache::Memcache) if defined?(::Memcached::Rails)
|
47
|
-
|
48
|
-
puts "ATTACH!"
|
49
47
|
end
|
50
48
|
|
51
49
|
def self.cache!(group=nil, instance=nil)
|
@@ -10,13 +10,13 @@ module BackgroundCache
|
|
10
10
|
# ActionController::Caching::Fragments#fragment_for (undocumented)
|
11
11
|
# actionpack/lib/action_controller/caching/fragments.rb
|
12
12
|
perform_caching =
|
13
|
-
if
|
14
|
-
|
13
|
+
if controller.respond_to?(:perform_caching)
|
14
|
+
controller.perform_caching
|
15
15
|
else
|
16
16
|
ActionController::Base.perform_caching
|
17
17
|
end
|
18
18
|
if perform_caching
|
19
|
-
cache =
|
19
|
+
cache = controller.read_fragment(name, options)
|
20
20
|
match = (
|
21
21
|
BackgroundCache.active? &&
|
22
22
|
BackgroundCache.match?(name)
|
@@ -28,7 +28,7 @@ module BackgroundCache
|
|
28
28
|
"<!-- #{name.inspect}#{' background' if match} cached #{Time.now.strftime("%m/%d/%Y at %I:%M %p")} -->",
|
29
29
|
output_buffer[pos..-1]
|
30
30
|
].join("\n")
|
31
|
-
|
31
|
+
controller.write_fragment(name, output, options)
|
32
32
|
else
|
33
33
|
output_buffer.concat(cache)
|
34
34
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: background_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 9
|
10
|
+
version: 0.2.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Winton Welsh
|