flyerhzm-bullet 1.5.4 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +8 -0
- data/VERSION +1 -1
- data/bullet.gemspec +2 -2
- data/lib/bullet.rb +1 -1
- data/lib/bulletware.rb +7 -0
- metadata +4 -3
data/README.textile
CHANGED
@@ -8,6 +8,12 @@ This plugin/gem uses <code>ActionController::Dispatcher.middleware</code> which
|
|
8
8
|
|
9
9
|
****************************************************************************
|
10
10
|
|
11
|
+
h2. Change
|
12
|
+
|
13
|
+
There is a large refactor from gem 1.4 to 1.5, so if you upgrade to 1.5 gem, please read the Configuration section again and rewrite your configuration.
|
14
|
+
|
15
|
+
****************************************************************************
|
16
|
+
|
11
17
|
h2. Thanks
|
12
18
|
|
13
19
|
flipsasser added Growl, console.log and Rails.log support, very awesome. And he improved README.
|
@@ -39,6 +45,7 @@ config.after_initialize do
|
|
39
45
|
Bullet.console = true
|
40
46
|
Bullet.growl = true
|
41
47
|
Bullet.rails_logger = true
|
48
|
+
Bullet.disable_browser_cache = true
|
42
49
|
end
|
43
50
|
</code></pre>
|
44
51
|
|
@@ -58,6 +65,7 @@ The code above will enable all five of the Bullet notification systems:
|
|
58
65
|
* <code>Bullet.rails_logger</code>: add warnings directly to the Rails log
|
59
66
|
* <code>Bullet.console</code>: log warnings to your browser's console.log (Safari/Webkit browsers or Firefox w/Firebug installed)
|
60
67
|
* <code>Bullet.growl</code>: pop up Growl warnings if your system has Growl installed. Requires a little bit of configuration
|
68
|
+
* <code>Bullet.disable_browser_cache</code>: disable browser cache which usually causes unexpected problems
|
61
69
|
|
62
70
|
****************************************************************************
|
63
71
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.5
|
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.
|
8
|
+
s.version = "1.5.5"
|
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-
|
12
|
+
s.date = %q{2009-09-15}
|
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/bullet.rb
CHANGED
@@ -8,7 +8,7 @@ module Bullet
|
|
8
8
|
autoload :Notification, 'bullet/notification'
|
9
9
|
|
10
10
|
class <<self
|
11
|
-
attr_accessor :enable, :alert, :console, :growl, :growl_password, :rails_logger, :bullet_logger, :logger, :logger_file
|
11
|
+
attr_accessor :enable, :alert, :console, :growl, :growl_password, :rails_logger, :bullet_logger, :logger, :logger_file, :disable_browser_cache
|
12
12
|
|
13
13
|
def enable=(enable)
|
14
14
|
@enable = enable
|
data/lib/bulletware.rb
CHANGED
@@ -21,10 +21,17 @@ class Bulletware
|
|
21
21
|
end
|
22
22
|
response_body ||= response.body
|
23
23
|
Bullet.end_request
|
24
|
+
no_browser_cache(headers) if Bullet.disable_browser_cache
|
24
25
|
[status, headers, response_body]
|
25
26
|
end
|
26
27
|
|
27
28
|
def check_html?(headers, response)
|
28
29
|
!headers['Content-Type'].nil? and headers['Content-Type'].include? 'text/html' and response.body =~ %r{<html.*</html>}m
|
29
30
|
end
|
31
|
+
|
32
|
+
def no_browser_cache(headers)
|
33
|
+
headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
|
34
|
+
headers["Pragma"] = "no-cache"
|
35
|
+
headers["Expires"] = "Wed, 09 Sep 2009 09:09:09 GMT"
|
36
|
+
end
|
30
37
|
end
|
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.
|
4
|
+
version: 1.5.5
|
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-
|
12
|
+
date: 2009-09-15 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- tasks/bullet_tasks.rake
|
43
43
|
has_rdoc: false
|
44
44
|
homepage: http://github.com/flyerhzm/bullet
|
45
|
+
licenses:
|
45
46
|
post_install_message:
|
46
47
|
rdoc_options:
|
47
48
|
- --charset=UTF-8
|
@@ -62,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
63
|
requirements: []
|
63
64
|
|
64
65
|
rubyforge_project:
|
65
|
-
rubygems_version: 1.
|
66
|
+
rubygems_version: 1.3.5
|
66
67
|
signing_key:
|
67
68
|
specification_version: 3
|
68
69
|
summary: A plugin to kill N+1 queries and unused eager loading
|