after_response 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "after_response"
3
- s.version = "0.9.1"
3
+ s.version = "0.9.2"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.summary = "Provides hooks to execute callbacks after the response has been delivered to the client."
6
6
 
@@ -17,16 +17,18 @@ module AfterResponse
17
17
  ),
18
18
  OpenStruct.new(
19
19
  :name => :unicorn_middleware,
20
- :test => lambda{ defined?(Unicorn) },
21
- :lib => 'after_response/adapters/unicorn_middleware'
20
+ # TODO: Find a more general non-Rails-specific way of inspecting installed middleware
21
+ :test => lambda{
22
+ defined?(Unicorn) &&
23
+ defined?(Rails) &&
24
+ ActionController::Dispatcher.middleware.active.detect{|m| m == AfterResponse::Adapters::UnicornMiddleware }
25
+ }
22
26
  ),
23
- # FIXME: Find a better way to inspect the installed Rack middleware for the above and fallback
24
- # to monkeypatch if middleware isn't installed.
25
- # OpenStruct.new(
26
- # :name => :unicorn_monkeypatch,
27
- # :test => lambda{ defined?(Unicorn) },
28
- # :lib => 'after_response/adapters/unicorn_monkeypatch'
29
- # )
27
+ OpenStruct.new(
28
+ :name => :unicorn_monkeypatch,
29
+ :test => lambda{ defined?(Unicorn) },
30
+ :lib => 'after_response/adapters/unicorn_monkeypatch'
31
+ )
30
32
  ]
31
33
 
32
34
  def self.attach_to_current_container!
@@ -52,7 +54,7 @@ module AfterResponse
52
54
  # where an after_response callback hook was installed and if an after_response callback
53
55
  # was installed that calls Starboard::EventQueue.flush!
54
56
  def self.bufferable?
55
- current_container
57
+ @after_response_attached
56
58
  end
57
59
 
58
60
  def self.logger
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: after_response
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 63
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 1
10
- version: 0.9.1
9
+ - 2
10
+ version: 0.9.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kevin E. Hunt
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-16 00:00:00 -08:00
18
+ date: 2010-12-27 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21