bullet 4.7.1 → 4.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +17 -17
- data/CHANGELOG.md +15 -0
- data/Gemfile +9 -2
- data/Gemfile.mongoid-2.4 +22 -0
- data/Gemfile.mongoid-2.5 +22 -0
- data/Gemfile.mongoid-2.6 +22 -0
- data/Gemfile.mongoid-2.7 +22 -0
- data/Gemfile.mongoid-2.8 +22 -0
- data/Gemfile.mongoid-3.0 +22 -0
- data/Gemfile.mongoid-3.1 +22 -0
- data/Gemfile.rails-3.0 +21 -0
- data/Gemfile.rails-3.1 +21 -0
- data/Gemfile.rails-3.2 +21 -0
- data/Gemfile.rails-4.0 +21 -0
- data/{Gemfile.rails-3.0.20 → Gemfile.rails-4.1} +1 -1
- data/README.md +24 -23
- data/Rakefile +13 -6
- data/lib/bullet.rb +1 -1
- data/lib/bullet/active_record41.rb +97 -0
- data/lib/bullet/dependency.rb +11 -1
- data/lib/bullet/mongoid4x.rb +1 -1
- data/lib/bullet/registry/base.rb +1 -1
- data/lib/bullet/version.rb +1 -1
- data/spec/bullet/detector/association_spec.rb +8 -8
- data/spec/bullet/detector/base_spec.rb +1 -1
- data/spec/bullet/detector/counter_cache_spec.rb +12 -12
- data/spec/bullet/detector/n_plus_one_query_spec.rb +32 -32
- data/spec/bullet/detector/unused_eager_loading_spec.rb +18 -18
- data/spec/bullet/ext/object_spec.rb +2 -2
- data/spec/bullet/ext/string_spec.rb +2 -2
- data/spec/bullet/notification/base_spec.rb +19 -13
- data/spec/bullet/notification/counter_cache_spec.rb +2 -2
- data/spec/bullet/notification/n_plus_one_query_spec.rb +3 -3
- data/spec/bullet/notification/unused_eager_loading_spec.rb +2 -2
- data/spec/bullet/notification_collector_spec.rb +4 -4
- data/spec/bullet/rack_spec.rb +21 -21
- data/spec/bullet/registry/association_spec.rb +3 -3
- data/spec/bullet/registry/base_spec.rb +6 -6
- data/spec/bullet/registry/object_spec.rb +2 -2
- data/spec/integration/active_record3/association_spec.rb +107 -107
- data/spec/integration/active_record4/association_spec.rb +105 -105
- data/spec/integration/counter_cache_spec.rb +4 -4
- data/spec/integration/mongoid/association_spec.rb +52 -52
- data/spec/spec_helper.rb +0 -1
- data/test.sh +12 -11
- metadata +25 -38
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/Gemfile.lock +0 -160
- data/Gemfile.mongoid-2.4.12 +0 -15
- data/Gemfile.mongoid-2.4.12.lock +0 -163
- data/Gemfile.mongoid-2.5.2 +0 -15
- data/Gemfile.mongoid-2.5.2.lock +0 -163
- data/Gemfile.mongoid-2.6.0 +0 -15
- data/Gemfile.mongoid-2.6.0.lock +0 -163
- data/Gemfile.mongoid-2.7.1 +0 -15
- data/Gemfile.mongoid-2.7.1.lock +0 -163
- data/Gemfile.mongoid-2.8.1 +0 -15
- data/Gemfile.mongoid-2.8.1.lock +0 -166
- data/Gemfile.mongoid-3.0.23 +0 -15
- data/Gemfile.mongoid-3.0.23.lock +0 -163
- data/Gemfile.mongoid-3.1.5 +0 -15
- data/Gemfile.mongoid-3.1.5.lock +0 -163
- data/Gemfile.mongoid.lock +0 -167
- data/Gemfile.rails-3.0.20.lock +0 -147
- data/Gemfile.rails-3.1.12 +0 -14
- data/Gemfile.rails-3.1.12.lock +0 -157
- data/Gemfile.rails-3.2.15 +0 -14
- data/Gemfile.rails-3.2.15.lock +0 -155
- data/Gemfile.rails-4.0.1 +0 -14
- data/Gemfile.rails-4.0.1.lock +0 -150
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ebb362baca8a029544d754fed872a09f7033377
|
4
|
+
data.tar.gz: f12124695713d21526305a4c381160048cdc93d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aac621e2ddb3931bb385017401121641027980ebddf0d82d1b43c9a71040a7c2eba3af2c4cb7862d69f9c31c99ac1e124f6a60bd9be6e8388199c187effc98f
|
7
|
+
data.tar.gz: 721e946c60ebc8de7bd6c609abb90a9fd29c5c4df2ac275b8bb607e64cffcd86887fa7fc0c82fdd86303faf77d251519b49314dc9af1032131af039b9fd5f868
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
3
|
+
- 2.1.0
|
4
4
|
gemfile:
|
5
|
-
- Gemfile.rails-4.
|
6
|
-
- Gemfile.rails-
|
7
|
-
- Gemfile.rails-3.
|
8
|
-
- Gemfile.rails-3.
|
9
|
-
- Gemfile.
|
10
|
-
- Gemfile.mongoid-3.
|
11
|
-
- Gemfile.mongoid-
|
12
|
-
- Gemfile.mongoid-2.8
|
13
|
-
- Gemfile.mongoid-2.
|
14
|
-
- Gemfile.mongoid-2.
|
15
|
-
- Gemfile.mongoid-2.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
-
|
5
|
+
- Gemfile.rails-4.1
|
6
|
+
- Gemfile.rails-4.0
|
7
|
+
- Gemfile.rails-3.2
|
8
|
+
- Gemfile.rails-3.1
|
9
|
+
- Gemfile.rails-3.0
|
10
|
+
- Gemfile.mongoid-3.1
|
11
|
+
- Gemfile.mongoid-3.0
|
12
|
+
- Gemfile.mongoid-2.8
|
13
|
+
- Gemfile.mongoid-2.7
|
14
|
+
- Gemfile.mongoid-2.6
|
15
|
+
- Gemfile.mongoid-2.5
|
16
|
+
- Gemfile.mongoid-2.4
|
17
|
+
env:
|
18
|
+
- DB=sqlite
|
19
|
+
services:
|
20
|
+
- mongodb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Next Release
|
2
2
|
|
3
|
+
## 4.8.0 (02/16/2014)
|
4
|
+
|
5
|
+
* Support rails 4.1.0.beta1
|
6
|
+
* Update specs to be RSepc 3.0 compatible
|
7
|
+
* Update latest minor version activerecord and mongoid on travis
|
8
|
+
|
9
|
+
## 4.7.0 (11/03/2013)
|
10
|
+
|
11
|
+
* Add coverall support
|
12
|
+
* Add helper to profile code outside a request
|
13
|
+
* Add activesupport dependency
|
14
|
+
* Add Bullet.raise notification
|
15
|
+
* Add Bullet.add_footer notification
|
16
|
+
* Fix activerecord4 warnings in test code
|
17
|
+
|
3
18
|
## 4.6.0 (04/18/2013)
|
4
19
|
|
5
20
|
* Fix Bullet::Rack to support sinatra
|
data/Gemfile
CHANGED
@@ -3,8 +3,10 @@ source "https://rubygems.org"
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
gem 'rails', github: 'rails/rails'
|
6
|
-
gem 'sqlite3'
|
7
|
-
gem '
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
8
10
|
gem 'activerecord-import'
|
9
11
|
|
10
12
|
gem "rspec"
|
@@ -12,3 +14,8 @@ gem "guard"
|
|
12
14
|
gem "guard-rspec"
|
13
15
|
|
14
16
|
gem 'coveralls', require: false
|
17
|
+
|
18
|
+
platforms :rbx do
|
19
|
+
gem 'rubysl', '~> 2.0'
|
20
|
+
gem 'rubinius-developer_tools'
|
21
|
+
end
|
data/Gemfile.mongoid-2.4
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.2.16'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
gem 'mongoid', '~> 2.4.12'
|
12
|
+
|
13
|
+
gem "rspec"
|
14
|
+
gem "guard"
|
15
|
+
gem "guard-rspec"
|
16
|
+
|
17
|
+
gem 'coveralls', require: false
|
18
|
+
|
19
|
+
platforms :rbx do
|
20
|
+
gem 'rubysl', '~> 2.0'
|
21
|
+
gem 'rubinius-developer_tools'
|
22
|
+
end
|
data/Gemfile.mongoid-2.5
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.2.16'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
gem 'mongoid', '~> 2.5.2'
|
12
|
+
|
13
|
+
gem "rspec"
|
14
|
+
gem "guard"
|
15
|
+
gem "guard-rspec"
|
16
|
+
|
17
|
+
gem 'coveralls', require: false
|
18
|
+
|
19
|
+
platforms :rbx do
|
20
|
+
gem 'rubysl', '~> 2.0'
|
21
|
+
gem 'rubinius-developer_tools'
|
22
|
+
end
|
data/Gemfile.mongoid-2.6
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.2.16'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
gem 'mongoid', '~> 2.6.0'
|
12
|
+
|
13
|
+
gem "rspec"
|
14
|
+
gem "guard"
|
15
|
+
gem "guard-rspec"
|
16
|
+
|
17
|
+
gem 'coveralls', require: false
|
18
|
+
|
19
|
+
platforms :rbx do
|
20
|
+
gem 'rubysl', '~> 2.0'
|
21
|
+
gem 'rubinius-developer_tools'
|
22
|
+
end
|
data/Gemfile.mongoid-2.7
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.2.16'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
gem 'mongoid', '~> 2.7.1'
|
12
|
+
|
13
|
+
gem "rspec"
|
14
|
+
gem "guard"
|
15
|
+
gem "guard-rspec"
|
16
|
+
|
17
|
+
gem 'coveralls', require: false
|
18
|
+
|
19
|
+
platforms :rbx do
|
20
|
+
gem 'rubysl', '~> 2.0'
|
21
|
+
gem 'rubinius-developer_tools'
|
22
|
+
end
|
data/Gemfile.mongoid-2.8
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.2'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
gem 'mongoid', '~> 2.8'
|
12
|
+
|
13
|
+
gem "rspec"
|
14
|
+
gem "guard"
|
15
|
+
gem "guard-rspec"
|
16
|
+
|
17
|
+
gem 'coveralls', require: false
|
18
|
+
|
19
|
+
platforms :rbx do
|
20
|
+
gem 'rubysl', '~> 2.0'
|
21
|
+
gem 'rubinius-developer_tools'
|
22
|
+
end
|
data/Gemfile.mongoid-3.0
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.2.16'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
gem 'mongoid', '~> 3.0.23'
|
12
|
+
|
13
|
+
gem "rspec"
|
14
|
+
gem "guard"
|
15
|
+
gem "guard-rspec"
|
16
|
+
|
17
|
+
gem 'coveralls', require: false
|
18
|
+
|
19
|
+
platforms :rbx do
|
20
|
+
gem 'rubysl', '~> 2.0'
|
21
|
+
gem 'rubinius-developer_tools'
|
22
|
+
end
|
data/Gemfile.mongoid-3.1
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.2.16'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
gem 'mongoid', '~> 3.1.6'
|
12
|
+
|
13
|
+
gem "rspec"
|
14
|
+
gem "guard"
|
15
|
+
gem "guard-rspec"
|
16
|
+
|
17
|
+
gem 'coveralls', require: false
|
18
|
+
|
19
|
+
platforms :rbx do
|
20
|
+
gem 'rubysl', '~> 2.0'
|
21
|
+
gem 'rubinius-developer_tools'
|
22
|
+
end
|
data/Gemfile.rails-3.0
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.0.20'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
|
12
|
+
gem "rspec"
|
13
|
+
gem "guard"
|
14
|
+
gem "guard-rspec"
|
15
|
+
|
16
|
+
gem 'coveralls', require: false
|
17
|
+
|
18
|
+
platforms :rbx do
|
19
|
+
gem 'rubysl', '~> 2.0'
|
20
|
+
gem 'rubinius-developer_tools'
|
21
|
+
end
|
data/Gemfile.rails-3.1
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.1.12'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
|
12
|
+
gem "rspec"
|
13
|
+
gem "guard"
|
14
|
+
gem "guard-rspec"
|
15
|
+
|
16
|
+
gem 'coveralls', require: false
|
17
|
+
|
18
|
+
platforms :rbx do
|
19
|
+
gem 'rubysl', '~> 2.0'
|
20
|
+
gem 'rubinius-developer_tools'
|
21
|
+
end
|
data/Gemfile.rails-3.2
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.2.15'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
|
12
|
+
gem "rspec"
|
13
|
+
gem "guard"
|
14
|
+
gem "guard-rspec"
|
15
|
+
|
16
|
+
gem 'coveralls', require: false
|
17
|
+
|
18
|
+
platforms :rbx do
|
19
|
+
gem 'rubysl', '~> 2.0'
|
20
|
+
gem 'rubinius-developer_tools'
|
21
|
+
end
|
data/Gemfile.rails-4.0
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'rails', '~> 4.0.1'
|
6
|
+
gem 'sqlite3', platforms: [:ruby]
|
7
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
|
8
|
+
gem 'mysql2', platforms: [:ruby]
|
9
|
+
gem 'activerecord-jdbcmysql-adapter', platforms: [:jruby]
|
10
|
+
gem 'activerecord-import'
|
11
|
+
|
12
|
+
gem "rspec"
|
13
|
+
gem "guard"
|
14
|
+
gem "guard-rspec"
|
15
|
+
|
16
|
+
gem 'coveralls', require: false
|
17
|
+
|
18
|
+
platforms :rbx do
|
19
|
+
gem 'rubysl', '~> 2.0'
|
20
|
+
gem 'rubinius-developer_tools'
|
21
|
+
end
|
data/README.md
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/bullet.png)](http://badge.fury.io/rb/bullet)
|
4
4
|
[![Build Status](https://secure.travis-ci.org/flyerhzm/bullet.png)](http://travis-ci.org/flyerhzm/bullet)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/flyerhzm/bullet/badge.png?branch=master)](https://coveralls.io/r/flyerhzm/bullet)
|
6
|
-
|
6
|
+
<a href="https://codeclimate.com/github/flyerhzm/bullet"><img src="https://codeclimate.com/github/flyerhzm/bullet.png" /></a>
|
7
7
|
[![Coderwall Endorse](http://api.coderwall.com/flyerhzm/endorsecount.png)](http://coderwall.com/flyerhzm)
|
8
8
|
|
9
9
|
The Bullet 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.
|
10
10
|
|
11
11
|
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.
|
12
12
|
|
13
|
-
Bullet gem now supports **activerecord**
|
13
|
+
Bullet gem now supports **activerecord** >= 3.0 and **mongoid** >= 2.4.1.
|
14
14
|
|
15
15
|
If you use activercord 2.x, please use bullet <= 4.5.0
|
16
16
|
|
@@ -27,7 +27,6 @@ You can install it as a gem:
|
|
27
27
|
|
28
28
|
```
|
29
29
|
gem install bullet
|
30
|
-
|
31
30
|
```
|
32
31
|
|
33
32
|
or add it into a Gemfile (Bundler):
|
@@ -138,42 +137,44 @@ If you find bullet does not work for you, *please disable your browser's cache*.
|
|
138
137
|
|
139
138
|
## Advanced
|
140
139
|
|
141
|
-
|
140
|
+
### Profile a job
|
141
|
+
|
142
|
+
The bullet gem uses rack middleware to profile requests. If you want to use bullet without an http server, like to profile a job, you can use use profile method and fetch warnings
|
142
143
|
|
143
144
|
```ruby
|
144
145
|
Bullet.profile do
|
145
|
-
#
|
146
|
+
# do anything
|
146
147
|
end
|
148
|
+
warnings = Bullet.warnings
|
147
149
|
```
|
148
150
|
|
149
|
-
|
151
|
+
### Run in tests
|
152
|
+
|
153
|
+
First you need to enable bullet in test environment.
|
150
154
|
|
151
155
|
```ruby
|
156
|
+
# config/environments/test.rb
|
157
|
+
config.after_initialize do
|
158
|
+
Bullet.enable = true
|
159
|
+
Bullet.bullet_logger = true
|
160
|
+
Bullet.raise = true # raise an error if n+1 query occurs
|
161
|
+
end
|
162
|
+
```
|
163
|
+
|
164
|
+
Then wrap each test in bullet api.
|
165
|
+
|
166
|
+
```ruby
|
167
|
+
# spec/spec_helper.rb
|
152
168
|
before(:each) do
|
153
169
|
Bullet.start_request if Bullet.enable?
|
154
170
|
end
|
155
171
|
|
156
172
|
after(:each) do
|
157
|
-
if Bullet.enable? && Bullet.notification?
|
158
|
-
Bullet.perform_out_of_channel_notifications
|
159
|
-
end
|
173
|
+
Bullet.perform_out_of_channel_notifications if Bullet.enable? && Bullet.notification?
|
160
174
|
Bullet.end_request if Bullet.enable?
|
161
175
|
end
|
162
176
|
```
|
163
177
|
|
164
|
-
Don't forget to enable bullet in your test environment.
|
165
|
-
|
166
|
-
### API access
|
167
|
-
|
168
|
-
after `profile`, you can fetch warnings then do whatever you want
|
169
|
-
|
170
|
-
```ruby
|
171
|
-
Bullet.profile do
|
172
|
-
# run anything
|
173
|
-
end
|
174
|
-
warnings = Bullet.warnings
|
175
|
-
```
|
176
|
-
|
177
178
|
## Contributors
|
178
179
|
|
179
180
|
[https://github.com/flyerhzm/bullet/contributors](https://github.com/flyerhzm/bullet/contributors)
|
@@ -402,4 +403,4 @@ In the meanwhile, there's a log appended into `log/bullet.log` file.
|
|
402
403
|
```
|
403
404
|
|
404
405
|
|
405
|
-
Copyright (c) 2009 -
|
406
|
+
Copyright (c) 2009 - 2014 Richard Huang (flyerhzm@gmail.com), released under the MIT license
|