abrt 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/config/ruby_event.conf +10 -0
- data/lib/abrt/exception.rb +8 -0
- data/lib/abrt/handler.rb +10 -13
- metadata +7 -5
@@ -0,0 +1,10 @@
|
|
1
|
+
EVENT=post-create analyzer=Ruby
|
2
|
+
abrt-action-analyze-python
|
3
|
+
|
4
|
+
EVENT=report_Bugzilla analyzer=Ruby
|
5
|
+
test -f component || abrt-action-save-package-data
|
6
|
+
reporter-bugzilla -b -c /etc/libreport/plugins/bugzilla.conf
|
7
|
+
|
8
|
+
# Reporting of Ruby exceptions
|
9
|
+
EVENT=report-gui analyzer=Ruby
|
10
|
+
report-gtk -e report_Bugzilla -- "$DUMP_DIR"
|
data/lib/abrt/exception.rb
CHANGED
@@ -2,10 +2,18 @@
|
|
2
2
|
|
3
3
|
module ABRT
|
4
4
|
module Exception
|
5
|
+
# Provides the exception formated in the same way as Ruby does for standard
|
6
|
+
# error output.
|
5
7
|
def format
|
6
8
|
backtrace = self.backtrace.collect { |line| "\tfrom #{line}" }
|
7
9
|
backtrace[0] = "#{self.backtrace.first}: #{self.message} (#{self.class.name})"
|
8
10
|
backtrace
|
9
11
|
end
|
12
|
+
|
13
|
+
# Obtains executable name from backtrace. This should be more reliable then
|
14
|
+
# use of $0 aka $PROGRAM_NAME.
|
15
|
+
def executable
|
16
|
+
backtrace.last[/(.*?):/, 1]
|
17
|
+
end
|
10
18
|
end
|
11
19
|
end
|
data/lib/abrt/handler.rb
CHANGED
@@ -5,13 +5,12 @@ require 'abrt/exception.rb'
|
|
5
5
|
module ABRT
|
6
6
|
|
7
7
|
def self.handle_exception(exception)
|
8
|
-
syslog.notice "detected unhandled Ruby exception in '#{$0}'"
|
9
|
-
|
10
8
|
exception.extend(ABRT::Exception)
|
11
9
|
|
12
|
-
|
10
|
+
syslog.notice "detected unhandled Ruby exception in '#{exception.executable}'"
|
13
11
|
|
14
|
-
|
12
|
+
# Report only scripts with absolute path.
|
13
|
+
write_dump(exception) if exception.backtrace.last[0] == '/'
|
15
14
|
end
|
16
15
|
|
17
16
|
private
|
@@ -20,16 +19,14 @@ private
|
|
20
19
|
@syslog ||= Syslog.open 'abrt'
|
21
20
|
end
|
22
21
|
|
23
|
-
def self.report(
|
22
|
+
def self.report(exception, io = abrt_socket)
|
24
23
|
io.write "PUT / HTTP/1.1\r\n\r\n"
|
25
24
|
io.write "PID=#{Process.pid}\0"
|
26
|
-
io.write "EXECUTABLE=#{
|
27
|
-
|
28
|
-
# io.write "ANALYZER=Ruby\0"
|
29
|
-
io.write "ANALYZER=Python\0"
|
25
|
+
io.write "EXECUTABLE=#{exception.executable}\0"
|
26
|
+
io.write "ANALYZER=Ruby\0"
|
30
27
|
io.write "BASENAME=rbhook\0"
|
31
|
-
io.write "REASON=#{
|
32
|
-
io.write "BACKTRACE=#{
|
28
|
+
io.write "REASON=#{exception.format.first}\0"
|
29
|
+
io.write "BACKTRACE=#{exception.format.join("\n")}\0"
|
33
30
|
io.close_write
|
34
31
|
|
35
32
|
yield io.read
|
@@ -39,8 +36,8 @@ private
|
|
39
36
|
syslog.err "can't communicate with ABRT daemon, is it running? #{e.message}"
|
40
37
|
end
|
41
38
|
|
42
|
-
def self.write_dump(
|
43
|
-
report
|
39
|
+
def self.write_dump(exception)
|
40
|
+
report exception do |response|
|
44
41
|
if response.empty?
|
45
42
|
syslog.err "error sending data to ABRT daemon. Empty response received"
|
46
43
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abrt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -27,7 +27,8 @@ dependencies:
|
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 2.8.0
|
30
|
-
description: Provides ABRT reporting support for applications written using
|
30
|
+
description: Provides ABRT reporting support for libraries/applications written using
|
31
|
+
Ruby.
|
31
32
|
email: v.ondruch@tiscali.cz
|
32
33
|
executables: []
|
33
34
|
extensions: []
|
@@ -38,9 +39,10 @@ files:
|
|
38
39
|
- LICENSE.txt
|
39
40
|
- README.rdoc
|
40
41
|
- Rakefile
|
41
|
-
- lib/abrt/exception.rb
|
42
42
|
- lib/abrt/handler.rb
|
43
|
+
- lib/abrt/exception.rb
|
43
44
|
- lib/abrt.rb
|
45
|
+
- config/ruby_event.conf
|
44
46
|
homepage: http://github.com/voxik/abrt-ruby
|
45
47
|
licenses:
|
46
48
|
- MIT
|
@@ -65,5 +67,5 @@ rubyforge_project:
|
|
65
67
|
rubygems_version: 1.8.24
|
66
68
|
signing_key:
|
67
69
|
specification_version: 3
|
68
|
-
summary: ABRT support for Ruby
|
70
|
+
summary: ABRT support for Ruby.
|
69
71
|
test_files: []
|