background_cache 0.1.2 → 0.1.3

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.
@@ -50,8 +50,7 @@ module BackgroundCache
50
50
  end
51
51
  def self.from_controller_and_fragment(controller, fragment={})
52
52
  params = controller.params
53
- params.delete 'background_cache'
54
- path = controller.request.env['REQUEST_URI'].gsub(/[&?]background_cache=.+/, '')
53
+ path = controller.request.env['REQUEST_URI']
55
54
  cache =
56
55
  if defined?(@@caches) && !@@caches.empty?
57
56
  @@caches.detect do |item|
@@ -98,7 +97,7 @@ module BackgroundCache
98
97
  cache
99
98
  end
100
99
  def self.caches
101
- @@caches if defined?(@@caches)
100
+ defined?(@@caches) ? @@caches : []
102
101
  end
103
102
  def self.key
104
103
  Digest::SHA256.hexdigest("--#{Time.now}--#{rand}--")
@@ -12,7 +12,7 @@ module BackgroundCache
12
12
  end
13
13
 
14
14
  def self.cache!(group=nil)
15
- instance = boot
15
+ instance = self.boot
16
16
  caches = BackgroundCache::Config.caches
17
17
  caches.each do |cache|
18
18
  next if group && cache[:group] != group
@@ -23,7 +23,7 @@ module BackgroundCache
23
23
  end
24
24
 
25
25
  def self.manual(url)
26
- instance = boot
26
+ instance = self.boot
27
27
  BackgroundCache::Config.manual = true
28
28
  url = instance.url_for(url.merge(:only_path => true)) if url.respond_to?(:keys)
29
29
  instance.get(url)
data/require.rb CHANGED
@@ -18,7 +18,7 @@ Require do
18
18
  name 'background_cache'
19
19
  homepage "http://github.com/winton/#{name}"
20
20
  summary "Bust caches before your users do"
21
- version '0.1.2'
21
+ version '0.1.3'
22
22
  end
23
23
 
24
24
  bin { require 'lib/background_cache' }
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: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Winton Welsh
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-14 00:00:00 -07:00
18
+ date: 2010-09-15 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency