bullet 7.0.1 → 7.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +18 -15
- data/lib/bullet/bullet_xhr.js +3 -3
- data/lib/bullet/rack.rb +1 -1
- data/lib/bullet/version.rb +1 -1
- data/lib/generators/bullet/install_generator.rb +0 -1
- data/spec/bullet/notification/base_spec.rb +4 -4
- data/spec/bullet/rack_spec.rb +0 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9190b7377e0184967fec123b7926cc2287755989ceea1a4c90a949721d29f411
|
4
|
+
data.tar.gz: 9ae038298d2367a5862eeb6480565f9ac9d104887b97f417e390266e0bfbdb8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b8679cc1801319b7527c472be94d75a5df7a3e03a16f2ef444d3708de584f1f8985ceedd079c35c43cc9ffb39ee5a1664b5c12d38d3d194a686692495873612
|
7
|
+
data.tar.gz: 6309d7925415f5a6339ab4e180a6ef0cd3d27c3308f3a39f6bbfa120c4cb0825f6c2728365942f71e810cb967504b72ad6fa2893334adb4ce6597299cbc4abbd
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -49,7 +49,7 @@ mongoid.
|
|
49
49
|
|
50
50
|
## Configuration
|
51
51
|
|
52
|
-
Bullet won't
|
52
|
+
Bullet won't enable any notification systems unless you tell it to explicitly. Append to
|
53
53
|
`config/environments/development.rb` initializer with the following code:
|
54
54
|
|
55
55
|
```ruby
|
@@ -59,7 +59,6 @@ config.after_initialize do
|
|
59
59
|
Bullet.alert = true
|
60
60
|
Bullet.bullet_logger = true
|
61
61
|
Bullet.console = true
|
62
|
-
Bullet.growl = true
|
63
62
|
Bullet.xmpp = { :account => 'bullets_account@jabber.org',
|
64
63
|
:password => 'bullets_password_for_jabber',
|
65
64
|
:receiver => 'your_account@jabber.org',
|
@@ -85,7 +84,6 @@ The code above will enable all of the Bullet notification systems:
|
|
85
84
|
* `Bullet.alert`: pop up a JavaScript alert in the browser
|
86
85
|
* `Bullet.bullet_logger`: log to the Bullet log file (Rails.root/log/bullet.log)
|
87
86
|
* `Bullet.console`: log warnings to your browser's console.log (Safari/Webkit browsers or Firefox w/Firebug installed)
|
88
|
-
* `Bullet.growl`: pop up Growl warnings if your system has Growl installed. Requires a little bit of configuration
|
89
87
|
* `Bullet.xmpp`: send XMPP/Jabber notifications to the receiver indicated. Note that the code will currently not handle the adding of contacts, so you will need to make both accounts indicated know each other manually before you will receive any notifications. If you restart the development server frequently, the 'coming online' sound for the Bullet account may start to annoy - in this case set :show_online_status to false; you will still get notifications, but the Bullet account won't announce it's online status anymore.
|
90
88
|
* `Bullet.rails_logger`: add warnings directly to the Rails log
|
91
89
|
* `Bullet.honeybadger`: add notifications to Honeybadger
|
@@ -156,25 +154,26 @@ The Bullet log `log/bullet.log` will look something like this:
|
|
156
154
|
* N+1 Query:
|
157
155
|
|
158
156
|
```
|
159
|
-
2009-08-25 20:40:17[INFO]
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
/Users/richard/Downloads/test/app/views/posts/index.html.erb:8:in `each'
|
164
|
-
/Users/richard/Downloads/test/app/
|
165
|
-
/Users/richard/Downloads/test/app/controllers/posts_controller.rb:7:in `index'
|
157
|
+
2009-08-25 20:40:17[INFO] USE eager loading detected:
|
158
|
+
Post => [:comments]·
|
159
|
+
Add to your query: .includes([:comments])
|
160
|
+
2009-08-25 20:40:17[INFO] Call stack
|
161
|
+
/Users/richard/Downloads/test/app/views/posts/index.html.erb:8:in `each'
|
162
|
+
/Users/richard/Downloads/test/app/controllers/posts_controller.rb:7:in `index'
|
166
163
|
```
|
167
164
|
|
168
|
-
The first
|
165
|
+
The first log entry is a notification that N+1 queries have been encountered. The remaining entry is a stack trace so you can find exactly where the queries were invoked in your code, and fix them.
|
169
166
|
|
170
167
|
* Unused eager loading:
|
171
168
|
|
172
169
|
```
|
173
|
-
2009-08-25 20:53:56[INFO]
|
174
|
-
|
170
|
+
2009-08-25 20:53:56[INFO] AVOID eager loading detected
|
171
|
+
Post => [:comments]·
|
172
|
+
Remove from your query: .includes([:comments])
|
173
|
+
2009-08-25 20:53:56[INFO] Call stack
|
175
174
|
```
|
176
175
|
|
177
|
-
These
|
176
|
+
These lines are notifications that unused eager loadings have been encountered.
|
178
177
|
|
179
178
|
* Need counter cache:
|
180
179
|
|
@@ -183,10 +182,14 @@ These two lines are notifications that unused eager loadings have been encounter
|
|
183
182
|
Post => [:comments]
|
184
183
|
```
|
185
184
|
|
186
|
-
##
|
185
|
+
## XMPP/Jabber and Airbrake Support
|
187
186
|
|
188
187
|
see [https://github.com/flyerhzm/uniform_notifier](https://github.com/flyerhzm/uniform_notifier)
|
189
188
|
|
189
|
+
## Growl Support
|
190
|
+
|
191
|
+
Growl support is dropped from uniform_notifier 1.16.0, if you still want it, please use uniform_notifier 1.15.0.
|
192
|
+
|
190
193
|
## Important
|
191
194
|
|
192
195
|
If you find Bullet does not work for you, *please disable your browser's cache*.
|
data/lib/bullet/bullet_xhr.js
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
if (this.onload) {
|
21
21
|
this._storedOnload = this.onload;
|
22
22
|
}
|
23
|
-
this.onload = null
|
23
|
+
this.onload = null;
|
24
24
|
this.addEventListener("load", bulletXHROnload);
|
25
25
|
return Reflect.apply(oldSend, this, arguments);
|
26
26
|
}
|
@@ -31,7 +31,7 @@
|
|
31
31
|
) {
|
32
32
|
var bulletFooterText = this.getResponseHeader("X-bullet-footer-text");
|
33
33
|
if (bulletFooterText) {
|
34
|
-
setTimeout(function() {
|
34
|
+
setTimeout(function () {
|
35
35
|
var oldHtml = document.querySelector("#bullet-footer").innerHTML.split("<br>");
|
36
36
|
var header = oldHtml[0];
|
37
37
|
oldHtml = oldHtml.slice(1, oldHtml.length);
|
@@ -42,7 +42,7 @@
|
|
42
42
|
}
|
43
43
|
var bulletConsoleText = this.getResponseHeader("X-bullet-console-text");
|
44
44
|
if (bulletConsoleText && typeof console !== "undefined" && console.log) {
|
45
|
-
setTimeout(function() {
|
45
|
+
setTimeout(function () {
|
46
46
|
JSON.parse(bulletConsoleText).forEach((message) => {
|
47
47
|
if (console.groupCollapsed && console.groupEnd) {
|
48
48
|
console.groupCollapsed("Uniform Notifier");
|
data/lib/bullet/rack.rb
CHANGED
data/lib/bullet/version.rb
CHANGED
@@ -74,8 +74,8 @@ module Bullet
|
|
74
74
|
it 'should send full_notice to notifier' do
|
75
75
|
notifier = double
|
76
76
|
allow(subject).to receive(:notifier).and_return(notifier)
|
77
|
-
allow(subject).to receive(:notification_data).and_return(foo: :bar)
|
78
|
-
expect(notifier).to receive(:inline_notify).with(foo: :bar)
|
77
|
+
allow(subject).to receive(:notification_data).and_return({ foo: :bar })
|
78
|
+
expect(notifier).to receive(:inline_notify).with({ foo: :bar })
|
79
79
|
subject.notify_inline
|
80
80
|
end
|
81
81
|
end
|
@@ -84,8 +84,8 @@ module Bullet
|
|
84
84
|
it 'should send full_out_of_channel to notifier' do
|
85
85
|
notifier = double
|
86
86
|
allow(subject).to receive(:notifier).and_return(notifier)
|
87
|
-
allow(subject).to receive(:notification_data).and_return(foo: :bar)
|
88
|
-
expect(notifier).to receive(:out_of_channel_notify).with(foo: :bar)
|
87
|
+
allow(subject).to receive(:notification_data).and_return({ foo: :bar })
|
88
|
+
expect(notifier).to receive(:out_of_channel_notify).with({ foo: :bar })
|
89
89
|
subject.notify_out_of_channel
|
90
90
|
end
|
91
91
|
end
|
data/spec/bullet/rack_spec.rb
CHANGED
@@ -31,12 +31,6 @@ module Bullet
|
|
31
31
|
response = double(body: '<html><head></head><body></body></html>')
|
32
32
|
expect(middleware).not_to be_html_request(headers, response)
|
33
33
|
end
|
34
|
-
|
35
|
-
it "should be false if response body doesn't contain html tag" do
|
36
|
-
headers = { 'Content-Type' => 'text/html' }
|
37
|
-
response = double(body: '<div>Partial</div>')
|
38
|
-
expect(middleware).not_to be_html_request(headers, response)
|
39
|
-
end
|
40
34
|
end
|
41
35
|
|
42
36
|
context 'empty?' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
195
|
- !ruby/object:Gem::Version
|
196
196
|
version: 1.3.6
|
197
197
|
requirements: []
|
198
|
-
rubygems_version: 3.
|
198
|
+
rubygems_version: 3.3.7
|
199
199
|
signing_key:
|
200
200
|
specification_version: 4
|
201
201
|
summary: help to kill N+1 queries and unused eager loading.
|