ahn_hoptoad 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +3 -0
- data/README.md +1 -0
- data/Rakefile +2 -0
- data/ahn_hoptoad.gemspec +23 -0
- data/config/ahn_hoptoad.yml +5 -0
- data/lib/ahn_hoptoad/version.rb +3 -0
- data/lib/ahn_hoptoad.rb +18 -0
- data/spec/ahnhoptoad_spec.rb +8 -0
- metadata +106 -0
data/Gemfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This component for Adhearsion allows you to catch exceptions raised within Adhearsion applications and report them to (Hoptoad)[http://hoptoadapp.com]
|
data/Rakefile
ADDED
data/ahn_hoptoad.gemspec
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
+
require "ahn_hoptoad/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |s|
|
|
6
|
+
s.name = "ahn_hoptoad"
|
|
7
|
+
s.version = "1.0.0"
|
|
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/mojolingo/ahn_hoptoad"
|
|
13
|
+
s.summary = %q{Send Adhearsion application exceptions to Hoptoad}
|
|
14
|
+
s.description = %q{Send Adhearsion application exceptions to Hoptoad}
|
|
15
|
+
|
|
16
|
+
s.files = `git ls-files`.split("\n")
|
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
19
|
+
s.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
s.add_runtime_dependency("adhearsion", [">= 1.1.0"])
|
|
22
|
+
s.add_runtime_dependency("toadhopper", [">= 1.3.0"])
|
|
23
|
+
end
|
data/lib/ahn_hoptoad.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Register an exception handler for Adhearsion exceptions.
|
|
2
|
+
# Requires Adhearsion 1.1.0 or later.
|
|
3
|
+
|
|
4
|
+
require 'toadhopper'
|
|
5
|
+
notifier = Toadhopper.new(COMPONENTS.ahn_hoptoad[:apikey],
|
|
6
|
+
:notify_host => COMPONENTS.ahn_hoptoad[:host])
|
|
7
|
+
Events.register_callback([:exception]) do |e|
|
|
8
|
+
result = notifier.post!(e)
|
|
9
|
+
|
|
10
|
+
response = notifier.post!(e)
|
|
11
|
+
if !response.errors.empty? || !(200..299).include?(response.status.to_i)
|
|
12
|
+
ahn_log.warn "Error posting exception to Hoptoad! Response code #{response.status}"
|
|
13
|
+
response.errors.each do |error|
|
|
14
|
+
ahn_log.warn "Hoptoad error: #{error}"
|
|
15
|
+
end
|
|
16
|
+
ahn_log.warn "Original exception message: #{e.message}"
|
|
17
|
+
end
|
|
18
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ahn_hoptoad
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 23
|
|
5
|
+
prerelease: false
|
|
6
|
+
segments:
|
|
7
|
+
- 1
|
|
8
|
+
- 0
|
|
9
|
+
- 0
|
|
10
|
+
version: 1.0.0
|
|
11
|
+
platform: ruby
|
|
12
|
+
authors:
|
|
13
|
+
- Ben Klang
|
|
14
|
+
autorequire:
|
|
15
|
+
bindir: bin
|
|
16
|
+
cert_chain: []
|
|
17
|
+
|
|
18
|
+
date: 2011-06-08 00:00:00 -04:00
|
|
19
|
+
default_executable:
|
|
20
|
+
dependencies:
|
|
21
|
+
- !ruby/object:Gem::Dependency
|
|
22
|
+
name: adhearsion
|
|
23
|
+
prerelease: false
|
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
hash: 19
|
|
30
|
+
segments:
|
|
31
|
+
- 1
|
|
32
|
+
- 1
|
|
33
|
+
- 0
|
|
34
|
+
version: 1.1.0
|
|
35
|
+
type: :runtime
|
|
36
|
+
version_requirements: *id001
|
|
37
|
+
- !ruby/object:Gem::Dependency
|
|
38
|
+
name: toadhopper
|
|
39
|
+
prerelease: false
|
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
hash: 27
|
|
46
|
+
segments:
|
|
47
|
+
- 1
|
|
48
|
+
- 3
|
|
49
|
+
- 0
|
|
50
|
+
version: 1.3.0
|
|
51
|
+
type: :runtime
|
|
52
|
+
version_requirements: *id002
|
|
53
|
+
description: Send Adhearsion application exceptions to Hoptoad
|
|
54
|
+
email:
|
|
55
|
+
- bklang@mojolingo.com
|
|
56
|
+
executables: []
|
|
57
|
+
|
|
58
|
+
extensions: []
|
|
59
|
+
|
|
60
|
+
extra_rdoc_files: []
|
|
61
|
+
|
|
62
|
+
files:
|
|
63
|
+
- Gemfile
|
|
64
|
+
- README.md
|
|
65
|
+
- Rakefile
|
|
66
|
+
- ahn_hoptoad.gemspec
|
|
67
|
+
- config/ahn_hoptoad.yml
|
|
68
|
+
- lib/ahn_hoptoad.rb
|
|
69
|
+
- lib/ahn_hoptoad/version.rb
|
|
70
|
+
- spec/ahnhoptoad_spec.rb
|
|
71
|
+
has_rdoc: true
|
|
72
|
+
homepage: http://github.com/mojolingo/ahn_hoptoad
|
|
73
|
+
licenses: []
|
|
74
|
+
|
|
75
|
+
post_install_message:
|
|
76
|
+
rdoc_options: []
|
|
77
|
+
|
|
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
|
+
hash: 3
|
|
86
|
+
segments:
|
|
87
|
+
- 0
|
|
88
|
+
version: "0"
|
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
|
+
none: false
|
|
91
|
+
requirements:
|
|
92
|
+
- - ">="
|
|
93
|
+
- !ruby/object:Gem::Version
|
|
94
|
+
hash: 3
|
|
95
|
+
segments:
|
|
96
|
+
- 0
|
|
97
|
+
version: "0"
|
|
98
|
+
requirements: []
|
|
99
|
+
|
|
100
|
+
rubyforge_project:
|
|
101
|
+
rubygems_version: 1.3.7
|
|
102
|
+
signing_key:
|
|
103
|
+
specification_version: 3
|
|
104
|
+
summary: Send Adhearsion application exceptions to Hoptoad
|
|
105
|
+
test_files:
|
|
106
|
+
- spec/ahnhoptoad_spec.rb
|