bugsnag 1.8.4 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c744dba45c2a6935acc11b8f4ec4bf4ba45c5eab
4
- data.tar.gz: 2a465d826f1487c35a4b0218363dc169c4bc2069
3
+ metadata.gz: 21881053e80981565851e9d44faeacbfd2a03d48
4
+ data.tar.gz: 28c2f7f42f89dc3a3cc7a52c4626d1c36eefa9c0
5
5
  SHA512:
6
- metadata.gz: b45ad522fec4a680c7321fbf6bf0976a948dbc93b69cbc69c78a34a13784a69841098e3db0e7f715b11e1af5f683758fb434845a31ef8489cb7b713414f04b6f
7
- data.tar.gz: ff24132faa1a219aabe36bd7306c8d4f0953f73fc0569d1667834f66810b5e9d87c9175fa492d896528267bc708eb5f836b9886d69dcc505f1f0f79e8b27751e
6
+ metadata.gz: 54bb086e78b8e5ec1533dbf0ff8549c68e51433cd2276bce73ad25f71555515d5bba8f9799bf51d6b826d4cbb94b1f59c36bd134bf2dfc0678d7e3d01435d4a3
7
+ data.tar.gz: 010da7e8bd3a68ddc0fbcb2d2901ab20ce431b69d5fb400ece8d11be1c75ef6db47b9881b41ecdf84a2051bcf370bd9f2363eb87e9bb5ebf6b91e56da449c8d4
@@ -1,6 +1,12 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 1.8.5
5
+ -----
6
+
7
+ - capistrano3 support (for real)
8
+ - delayed_job support
9
+
4
10
  1.8.4
5
11
  -----
6
12
 
