delayed-plugins-airbrake 1.0.0.beta.1 → 1.0.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,6 +2,7 @@
2
2
  *.rbc
3
3
  .bundle
4
4
  .config
5
+ .vagrant
5
6
  .yardoc
6
7
  Gemfile.lock
7
8
  InstalledFiles
data/README.md CHANGED
@@ -15,7 +15,7 @@ Add this line to your application's Gemfile:
15
15
  Register the plugin like so:
16
16
 
17
17
  require 'delayed/plugins/airbrake'
18
- Delayed::Worker.plugins << Delayed::Plugins::Airbrake
18
+ Delayed::Worker.plugins << Delayed::Plugins::Airbrake::Plugin
19
19
 
20
20
  In a Rails project, this can be done in `config/initializers`.
21
21
 
data/Rakefile CHANGED
@@ -1 +1,12 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake'
3
+ require 'rspec/core/rake_task'
4
+
5
+ task :default => :spec
6
+
7
+ Bundler::GemHelper.install_tasks
8
+ RSpec::Core::RakeTask.new(:spec)
9
+
10
+ task :console do
11
+ sh('irb -I lib -r delayed-plugins-airbrake')
12
+ end
data/Vagrantfile ADDED
@@ -0,0 +1,9 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ Vagrant::Config.run do |config|
5
+ config.vm.box = 'precise64'
6
+ config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
7
+
8
+ config.vm.provision(:shell, :path => 'provision')
9
+ end
@@ -20,4 +20,7 @@ Gem::Specification.new do |gem|
20
20
  # Dependencies are not using versions so that there are few version conflicts for users.
21
21
  gem.add_dependency('airbrake')
22
22
  gem.add_dependency('delayed_job')
23
+
24
+ gem.add_development_dependency('rake')
25
+ gem.add_development_dependency('rspec')
23
26
  end
@@ -1,7 +1,7 @@
1
1
  module Delayed
2
2
  module Plugins
3
3
  module Airbrake
4
- VERSION = "1.0.0.beta.1"
4
+ VERSION = "1.0.0.beta.2"
5
5
  end
6
6
  end
7
7
  end
@@ -4,28 +4,26 @@ require 'delayed/plugin'
4
4
 
5
5
  require 'delayed-plugins-airbrake/version'
6
6
 
7
- module Delayed
8
- module Plugins
9
- class Airbrake < Plugin
10
- module Notify
11
- def error(job, error)
12
- ::Airbrake.notify_or_ignore(
13
- :error_class => error.class.name,
14
- :error_message => "#{error.class.name}: #{error.message}",
15
- :parameters => {
16
- :failed_job => job.inspect,
17
- }
18
- )
19
- super if defined?(super)
20
- end
7
+ module Delayed::Plugins::Airbrake
8
+ class Plugin < ::Delayed::Plugin
9
+ module Notify
10
+ def error(job, error)
11
+ ::Airbrake.notify_or_ignore(
12
+ :error_class => error.class.name,
13
+ :error_message => "#{error.class.name}: #{error.message}",
14
+ :parameters => {
15
+ :failed_job => job.inspect,
16
+ }
17
+ )
18
+ super if defined?(super)
21
19
  end
20
+ end
22
21
 
23
- callbacks do |lifecycle|
24
- lifecycle.before(:invoke_job) do |job|
25
- payload = job.payload_object
26
- payload = payload.object if payload.is_a? Delayed::PerformableMethod
27
- payload.extend Notify
28
- end
22
+ callbacks do |lifecycle|
23
+ lifecycle.before(:invoke_job) do |job|
24
+ payload = job.payload_object
25
+ payload = payload.object if payload.is_a? Delayed::PerformableMethod
26
+ payload.extend Notify
29
27
  end
30
28
  end
31
29
  end
data/provision ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+ # A simple shell-based provisioner for Vagrant.
3
+ #
4
+ # Documentation: [Shell Provisioner](http://vagrantup.com/v1/docs/provisioners/shell.html)
5
+ set -o errexit
6
+
7
+ sudo apt-get update
8
+ sudo apt-get install -y git-core make ruby1.9.1 ruby1.9.1-dev
9
+ sudo gem install bundler
10
+ cd /vagrant
11
+ bundle install
@@ -0,0 +1,3 @@
1
+ require 'delayed-plugins-airbrake'
2
+
3
+ # Intentionally empty. This is basically just checking for SyntaxErrors, etc right now.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed-plugins-airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.1
4
+ version: 1.0.0.beta.2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -15,7 +15,7 @@ date: 2013-03-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: airbrake
18
- requirement: &12117500 !ruby/object:Gem::Requirement
18
+ requirement: &19595260 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: '0'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *12117500
26
+ version_requirements: *19595260
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: delayed_job
29
- requirement: &12116800 !ruby/object:Gem::Requirement
29
+ requirement: &19564020 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,7 +34,29 @@ dependencies:
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *12116800
37
+ version_requirements: *19564020
38
+ - !ruby/object:Gem::Dependency
39
+ name: rake
40
+ requirement: &19563400 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ type: :development
47
+ prerelease: false
48
+ version_requirements: *19563400
49
+ - !ruby/object:Gem::Dependency
50
+ name: rspec
51
+ requirement: &19562600 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: *19562600
38
60
  description: delayed_job exception notification with airbrake
39
61
  email:
40
62
  - hello@benjaminoakes.com
@@ -47,9 +69,12 @@ files:
47
69
  - LICENSE.txt
48
70
  - README.md
49
71
  - Rakefile
72
+ - Vagrantfile
50
73
  - delayed-plugins-airbrake.gemspec
51
74
  - lib/delayed-plugins-airbrake.rb
52
75
  - lib/delayed-plugins-airbrake/version.rb
76
+ - provision
77
+ - spec/lib/delayed-plugins-airbrake/plugin_spec.rb
53
78
  homepage: ''
54
79
  licenses: []
55
80
  post_install_message:
@@ -75,5 +100,6 @@ signing_key:
75
100
  specification_version: 3
76
101
  summary: Notify Airbrake on Delayed Job errors, including those on PerformableMethod. Packaged
77
102
  for use from https://gist.github.com/granth/2223758 and http://stackoverflow.com/questions/12683364/how-to-make-delayed-job-notify-airbrake-when-an-actionmailer-runs-into-an-error.
78
- test_files: []
103
+ test_files:
104
+ - spec/lib/delayed-plugins-airbrake/plugin_spec.rb
79
105
  has_rdoc: