bugsnag 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,10 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 1.3.1
5
+ -----
6
+ - Add support for Bugsnag rake integration
7
+
4
8
  1.3.0
5
9
  ------
6
10
  - By default we notify in all release stages now
@@ -3,17 +3,17 @@ GEM
3
3
  specs:
4
4
  diff-lcs (1.1.3)
5
5
  git (1.2.5)
6
- httparty (0.9.0)
6
+ httparty (0.10.2)
7
7
  multi_json (~> 1.0)
8
- multi_xml
8
+ multi_xml (>= 0.5.2)
9
9
  jeweler (1.8.4)
10
10
  bundler (~> 1.0)
11
11
  git (>= 1.2.5)
12
12
  rake
13
13
  rdoc
14
- json (1.7.5)
15
- multi_json (1.3.6)
16
- multi_xml (0.5.1)
14
+ json (1.7.7)
15
+ multi_json (1.7.2)
16
+ multi_xml (0.5.3)
17
17
  rake (0.9.2.2)
18
18
  rdoc (3.12)
19
19
  json (~> 1.4)
data/README.md CHANGED
@@ -150,6 +150,38 @@ Bugsnag.notify(RuntimeError.new("Something broke"), {
150
150
  })
151
151
  ```
152
152
 
153
+ Rake Integration
154
+ ----------------
155
+
156
+ Bugsnag can automatically notify of all exceptions that happen in your rake tasks. In order
157
+ to enable this, you need to `require "bugsnag/rake"`, like so:
158
+
159
+ ```ruby
160
+ require "bugsnag/rake"
161
+
162
+ desc "Sample task"
163
+ task sample_task => :environment do
164
+ puts "doing work"
165
+ raise "Something went wrong" # Reported to bugsnag
166
+ end
167
+ ```
168
+
169
+ **NOTE**: If you dont load your rails environment as part of your rake task, you will still need
170
+ to ensure that Bugsnag has been configured by manually running the Bugsnag.configure method.
171
+
172
+ Standard Ruby Scripts
173
+ ---------------------
174
+
175
+ If you are running a standard ruby script, you can ensure that all exceptions are sent to Bugsnag by
176
+ adding the following code to your app:
177
+
178
+ ```ruby
179
+ at_exit do
180
+ if $!
181
+ Bugsnag.notify($!)
182
+ end
183
+ end
184
+ ```
153
185
 
154
186
  Configuration
155
187
  -------------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bugsnag}
8
- s.version = "1.3.0"
8
+ s.version = "1.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Smith"]
12
- s.date = %q{2013-03-21}
12
+ s.date = %q{2013-04-06}
13
13
  s.description = %q{Ruby notifier for bugsnag.com}
14
14
  s.email = %q{james@bugsnag.com}
15
15
  s.extra_rdoc_files = [
@@ -47,6 +47,7 @@ Gem::Specification.new do |s|
47
47
  "lib/bugsnag/rails/action_controller_rescue.rb",
48
48
  "lib/bugsnag/rails/controller_methods.rb",
49
49
  "lib/bugsnag/railtie.rb",
50
+ "lib/bugsnag/rake.rb",
50
51
  "lib/bugsnag/sidekiq.rb",
51
52
  "lib/bugsnag/tasks.rb",
52
53
  "lib/bugsnag/tasks/bugsnag.rake",
@@ -0,0 +1,37 @@
1
+ Rake::TaskManager.record_task_metadata = true
2
+
3
+ module Bugsnag::Rake
4
+ def self.included(base)
5
+ base.extend ClassMethods
6
+ base.class_eval do
7
+ class << self
8
+ alias_method :original_define_task, :define_task
9
+ alias_method :define_task, :bugsnag_define_task
10
+ end
11
+ end
12
+ end
13
+
14
+ module ClassMethods
15
+ def bugsnag_define_task(*args, &block)
16
+ task = self.original_define_task *args do
17
+ begin
18
+ Bugsnag.before_notify_callbacks << lambda {|notif|
19
+ notif.add_tab(:rake_task, {
20
+ name: task.name,
21
+ description: task.full_comment,
22
+ arguments: task.arg_description
23
+ })
24
+ notif.context ||= task.name
25
+ }
26
+
27
+ yield
28
+ rescue Exception => e
29
+ Bugsnag.notify(e)
30
+ raise
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ Rake::Task.send(:include, Bugsnag::Rake) if defined?(Rake::Task)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 3
8
- - 0
9
- version: 1.3.0
8
+ - 1
9
+ version: 1.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - James Smith
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2013-03-21 00:00:00 -07:00
17
+ date: 2013-04-06 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -130,6 +130,7 @@ files:
130
130
  - lib/bugsnag/rails/action_controller_rescue.rb
131
131
  - lib/bugsnag/rails/controller_methods.rb
132
132
  - lib/bugsnag/railtie.rb
133
+ - lib/bugsnag/rake.rb
133
134
  - lib/bugsnag/sidekiq.rb
134
135
  - lib/bugsnag/tasks.rb
135
136
  - lib/bugsnag/tasks/bugsnag.rake