bullet 4.1.6 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -8,4 +8,5 @@ tags
8
8
  .bundle
9
9
  *.gem
10
10
  benchmark_profile*
11
- /nbproject/private/
11
+ /nbproject/private/
12
+ Gemfile*.lock
@@ -0,0 +1,19 @@
1
+ # Use `bundle install` in order to install these gems
2
+ # Use `bundle exec rake` in order to run the specs using the bundle
3
+ source "http://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ gem 'rails', github: 'rails/rails'
8
+ gem 'journey', github: 'rails/journey'
9
+ gem 'activerecord-deprecated_finders', github: 'rails/activerecord-deprecated_finders'
10
+ gem 'sqlite3'
11
+ gem 'mysql'
12
+ gem 'activerecord-import'
13
+ gem 'mongoid', github: 'slbug/mongoid'
14
+
15
+ gem "rspec"
16
+ gem "guard"
17
+ gem "guard-rspec"
18
+
19
+ gem "perftools.rb"
@@ -50,17 +50,19 @@ config.after_initialize do
50
50
  :receiver => 'your_account@jabber.org',
51
51
  :show_online_status => true }
52
52
  Bullet.rails_logger = true
53
+ Bullet.airbrake = true
53
54
  Bullet.disable_browser_cache = true
54
55
  end
55
56
  </code></pre>
56
57
 
57
58
  The notifier of bullet is a wrap of "uniform_notifier":https://github.com/flyerhzm/uniform_notifier
58
59
 
59
- The code above will enable all six of the Bullet notification systems:
60
+ The code above will enable all seven of the Bullet notification systems:
60
61
  * <code>Bullet.enable</code>: enable Bullet gem, otherwise do nothing
61
62
  * <code>Bullet.alert</code>: pop up a JavaScript alert in the browser
62
63
  * <code>Bullet.bullet_logger</code>: log to the Bullet log file (Rails.root/log/bullet.log)
63
64
  * <code>Bullet.rails_logger</code>: add warnings directly to the Rails log
65
+ * <code>Bullet.airbrake</code>: add notifications to airbrake
64
66
  * <code>Bullet.console</code>: log warnings to your browser's console.log (Safari/Webkit browsers or Firefox w/Firebug installed)
65
67
  * <code>Bullet.growl</code>: pop up Growl warnings if your system has Growl installed. Requires a little bit of configuration
66
68
  * <code>Bullet.xmpp</code>: 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.
@@ -101,7 +103,7 @@ These two lines are notifications that unused eager loadings have been encounter
101
103
 
102
104
  ****************************************************************************
103
105
 
104
- h2. Growl and XMPP/Jabber Support
106
+ h2. Growl, XMPP/Jabber and Airbrake Support
105
107
 
106
108
  see "https://github.com/flyerhzm/uniform_notifier":https://github.com/flyerhzm/uniform_notifier
107
109
 
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.required_rubygems_version = ">= 1.3.6"
17
17
 
18
- s.add_dependency "uniform_notifier", "~> 1.0.0"
18
+ s.add_dependency "uniform_notifier"
19
19
 
20
20
  s.files = `git ls-files`.split("\n")
21
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -33,7 +33,7 @@ module Bullet
33
33
  attr_accessor :enable, :disable_browser_cache
34
34
  attr_reader :notification_collector
35
35
 
36
- delegate :alert=, :console=, :growl=, :rails_logger=, :xmpp=, :to => UniformNotifier
36
+ delegate :alert=, :console=, :growl=, :rails_logger=, :xmpp=, :airbrake=, :to => UniformNotifier
37
37
 
