canary_notifier 0.0.9 → 0.0.10
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/Readme.md +20 -0
- data/canary_notifier.gemspec +1 -1
- data/lib/canary_notifier.rb +17 -2
- metadata +4 -3
data/Readme.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Canary Notifier
|
2
|
+
A simple way to get your ruby errors into Canary.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
|
6
|
+
Add this to your Gemfile:
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
gem 'canary_notifier' , '~> 0.0.9'
|
10
|
+
```
|
11
|
+
|
12
|
+
Do a `bundle install`.
|
13
|
+
|
14
|
+
Open up config/environments/development.rb and add this do the end of the configure block:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
config.middleware.use CanaryNotifier, :app_name => 'Your App Name'
|
18
|
+
```
|
19
|
+
|
20
|
+
Any errors you have should now show up to Canary.
|
data/canary_notifier.gemspec
CHANGED
data/lib/canary_notifier.rb
CHANGED
@@ -9,8 +9,8 @@ class CanaryNotifier
|
|
9
9
|
@app.call(env)
|
10
10
|
rescue Exception => e
|
11
11
|
url = 'http://stark:abc123@bugdrop.canary.io/notify'
|
12
|
-
|
13
|
-
|
12
|
+
(file_name, line_number, method) = parse_backtrace_line(e.backtrace.first)
|
13
|
+
|
14
14
|
data = {}
|
15
15
|
data["app_name"] = @options[:app_name] || "No Name"
|
16
16
|
data["bug_name"] = "#{e.class.name}: #{e.to_s}"
|
@@ -35,4 +35,19 @@ class CanaryNotifier
|
|
35
35
|
|
36
36
|
raise e
|
37
37
|
end
|
38
|
+
|
39
|
+
def parse_backtrace_line(line)
|
40
|
+
parts = first_line.split(':')
|
41
|
+
|
42
|
+
# the backtrace will always parse funny on Windows due to paths containing things like
|
43
|
+
# 'c:\ruby\etc...'
|
44
|
+
if parts.size == 4
|
45
|
+
file = parts[0..1].join
|
46
|
+
line_num = parts[2]
|
47
|
+
method = parts[3]
|
48
|
+
[file, line_num, method]
|
49
|
+
else
|
50
|
+
parts
|
51
|
+
end
|
52
|
+
end
|
38
53
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canary_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-10-27 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
16
|
-
requirement: &
|
16
|
+
requirement: &70327292043020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70327292043020
|
25
25
|
description:
|
26
26
|
email: support@canaryhq.com
|
27
27
|
executables: []
|
@@ -32,6 +32,7 @@ files:
|
|
32
32
|
- Gemfile
|
33
33
|
- Gemfile.lock
|
34
34
|
- Rakefile
|
35
|
+
- Readme.md
|
35
36
|
- canary_notifier.gemspec
|
36
37
|
- lib/canary_notifier.rb
|
37
38
|
homepage:
|