flyerhzm-bullet 1.5.9 → 1.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bullet.gemspec +2 -2
  3. data/lib/bulletware.rb +6 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.9
1
+ 1.5.10
data/bullet.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bullet}
8
- s.version = "1.5.9"
8
+ s.version = "1.5.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Richard Huang"]
12
- s.date = %q{2009-09-24}
12
+ s.date = %q{2009-09-25}
13
13
  s.description = %q{The Bullet plugin is designed to help you increase your application's performance by reducing the number of queries it makes. It will watch your queries while you develop your application and notify you when you should add eager loading (N+1 queries) or when you're using eager loading that isn't necessary.}
14
14
  s.email = %q{flyerhzm@gmail.com}
15
15
  s.extra_rdoc_files = [
data/lib/bulletware.rb CHANGED
@@ -8,7 +8,7 @@ class Bulletware
8
8
 
9
9
  Bullet.start_request
10
10
  status, headers, response = @app.call(env)
11
- return [status, headers, response] if response.empty?
11
+ return [status, headers, response] if empty?(response)
12
12
 
13
13
  if Bullet.notification?
14
14
  if check_html?(headers, response)
@@ -24,6 +24,11 @@ class Bulletware
24
24
  no_browser_cache(headers) if Bullet.disable_browser_cache
25
25
  [status, headers, response_body]
26
26
  end
27
+
28
+ # fix issue if response's body is a Proc
29
+ def empty?(response)
30
+ (response.is_a?(Array) && response.empty?) || !response.body.is_a?(String) || response.body.empty?
31
+ end
27
32
 
28
33
  def check_html?(headers, response)
29
34
  !headers['Content-Type'].nil? and headers['Content-Type'].include? 'text/html' and response.body =~ %r{<html.*</html>}m
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flyerhzm-bullet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.9
4
+ version: 1.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-24 00:00:00 -07:00
12
+ date: 2009-09-25 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15