38
38
  DETECTORS = [ Bullet::Detector::NPlusOneQuery,
39
39
  Bullet::Detector::UnusedEagerAssociation,
@@ -24,7 +24,7 @@ module Bullet
24
24
  'active_record2'
25
25
  elsif active_record30?
26
26
  'active_record3'
27
- elsif active_record31? || active_record32?
27
+ elsif active_record31? || active_record32? || active_record4?
28
28
  'active_record31'
29
29
  end
30
30
  end
@@ -60,6 +60,10 @@ module Bullet
60
60
  ::ActiveRecord::VERSION::MAJOR == 3
61
61
  end
62
62
 
63
+ def active_record4?
64
+ ::ActiveRecord::VERSION::MAJOR == 4
65
+ end
66
+
63
67
  def active_record30?
64
68
  active_record3? && ::ActiveRecord::VERSION::MINOR == 0
65
69
  end
@@ -19,7 +19,12 @@ module Bullet
19
19
  end
20
20
 
21
21
  def whoami
22
- "user: " << `whoami`.chomp
22
+ user = `whoami`
23
+ if user
24
+ "user: #{user.chomp}"
25
+ else
26
+ ""
27
+ end
23
28
  end
24
29
 
25
30
  def body_with_caller
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Bullet
3
- VERSION = "4.1.6"
3
+ VERSION = "4.2.0"
4
4
  end
data/test.sh CHANGED
@@ -2,3 +2,4 @@ bundle && bundle exec rspec spec
2
2
  BUNDLE_GEMFILE=Gemfile.rails-3.1.5 bundle && bundle exec rspec spec
3
3
  BUNDLE_GEMFILE=Gemfile.rails-3.0.13 bundle && bundle exec rspec spec
4
4
  BUNDLE_GEMFILE=Gemfile.rails-2.3.14 bundle && bundle exec rspec spec
5
+ BUNDLE_GEMFILE=Gemfile.rails-4-beta bundle && bundle exec rspec spec
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.6
4
+ version: 4.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,19 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-17 00:00:00.000000000 Z
12
+ date: 2012-09-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: uniform_notifier
16
- requirement: &70273215166900 !ruby/object:Gem::Requirement
16
+ requirement: &70294547787940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.0.0
21
+ version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70273215166900
24
+ version_requirements: *70294547787940
25
25
  description: A rails plugin to kill N+1 queries and unused eager loading.
26
26
  email:
27
27
  - flyerhzm@gmail.com
@@ -35,13 +35,10 @@ files:
35
35
  - .rvmrc.example
36
36
  - .travis.yml
37
37
  - Gemfile
38
- - Gemfile.lock
39
38
  - Gemfile.rails-2.3.14
40
- - Gemfile.rails-2.3.14.lock
41
39
  - Gemfile.rails-3.0.13
42
- - Gemfile.rails-3.0.13.lock
43
40
  - Gemfile.rails-3.1.5
44
- - Gemfile.rails-3.1.5.lock
41
+ - Gemfile.rails-4-beta
45
42
  - Guardfile
46
43
  - Hacking.textile
47
44
  - MIT-LICENSE
@@ -152,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
149
  version: '0'
153
150
  segments:
154
151
  - 0
155
- hash: 1116007460163165065
152
+ hash: -1372591245763188534
156
153
  required_rubygems_version: !ruby/object:Gem::Requirement
157
154
  none: false
158
155
  requirements:
@@ -1,129 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- bullet (4.1.6)
5
- uniform_notifier (~> 1.0.0)
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- actionmailer (3.2.5)
11
- actionpack (= 3.2.5)
12
- mail (~> 2.4.4)
13
- actionpack (3.2.5)
14
- activemodel (= 3.2.5)
15
- activesupport (= 3.2.5)
16
- builder (~> 3.0.0)
17
- erubis (~> 2.7.0)
18
- journey (~> 1.0.1)
19
- rack (~> 1.4.0)
20
- rack-cache (~> 1.2)
21
- rack-test (~> 0.6.1)
22
- sprockets (~> 2.1.3)
23
- activemodel (3.2.5)
24
- activesupport (= 3.2.5)
25
- builder (~> 3.0.0)
26
- activerecord (3.2.5)
27
- activemodel (= 3.2.5)
28
- activesupport (= 3.2.5)
29
- arel (~> 3.0.2)
30
- tzinfo (~> 0.3.29)
31
- activerecord-import (0.2.9)
32
- activerecord (~> 3.0)
33
- activerecord (~> 3.0)
34
- activeresource (3.2.5)
35
- activemodel (= 3.2.5)
36
- activesupport (= 3.2.5)
37
- activesupport (3.2.5)
38
- i18n (~> 0.6)
39
- multi_json (~> 1.0)
40
- arel (3.0.2)
41
- builder (3.0.0)
42
- diff-lcs (1.1.3)
43
- erubis (2.7.0)
44
- ffi (1.0.11)
45
- guard (1.0.1)
46
- ffi (>= 0.5.0)
47
- thor (~> 0.14.6)
48
- guard-rspec (0.6.0)
49
- guard (>= 0.10.0)
50
- hike (1.2.1)
51
- i18n (0.6.0)
52
- journey (1.0.3)
53
- json (1.7.3)
54
- mail (2.4.4)
55
- i18n (>= 0.4.0)
56
- mime-types (~> 1.16)
57
- treetop (~> 1.4.8)
58
- mime-types (1.18)
59
- mongoid (3.0.0.rc)
60
- activemodel (~> 3.1)
61
- moped (~> 1.0.0.rc)
62
- origin (~> 1.0.0.rc)
63
- tzinfo (~> 0.3.22)
64
- moped (1.0.0.rc)
65
- multi_json (1.3.6)
66
- mysql (2.8.1)
67
- origin (1.0.0.rc)
68
- perftools.rb (2.0.0)
69
- polyglot (0.3.3)
70
- rack (1.4.1)
71
- rack-cache (1.2)
72
- rack (>= 0.4)
73
- rack-ssl (1.3.2)
74
- rack
75
- rack-test (0.6.1)
76
- rack (>= 1.0)
77
- rails (3.2.5)
78
- actionmailer (= 3.2.5)
79
- actionpack (= 3.2.5)
80
- activerecord (= 3.2.5)
81
- activeresource (= 3.2.5)
82
- activesupport (= 3.2.5)
83
- bundler (~> 1.0)
84
- railties (= 3.2.5)
85
- railties (3.2.5)
86
- actionpack (= 3.2.5)
87
- activesupport (= 3.2.5)
88
- rack-ssl (~> 1.3.2)
89
- rake (>= 0.8.7)
90
- rdoc (~> 3.4)
91
- thor (>= 0.14.6, < 2.0)
92
- rake (0.9.2.2)
93
- rdoc (3.12)
94
- json (~> 1.4)
95
- rspec (2.9.0)
96
- rspec-core (~> 2.9.0)
97
- rspec-expectations (~> 2.9.0)
98
- rspec-mocks (~> 2.9.0)
99
- rspec-core (2.9.0)
100
- rspec-expectations (2.9.0)
101
- diff-lcs (~> 1.1.3)
102
- rspec-mocks (2.9.0)
103
- sprockets (2.1.3)
104
- hike (~> 1.2)
105
- rack (~> 1.0)
106
- tilt (~> 1.1, != 1.3.0)
107
- sqlite3 (1.3.5)
108
- thor (0.14.6)
109
- tilt (1.3.3)
110
- treetop (1.4.10)
111
- polyglot
112
- polyglot (>= 0.3.1)
113
- tzinfo (0.3.33)
114
- uniform_notifier (1.0.2)
115
-
116
- PLATFORMS
117
- ruby
118
-
119
- DEPENDENCIES
120
- activerecord-import
121
- bullet!
122
- guard
123
- guard-rspec
124
- mongoid (= 3.0.0.rc)
125
- mysql
126
- perftools.rb
127
- rails (= 3.2.5)
128
- rspec
129
- sqlite3
@@ -1,65 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- bullet (4.1.6)
5
- uniform_notifier (~> 1.0.0)
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- actionmailer (2.3.14)
11
- actionpack (= 2.3.14)
12
- actionpack (2.3.14)
13
- activesupport (= 2.3.14)
14
- rack (~> 1.1.0)
15
- activerecord (2.3.14)
16
- activesupport (= 2.3.14)
17
- activeresource (2.3.14)
18
- activesupport (= 2.3.14)
19
- activesupport (2.3.14)
20
- bson (1.6.2)
21
- bson_ext (1.6.2)
22
- bson (~> 1.6.2)
23
- diff-lcs (1.1.3)
24
- ffi (1.0.11)
25
- guard (1.0.2)
26
- ffi (>= 0.5.0)
27
- thor (~> 0.14.6)
28
- guard-rspec (0.7.0)
29
- guard (>= 0.10.0)
30
- mysql (2.8.1)
31
- perftools.rb (2.0.0)
32
- rack (1.1.3)
33
- rails (2.3.14)
34
- actionmailer (= 2.3.14)
35
- actionpack (= 2.3.14)
36
- activerecord (= 2.3.14)
37
- activeresource (= 2.3.14)
38
- activesupport (= 2.3.14)
39
- rake (>= 0.8.3)
40
- rake (0.9.2.2)
41
- rspec (2.10.0)
42
- rspec-core (~> 2.10.0)
43
- rspec-expectations (~> 2.10.0)
44
- rspec-mocks (~> 2.10.0)
45
- rspec-core (2.10.0)
46
- rspec-expectations (2.10.0)
47
- diff-lcs (~> 1.1.3)
48
- rspec-mocks (2.10.1)
49
- sqlite3 (1.3.6)
50
- thor (0.14.6)
51
- uniform_notifier (1.0.2)
52
-
53
- PLATFORMS
54
- ruby
55
-
56
- DEPENDENCIES
57
- bson_ext
58
- bullet!
59
- guard
60
- guard-rspec
61
- mysql
62
- perftools.rb
63
- rails (= 2.3.14)
64
- rspec
65
- sqlite3
@@ -1,116 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- bullet (4.1.6)
5
- uniform_notifier (~> 1.0.0)
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- abstract (1.0.0)
11
- actionmailer (3.0.13)
12
- actionpack (= 3.0.13)
13
- mail (~> 2.2.19)
14
- actionpack (3.0.13)
15
- activemodel (= 3.0.13)
16
- activesupport (= 3.0.13)
17
- builder (~> 2.1.2)
18
- erubis (~> 2.6.6)
19
- i18n (~> 0.5.0)
20
- rack (~> 1.2.5)
21
- rack-mount (~> 0.6.14)
22
- rack-test (~> 0.5.7)
23
- tzinfo (~> 0.3.23)
24
- activemodel (3.0.13)
25
- activesupport (= 3.0.13)
26
- builder (~> 2.1.2)
27
- i18n (~> 0.5.0)
28
- activerecord (3.0.13)
29
- activemodel (= 3.0.13)
30
- activesupport (= 3.0.13)
31
- arel (~> 2.0.10)
32
- tzinfo (~> 0.3.23)
33
- activerecord-import (0.2.9)
34
- activerecord (~> 3.0)
35
- activerecord (~> 3.0)
36
- activeresource (3.0.13)
37
- activemodel (= 3.0.13)
38
- activesupport (= 3.0.13)
39
- activesupport (3.0.13)
40
- arel (2.0.10)
41
- bson (1.6.2)
42
- bson_ext (1.6.2)
43
- bson (~> 1.6.2)
44
- builder (2.1.2)
45
- diff-lcs (1.1.3)
46
- erubis (2.6.6)
47
- abstract (>= 1.0.0)
48
- ffi (1.0.11)
49
- guard (1.0.2)
50
- ffi (>= 0.5.0)
51
- thor (~> 0.14.6)
52
- guard-rspec (0.7.0)
53
- guard (>= 0.10.0)
54
- i18n (0.5.0)
55
- json (1.7.3)
56
- mail (2.2.19)
57
- activesupport (>= 2.3.6)
58
- i18n (>= 0.4.0)
59
- mime-types (~> 1.16)
60
- treetop (~> 1.4.8)
61
- mime-types (1.18)
62
- mysql (2.8.1)
63
- perftools.rb (2.0.0)
64
- polyglot (0.3.3)
65
- rack (1.2.5)
66
- rack-mount (0.6.14)
67
- rack (>= 1.0.0)
68
- rack-test (0.5.7)
69
- rack (>= 1.0)
70
- rails (3.0.13)
71
- actionmailer (= 3.0.13)
72
- actionpack (= 3.0.13)
73
- activerecord (= 3.0.13)
74
- activeresource (= 3.0.13)
75
- activesupport (= 3.0.13)
76
- bundler (~> 1.0)
77
- railties (= 3.0.13)
78
- railties (3.0.13)
79
- actionpack (= 3.0.13)
80
- activesupport (= 3.0.13)
81
- rake (>= 0.8.7)
82
- rdoc (~> 3.4)
83
- thor (~> 0.14.4)
84
- rake (0.9.2.2)
85
- rdoc (3.12)
86
- json (~> 1.4)
87
- rspec (2.10.0)
88
- rspec-core (~> 2.10.0)
89
- rspec-expectations (~> 2.10.0)
90
- rspec-mocks (~> 2.10.0)
91
- rspec-core (2.10.0)
92
- rspec-expectations (2.10.0)
93
- diff-lcs (~> 1.1.3)
94
- rspec-mocks (2.10.1)
95
- sqlite3 (1.3.6)
96
- thor (0.14.6)
97
- treetop (1.4.10)
98
- polyglot
99
- polyglot (>= 0.3.1)
100
- tzinfo (0.3.33)
101
- uniform_notifier (1.0.2)
102
-
103
- PLATFORMS
104
- ruby
105
-
106
- DEPENDENCIES
107
- activerecord-import
108
- bson_ext
109
- bullet!
110
- guard
111
- guard-rspec
112
- mysql
113
- perftools.rb
114
- rails (= 3.0.13)
115
- rspec
116
- sqlite3
@@ -1,134 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- bullet (4.1.6)
5
- uniform_notifier (~> 1.0.0)
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- actionmailer (3.1.5)
11
- actionpack (= 3.1.5)
12
- mail (~> 2.3.3)
13
- actionpack (3.1.5)
14
- activemodel (= 3.1.5)
15
- activesupport (= 3.1.5)
16
- builder (~> 3.0.0)
17
- erubis (~> 2.7.0)
18
- i18n (~> 0.6)
19
- rack (~> 1.3.6)
20
- rack-cache (~> 1.2)
21
- rack-mount (~> 0.8.2)
22
- rack-test (~> 0.6.1)
23
- sprockets (~> 2.0.4)
24
- activemodel (3.1.5)
25
- activesupport (= 3.1.5)
26
- builder (~> 3.0.0)
27
- i18n (~> 0.6)
28
- activerecord (3.1.5)
29
- activemodel (= 3.1.5)
30
- activesupport (= 3.1.5)
31
- arel (~> 2.2.3)
32
- tzinfo (~> 0.3.29)
33
- activerecord-import (0.2.9)
34
- activerecord (~> 3.0)
35
- activerecord (~> 3.0)
36
- activeresource (3.1.5)
37
- activemodel (= 3.1.5)
38
- activesupport (= 3.1.5)
39
- activesupport (3.1.5)
40
- multi_json (>= 1.0, < 1.3)
41
- arel (2.2.3)
42
- bson (1.6.2)
43
- bson_ext (1.6.2)
44
- bson (~> 1.6.2)
45
- builder (3.0.0)
46
- diff-lcs (1.1.3)
47
- erubis (2.7.0)
48
- ffi (1.0.11)
49
- guard (1.0.2)
50
- ffi (>= 0.5.0)
51
- thor (~> 0.14.6)
52
- guard-rspec (0.7.0)
53
- guard (>= 0.10.0)
54
- hike (1.2.1)
55
- i18n (0.6.0)
56
- json (1.7.3)
57
- mail (2.3.3)
58
- i18n (>= 0.4.0)
59
- mime-types (~> 1.16)
60
- treetop (~> 1.4.8)
61
- mime-types (1.18)
62
- mongo (1.6.2)
63
- bson (~> 1.6.2)
64
- mongoid (2.4.10)
65
- activemodel (~> 3.1)
66
- mongo (~> 1.3)
67
- tzinfo (~> 0.3.22)
68
- multi_json (1.2.0)
69
- mysql (2.8.1)
70
- perftools.rb (2.0.0)
71
- polyglot (0.3.3)
72
- rack (1.3.6)
73
- rack-cache (1.2)
74
- rack (>= 0.4)
75
- rack-mount (0.8.3)
76
- rack (>= 1.0.0)
77
- rack-ssl (1.3.2)
78
- rack
79
- rack-test (0.6.1)
80
- rack (>= 1.0)
81
- rails (3.1.5)
82
- actionmailer (= 3.1.5)
83
- actionpack (= 3.1.5)
84
- activerecord (= 3.1.5)
85
- activeresource (= 3.1.5)
86
- activesupport (= 3.1.5)
87
- bundler (~> 1.0)
88
- railties (= 3.1.5)
89
- railties (3.1.5)
90
- actionpack (= 3.1.5)
91
- activesupport (= 3.1.5)
92
- rack-ssl (~> 1.3.2)
93
- rake (>= 0.8.7)
94
- rdoc (~> 3.4)
95
- thor (~> 0.14.6)
96
- rake (0.9.2.2)
97
- rdoc (3.12)
98
- json (~> 1.4)
99
- rspec (2.10.0)
100
- rspec-core (~> 2.10.0)
101
- rspec-expectations (~> 2.10.0)
102
- rspec-mocks (~> 2.10.0)
103
- rspec-core (2.10.0)
104
- rspec-expectations (2.10.0)
105
- diff-lcs (~> 1.1.3)
106
- rspec-mocks (2.10.1)
107
- sprockets (2.0.4)
108
- hike (~> 1.2)
109
- rack (~> 1.0)
110
- tilt (~> 1.1, != 1.3.0)
111
- sqlite3 (1.3.6)
112
- thor (0.14.6)
113
- tilt (1.3.3)
114
- treetop (1.4.10)
115
- polyglot
116
- polyglot (>= 0.3.1)
117
- tzinfo (0.3.33)
118
- uniform_notifier (1.0.2)
119
-
120
- PLATFORMS
121
- ruby
122
-
123
- DEPENDENCIES
124
- activerecord-import
125
- bson_ext
126
- bullet!
127
- guard
128
- guard-rspec
129
- mongoid (= 2.4.10)
130
- mysql
131
- perftools.rb
132
- rails (= 3.1.5)
133
- rspec
134
- sqlite3