background_cache 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/background_cache/config.rb +2 -3
- data/lib/background_cache.rb +2 -2
- data/require.rb +1 -1
- metadata +4 -4
@@ -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
|
-
|
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
|
100
|
+
defined?(@@caches) ? @@caches : []
|
102
101
|
end
|
103
102
|
def self.key
|
104
103
|
Digest::SHA256.hexdigest("--#{Time.now}--#{rand}--")
|
data/lib/background_cache.rb
CHANGED
@@ -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
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: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
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-
|
18
|
+
date: 2010-09-15 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|