toadhopper 0.9.2 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/notice.haml +1 -1
- data/lib/toadhopper.rb +11 -4
- data/test/test_filters.rb +1 -1
- data/test/test_posting.rb +2 -2
- metadata +2 -2
data/README.md
CHANGED
data/lib/notice.haml
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
%message= "#{error.class.name}: #{error.message}"
|
11
11
|
%backtrace
|
12
12
|
- backtrace.each do |line|
|
13
|
-
%line{:method => line.method, :file => line.file, :number => line.number}
|
13
|
+
%line{:method => line.method, :file => line.file, :number => line.number}/
|
14
14
|
%request
|
15
15
|
%url= url
|
16
16
|
%component= component
|
data/lib/toadhopper.rb
CHANGED
@@ -5,7 +5,7 @@ require 'nokogiri'
|
|
5
5
|
|
6
6
|
# Posts errors to the Hoptoad API
|
7
7
|
class ToadHopper
|
8
|
-
VERSION = "0.9.
|
8
|
+
VERSION = "0.9.4"
|
9
9
|
|
10
10
|
# Hoptoad API response
|
11
11
|
class Response < Struct.new(:status, :body, :errors); end
|
@@ -47,9 +47,9 @@ class ToadHopper
|
|
47
47
|
# @param [Hash] http_headers extra HTTP headers to be sent in the post to the API
|
48
48
|
#
|
49
49
|
# @example
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
50
|
+
# ToadHopper('apikey').post! error,
|
51
|
+
# {:action => 'show', :controller => 'Users'},
|
52
|
+
# {'X-Hoptoad-Client-Name' => 'My Awesome Notifier'}
|
53
53
|
#
|
54
54
|
# @return [Response]
|
55
55
|
def post!(error, options={}, http_headers={})
|
@@ -129,3 +129,10 @@ class ToadHopper
|
|
129
129
|
[Fixnum, Array, String, Hash, Bignum].any? {|c| value.is_a?(c)}
|
130
130
|
end
|
131
131
|
end
|
132
|
+
|
133
|
+
# Convenience method for creating ToadHoppers
|
134
|
+
#
|
135
|
+
# @return [ToadHopper]
|
136
|
+
def ToadHopper(api_key)
|
137
|
+
ToadHopper.new(api_key)
|
138
|
+
end
|
data/test/test_filters.rb
CHANGED
data/test/test_posting.rb
CHANGED
@@ -2,7 +2,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
|
2
2
|
|
3
3
|
class ToadHopper::TestPosting < Test::Unit::TestCase
|
4
4
|
def test_posting
|
5
|
-
toadhopper = ToadHopper
|
5
|
+
toadhopper = ToadHopper("abc123")
|
6
6
|
error = begin; raise "Kaboom!"; rescue => e; e end
|
7
7
|
|
8
8
|
response = toadhopper.post!(error)
|
@@ -12,7 +12,7 @@ class ToadHopper::TestPosting < Test::Unit::TestCase
|
|
12
12
|
|
13
13
|
if ENV['HOPTOAD_API_KEY']
|
14
14
|
def test_posting_integration
|
15
|
-
toadhopper = ToadHopper
|
15
|
+
toadhopper = ToadHopper(ENV['HOPTOAD_API_KEY'])
|
16
16
|
error = begin; raise "Kaboom!"; rescue => e; e end
|
17
17
|
|
18
18
|
response = toadhopper.post!(error)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toadhopper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Lucas
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2009-12-
|
14
|
+
date: 2009-12-24 00:00:00 +11:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|