background_cache 0.2.1 → 0.2.3

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.1'
9
+ s.version = '0.2.3'
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = [ "Winton Welsh" ]
12
12
  s.email = [ "mail@wintoni.us" ]
@@ -31,6 +31,7 @@ module BackgroundCache
31
31
  while true
32
32
  request = redis.lpop('background_cache:request')
33
33
  if request
34
+ puts request.inspect
34
35
  Timeout.timeout(60) do
35
36
  request = Yajl::Parser.parse(request)
36
37
  channel = request.delete('channel')
@@ -18,10 +18,18 @@ require 'background_cache/mem_cache'
18
18
  module BackgroundCache
19
19
 
20
20
  class AppInstance
21
- include ActionController::UrlWriter
21
+ if defined?(ActionDispatch::Routing::UrlFor)
22
+ include ActionDispatch::Routing::UrlFor
23
+ elsif defined?(ActionController::UrlWriter)
24
+ include ActionController::UrlWriter
25
+ end
22
26
  include Rack::Test::Methods
23
27
  def app
24
- ActionController::Dispatcher.new
28
+ if defined?(Rails::Application)
29
+ Rails::Application.subclasses.first
30
+ elsif defined?(ActionController::Dispatcher)
31
+ ActionController::Dispatcher.new
32
+ end
25
33
  end
26
34
  end
27
35
 
@@ -42,6 +50,7 @@ module BackgroundCache
42
50
  end
43
51
 
44
52
  def self.manual(cache, instance=nil)
53
+ ENV['BACKGROUND_CACHE'] = '1'
45
54
  unless instance
46
55
  instance = self.boot
47
56
  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: 21
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 3
10
+ version: 0.2.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: 2011-10-24 00:00:00 Z
18
+ date: 2011-10-25 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails