canary_notifier 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/canary_notifier.gemspec +1 -1
- data/lib/canary_notifier.rb +10 -2
- metadata +3 -3
data/canary_notifier.gemspec
CHANGED
data/lib/canary_notifier.rb
CHANGED
@@ -20,8 +20,16 @@ class CanaryNotifier
|
|
20
20
|
data["line_number"] = line_number.to_i
|
21
21
|
data["bug_method"] = method.split.last
|
22
22
|
data["language"] = 'ruby'
|
23
|
-
data["backtrace"] = e.backtrace.join("\n
|
24
|
-
|
23
|
+
data["backtrace"] = e.backtrace.join("\n")
|
24
|
+
|
25
|
+
lines = File.readlines(file_name)
|
26
|
+
start_line = line_number.to_i - 4
|
27
|
+
start_line = 0 if start_line < 0
|
28
|
+
end_line = line_number.to_i+2
|
29
|
+
end_line = line.size - 1 if end_line > line.size - 1
|
30
|
+
|
31
|
+
data["code_sample"] = lines[start_line..end_line].join
|
32
|
+
|
25
33
|
data["code_sample_line_start"] = line_number.to_i - 3
|
26
34
|
RestClient.post url, data.to_json
|
27
35
|
|
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.5
|
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: &70269050527280 !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: *70269050527280
|
25
25
|
description:
|
26
26
|
email: support@canaryhq.com
|
27
27
|
executables: []
|