flyerhzm-bullet 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +21 -3
- data/VERSION +1 -1
- data/bullet.gemspec +4 -4
- data/lib/bullet.rb +1 -1
- metadata +2 -2
data/README.textile
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
h1. Bullet
|
2
2
|
|
3
|
-
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), when you're using eager loading that isn't necessary and when you should use counter cache.
|
3
|
+
The Bullet plugin/gem 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), when you're using eager loading that isn't necessary and when you should use counter cache.
|
4
4
|
|
5
5
|
Best practice is to use Bullet in development mode or custom mode (staging, profile, etc.). The last thing you want is your clients getting alerts about how lazy you are.
|
6
6
|
|
7
|
+
This plugin/gem uses <code>ActionController::Dispatcher.middleware</code> which is introduce by rails 2.3.
|
8
|
+
|
7
9
|
****************************************************************************
|
8
10
|
|
9
11
|
h2. Thanks
|
@@ -50,7 +52,7 @@ It is recommended to config growl notification as follows if your collaborators
|
|
50
52
|
</code></pre>
|
51
53
|
|
52
54
|
The code above will enable all five of the Bullet notification systems:
|
53
|
-
* <code>Bullet.enable</code>: enable Bullet plugin, otherwise do nothing
|
55
|
+
* <code>Bullet.enable</code>: enable Bullet plugin/gem, otherwise do nothing
|
54
56
|
* <code>Bullet.alert</code>: pop up a JavaScript alert in the browser
|
55
57
|
* <code>Bullet.bullet_logger</code>: log to the Bullet log file (RAILS_ROOT/log/bullet.log)
|
56
58
|
* <code>Bullet.rails_logger</code>: add warnings directly to the Rails log
|
@@ -124,7 +126,7 @@ Or any strange behavior of bullet plugin/gem, *please disable your browser's cac
|
|
124
126
|
|
125
127
|
h2. Advance
|
126
128
|
|
127
|
-
The bullet plugin use rack middleware for http request. If you want to bullet for without http server, such as job server. You can do like this:
|
129
|
+
The bullet plugin/gem use rack middleware for http request. If you want to bullet for without http server, such as job server. You can do like this:
|
128
130
|
|
129
131
|
<pre><code>
|
130
132
|
Bullet.start_request if Bullet.enable?
|
@@ -136,6 +138,22 @@ if Bullet.enable?
|
|
136
138
|
end
|
137
139
|
</code></pre>
|
138
140
|
|
141
|
+
Or you want to use it in test mode
|
142
|
+
|
143
|
+
<pre><code>
|
144
|
+
before(:each)
|
145
|
+
Bullet.start_request if Bullet.enable?
|
146
|
+
end
|
147
|
+
|
148
|
+
after(:each)
|
149
|
+
if Bullet.enable?
|
150
|
+
Bullet.growl_notification
|
151
|
+
Bullet.log_notification('Test: ')
|
152
|
+
Bullet.end_request
|
153
|
+
end
|
154
|
+
end
|
155
|
+
</code></pre>
|
156
|
+
|
139
157
|
****************************************************************************
|
140
158
|
|
141
159
|
h2. Step by step example
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.1
|
data/bullet.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
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.1"
|
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"]
|
@@ -41,9 +41,9 @@ Gem::Specification.new do |s|
|
|
41
41
|
s.rubygems_version = %q{1.3.5}
|
42
42
|
s.summary = %q{A plugin to kill N+1 queries and unused eager loading}
|
43
43
|
s.test_files = [
|
44
|
-
"spec/
|
45
|
-
"spec/
|
46
|
-
"spec/
|
44
|
+
"spec/bullet_association_spec.rb",
|
45
|
+
"spec/bullet_counter_spec.rb",
|
46
|
+
"spec/spec_helper.rb"
|
47
47
|
]
|
48
48
|
|
49
49
|
if s.respond_to? :specification_version then
|
data/lib/bullet.rb
CHANGED
@@ -20,7 +20,7 @@ module Bullet
|
|
20
20
|
if growl
|
21
21
|
begin
|
22
22
|
require 'ruby-growl'
|
23
|
-
growl = Growl.new('localhost', 'ruby-growl', ['Bullet Notification'], nil,
|
23
|
+
growl = Growl.new('localhost', 'ruby-growl', ['Bullet Notification'], nil, @growl_password)
|
24
24
|
growl.notify('Bullet Notification', 'Bullet Notification', 'Bullet Growl notifications have been turned on')
|
25
25
|
rescue MissingSourceFile
|
26
26
|
raise NotificationError.new('You must install the ruby-growl gem to use Growl notifications: `sudo gem install ruby-growl`')
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
@@ -67,6 +67,6 @@ signing_key:
|
|
67
67
|
specification_version: 3
|
68
68
|
summary: A plugin to kill N+1 queries and unused eager loading
|
69
69
|
test_files:
|
70
|
+
- spec/bullet_association_spec.rb
|
70
71
|
- spec/bullet_counter_spec.rb
|
71
72
|
- spec/spec_helper.rb
|
72
|
-
- spec/bullet_association_spec.rb
|