adhearsion-reporter 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ .*.swp
2
+ .*.swo
3
+ .DS_STORE
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ # v2.0.0
2
+ * First release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (C) 2012 Adhearsion Foundation Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ adhearsion-reporter
2
+ ==================
3
+
4
+ Report Adhearsion application exceptions and deployments to:
5
+
6
+ * [Airbrake](http://airbrake.io)
7
+ * [Errbit](https://github.com/errbit/errbit)
8
+
9
+ This Adhearsion plugin requires Adhearsion 2.0 or later. For Adhearsion 1.0 try the previous version of this gem [ahn_hoptoad](https://github.com/mojolingo/ahn_hoptoad)
10
+
11
+ Usage
12
+ -----
13
+
14
+ To use this gem, add the following line to your Gemfile:
15
+
16
+ ```ruby
17
+ gem 'adhearsion-reporter'
18
+ ```
19
+
20
+ To view the available configuration options, run the rake task:
21
+
22
+ ```
23
+ rake adhearsion:config:show[reporter]
24
+ ```
25
+
26
+ The configuration options are added to config/adhearsion.rb with the rest of Adhearsion's configuration. Example:
27
+
28
+ ```ruby
29
+ Adhearsion.config do |config|
30
+ config.reporter.api_key = "YOUR API KEY HERE"
31
+ end
32
+ ```
33
+
34
+ Copyright
35
+ ---------
36
+
37
+ Copyright (C) 2012 Adhearsion Foundation Inc.
38
+ Released under the MIT License - Check [License file](https://github.com/adhearsion/adhearsion-reporter/blob/master/LICENSE)
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "adhearsion/reporter/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "adhearsion-reporter"
7
+ s.version = Adhearsion::REPORTER_VERSION
8
+ s.date = Date.today.to_s
9
+ s.platform = Gem::Platform::RUBY
10
+ s.authors = ["Ben Klang"]
11
+ s.email = %w{bklang@mojolingo.com}
12
+ s.homepage = "http://github.com/adhearsion/adhearsion-reporter"
13
+ s.summary = %q{Report Adhearsion application deployments and exceptions}
14
+ s.description =<<EOF
15
+ Report Adhearsion application exceptions and deployments to:
16
+
17
+ Airbrake
18
+ Errbit
19
+ This Adhearsion plugin requires Adhearsion 2.0 or later. For Adhearsion 1.0 try the previous version of this gem ahn_hoptoad
20
+ EOF
21
+ s.files = `git ls-files`.split("\n")
22
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
24
+ s.require_paths = ["lib"]
25
+
26
+ s.add_runtime_dependency("adhearsion", ["~> 2.0"])
27
+ s.add_runtime_dependency("toadhopper", [">= 1.3.0"])
28
+ end
@@ -0,0 +1,2 @@
1
+ # encoding: utf-8
2
+ require 'adhearsion/reporter'
@@ -0,0 +1,26 @@
1
+ # encoding: utf-8
2
+ require 'toadhopper'
3
+
4
+ module Adhearsion
5
+ class Reporter < Plugin
6
+ config :reporter do
7
+ api_key nil, :desc => "The Airbrake/Errbit API key"
8
+ url "http://airbrake.io", :desc => "Base URL for notification service"
9
+ end
10
+
11
+ init :reporter do
12
+ config = Adhearsion.config[:reporter]
13
+ notifier = Toadhopper.new config.api_key, :notify_host => config.url
14
+ Events.register_callback(:exception) do |e|
15
+ response = notifier.post!(e)
16
+ if !response.errors.empty? || !(200..299).include?(response.status.to_i)
17
+ logger.error "Error posting exception to #{config.url}! Response code #{response.status}"
18
+ response.errors.each do |error|
19
+ logger.error "#{error}"
20
+ end
21
+ logger.warn "Original exception message: #{e.message}"
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ module Adhearsion
2
+ REPORTER_VERSION = '2.0.0'
3
+ end
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ Bundler.setup
4
+ Bundler.require
5
+
6
+ require 'adhearsion/component_manager/spec_framework'
7
+
8
+ component_name.upcase = ComponentTester.new("ahnhoptoad", File.dirname(__FILE__) + "/../..")
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: adhearsion-reporter
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Ben Klang
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: adhearsion
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '2.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '2.0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: toadhopper
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 1.3.0
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.3.0
46
+ description: ! 'Report Adhearsion application exceptions and deployments to:
47
+
48
+
49
+ Airbrake
50
+
51
+ Errbit
52
+
53
+ This Adhearsion plugin requires Adhearsion 2.0 or later. For Adhearsion 1.0 try
54
+ the previous version of this gem ahn_hoptoad
55
+
56
+ '
57
+ email:
58
+ - bklang@mojolingo.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - CHANGELOG.md
65
+ - Gemfile
66
+ - LICENSE
67
+ - README.md
68
+ - Rakefile
69
+ - adhearsion-reporter.gemspec
70
+ - lib/adhearsion-reporter.rb
71
+ - lib/adhearsion/reporter.rb
72
+ - lib/adhearsion/reporter/version.rb
73
+ - spec/ahnhoptoad_spec.rb
74
+ homepage: http://github.com/adhearsion/adhearsion-reporter
75
+ licenses: []
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 1.8.21
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: Report Adhearsion application deployments and exceptions
98
+ test_files:
99
+ - spec/ahnhoptoad_spec.rb
100
+ has_rdoc: