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.
@@ -6,7 +6,7 @@ $:.unshift lib unless $:.include?(lib)
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "background_cache"
9
- s.version = '0.2.8'
9
+ s.version = '0.2.9'
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = [ "Winton Welsh" ]
12
12
  s.email = [ "mail@wintoni.us" ]
@@ -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 @controller.respond_to?(:perform_caching)
14
- @controller.perform_caching
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 = @controller.read_fragment(name, options)
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
- @controller.write_fragment(name, output, options)
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: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 8
10
- version: 0.2.8
9
+ - 9
10
+ version: 0.2.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Winton Welsh