data/README.md CHANGED
@@ -170,7 +170,7 @@ Bugsnag.notify(RuntimeError.new("Something broke"), {
170
170
  Rake Integration
171
171
  ----------------
172
172
 
173
- Rake integration is automatically enabled in Rails 3 apps, so providing you load the environment
173
+ Rake integration is automatically enabled in Rails 3/4 apps, so providing you load the environment
174
174
  in your Rake tasks you dont need to do anything to get Rake support. If you choose not to load
175
175
  your environment, you can manually configure Bugsnag with a `bugsnag.configure` block in the Rakefile.
176
176
 
@@ -498,7 +498,7 @@ your deploy scripts.
498
498
  rake bugsnag:deploy BUGSNAG_REVISION=source-control-revision BUGSNAG_RELEASE_STAGE=production
499
499
  ```
500
500
 
501
- The bugsnag rake tasks will be automatically available for Rails 3
501
+ The bugsnag rake tasks will be automatically available for Rails 3/4
502
502
  apps, to make the rake tasks available in other apps, add the following to
503
503
  your `Rakefile`:
504
504
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.4
1
+ 1.8.5
@@ -9,7 +9,7 @@ require "bugsnag/helpers"
9
9
  require "bugsnag/rack"
10
10
  require "bugsnag/railtie" if defined?(Rails::Railtie)
11
11
 
12
- [:resque, :sidekiq, :mailman].each do |integration|
12
+ [:resque, :sidekiq, :mailman, :delayed_job].each do |integration|
13
13
  begin
14
14
  require "bugsnag/#{integration}"
15
15
  rescue LoadError
@@ -0,0 +1,26 @@
1
+ require 'delayed_job'
2
+
3
+ unless defined? Delayed::Plugins::Bugsnag
4
+ module Delayed
5
+ module Plugins
6
+ class Bugsnag < Plugin
7
+ module Notify
8
+ def error(job, error)
9
+ ::Bugsnag.auto_notify(error)
10
+ super if defined?(super)
11
+ end
12
+ end
13
+
14
+ callbacks do |lifecycle|
15
+ lifecycle.before(:invoke_job) do |job|
16
+ payload = job.payload_object
17
+ payload = payload.object if payload.is_a? Delayed::PerformableMethod
18
+ payload.extend Notify
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ Delayed::Worker.plugins << Delayed::Plugins::Bugsnag
26
+ end
@@ -1,19 +1,40 @@
1
- ALLOWED_ENV_SETTINGS = %w{BUGSNAG_RELEASE_STAGE BUGSNAG_REPOSITORY BUGSNAG_REVISION BUGSNAG_BRANCH BUGSNAG_API_KEY BUGSNAG_APP_VERSION}
1
+ namespace :load do
2
+
3
+ task :defaults do
4
+
5
+ set :bugsnag_default_hooks, ->{ true }
6
+
7
+ end
8
+
9
+ end
10
+
11
+ namespace :deploy do
12
+
13
+ before :starting, :bugsnag_hooks do
14
+ invoke 'bugsnag:add_default_hooks' if fetch(:bugsnag_default_hooks)
15
+ end
16
+
17
+ end
18
+
2
19
  namespace :bugsnag do
3
- desc "Notify Bugsnag that new production code has been deployed"
20
+
21
+ task :add_default_hooks do
22
+ after 'deploy:published', 'bugsnag:deploy'
23
+ end
24
+
25
+ desc 'Notify Bugsnag that new production code has been deployed'
4
26
  task :deploy do
5
- on :primary, reject: ->(h) { h.properties.no_release }, on_error: :continue do
6
- # Build the rake command
7
- rake = fetch(:rake, "rake")
8
- rails_env = fetch(:rails_env, "production")
27
+ on primary(:app) do
28
+ ALLOWED_ENV_SETTINGS = %w{BUGSNAG_RELEASE_STAGE BUGSNAG_REPOSITORY BUGSNAG_REVISION BUGSNAG_BRANCH BUGSNAG_API_KEY BUGSNAG_APP_VERSION}
29
+
30
+ rails_env = fetch(:rails_env) || fetch(:stage)
9
31
  bugsnag_env = fetch(:bugsnag_env, rails_env)
10
- rake_command = "cd '#{current_path}' && RAILS_ENV=#{rails_env} #{rake} bugsnag:deploy"
11
32
 
12
33
  # Build the new environment to pass through to rake
13
34
  new_env = {
14
35
  "BUGSNAG_RELEASE_STAGE" => bugsnag_env,
15
36
  "BUGSNAG_REVISION" => fetch(:current_revision, nil),
16
- "BUGSNAG_REPOSITORY" => fetch(:repository, nil),
37
+ "BUGSNAG_REPOSITORY" => fetch(:repo_url, nil),
17
38
  "BUGSNAG_BRANCH" => fetch(:branch, nil),
18
39
  "BUGSNAG_API_KEY" => fetch(:bugsnag_api_key, nil)
19
40
  }.reject { |_, v| v.nil? }
@@ -21,16 +42,14 @@ namespace :bugsnag do
21
42
  # Pass through any existing env variables
22
43
  ALLOWED_ENV_SETTINGS.each { |opt| new_env[opt] = ENV[opt] if ENV[opt] }
23
44
 
24
- # Append the env to the rake command
25
- rake_command << " #{new_env.map{|k,v| "#{k}=#{v}"}.join(" ")}"
26
-
27
- # Run the rake command (only on one server)
28
- run(rake_command, :once => true)
45
+ within release_path do
46
+ with rails_env: rails_env do
47
+ execute rake, "bugsnag:deploy #{new_env.map{|k,v| "#{k}=#{v}"}.join(" ")}"
48
+ end
49
+ end
29
50
 
30
- logger.info "Bugsnag deploy notification complete."
51
+ info 'Bugsnag deploy notification complete.'
31
52
  end
32
-
33
- after "deploy", "bugsnag:deploy"
34
53
  end
54
+
35
55
  end
36
- # vi:ft=ruby
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.4
4
+ version: 1.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-04 00:00:00.000000000 Z
11
+ date: 2014-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -110,6 +110,7 @@ files:
110
110
  - lib/bugsnag/capistrano2.rb
111
111
  - lib/bugsnag/configuration.rb
112
112
  - lib/bugsnag/delay/resque.rb
113
+ - lib/bugsnag/delayed_job.rb
113
114
  - lib/bugsnag/helpers.rb
114
115
  - lib/bugsnag/mailman.rb
115
116
  - lib/bugsnag/meta_data.rb
@@ -165,4 +166,3 @@ signing_key:
165
166
  specification_version: 4
166
167
  summary: Ruby notifier for bugsnag.com
167
168
  test_files: []
168
- has_rdoc: