abrt 0.0.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/{README.rdoc → README.md} +23 -21
- data/config/ruby_event.conf +4 -0
- data/lib/abrt.rb +5 -3
- data/lib/abrt/exception.rb +1 -1
- data/lib/abrt/handler.rb +12 -10
- metadata +14 -36
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -2
- metadata.gz.sig +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5e28662ce14404d6c25ab366533c9fb61c304c7ec08d1a5b66daa6c8bc2cad2d
|
4
|
+
data.tar.gz: 633c0790c3b560d3b895f529a8f3a2ea4626282d35f397c2431dcaa54e510d3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b016f9f38adf537b4c00ff3971ff7a1874e354b8b89a17cbb6f7240aa1dd4760c0d80f2e47ce9d4d991c48e101ae9bce09107b0f83fb64e1183ca8a69fea9119
|
7
|
+
data.tar.gz: ce58173fe5230c3ffeccb5dee1a79197620b0c65a538825cfe2b2e9ce55512b1dce43879ef7a0570c3a734aea5548dfc9f509aef8878492c14f8d25bfe3df782
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,46 +1,48 @@
|
|
1
|
-
|
1
|
+
[![Build Status](https://travis-ci.org/voxik/abrt-ruby.svg?branch=master)](https://travis-ci.org/voxik/abrt-ruby)
|
2
|
+
|
3
|
+
# abrt
|
2
4
|
|
3
5
|
Provides ABRT reporting support for libraries/applications written using Ruby.
|
4
6
|
|
5
7
|
Please note that ABRT will be able to report errors only for applications which are already RPM packaged. Errors in other applications are ignored.
|
6
8
|
|
7
|
-
|
9
|
+
## Installation
|
8
10
|
|
9
|
-
|
11
|
+
```
|
10
12
|
$ gem install abrt
|
11
|
-
|
13
|
+
```
|
12
14
|
|
13
15
|
or if you're using Bundler, put
|
14
16
|
|
15
|
-
|
17
|
+
```
|
16
18
|
gem "abrt", :require => false
|
17
|
-
|
19
|
+
```
|
18
20
|
|
19
|
-
line into your
|
21
|
+
line into your *Gemfile*.
|
20
22
|
|
21
|
-
|
23
|
+
## Usage
|
22
24
|
|
23
25
|
There are several ways how to run any application with ABRT handler enabled.
|
24
26
|
|
25
|
-
1. Use
|
26
|
-
2. If you can't modify the application and you still want to use ABRT support, then you need to define
|
27
|
-
3. If you want to ensure, that ABRT handler is always used, add
|
27
|
+
1. Use `require 'abrt'` at the beginning of your application.
|
28
|
+
2. If you can't modify the application and you still want to use ABRT support, then you need to define `RUBYOPT="-rabrt"` environment variable. This will ensure that ABRT support gets loaded and the exception handler hooks are installed.
|
29
|
+
3. If you want to ensure, that ABRT handler is always used, add `RUBYOPT="-rabrt"` into your *.bashrc* file. This will ensure, that Ruby loads ABRT handler every time its starts.
|
28
30
|
4. In Fedora, since ruby-2.0.0.247-9.fc19, Ruby loads abrt gem automatically.
|
29
31
|
|
30
32
|
Now, everytime the unhandled exception is captured, ABRT handler prepares bugreport, which can be submitted into http://bugzilla.redhat.com component later using standard ABRT tools.
|
31
33
|
|
32
|
-
|
34
|
+
## Contributing to abrt
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
37
|
+
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
38
|
+
- Fork the project.
|
39
|
+
- Start a feature/bugfix branch.
|
40
|
+
- Commit and push until you are happy with your contribution.
|
41
|
+
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
42
|
+
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
41
43
|
|
42
|
-
|
44
|
+
## Copyright
|
43
45
|
|
44
|
-
Copyright (c) 2012 Vít Ondruch. See LICENSE.txt for
|
46
|
+
Copyright (c) 2012-2017 Vít Ondruch. See LICENSE.txt for
|
45
47
|
further details.
|
46
48
|
|
data/config/ruby_event.conf
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
EVENT=post-create analyzer=Ruby
|
2
2
|
abrt-action-analyze-python
|
3
3
|
|
4
|
+
# Send micro report
|
5
|
+
EVENT=report_uReport analyzer=Ruby
|
6
|
+
/usr/libexec/abrt-action-ureport
|
7
|
+
|
4
8
|
EVENT=report_Bugzilla analyzer=Ruby
|
5
9
|
test -f component || abrt-action-save-package-data
|
6
10
|
reporter-bugzilla -b -c /etc/libreport/plugins/bugzilla.conf
|
data/lib/abrt.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
at_exit do
|
2
|
+
exception = $!
|
3
|
+
|
2
4
|
# Do not report every exception:
|
3
5
|
# SystemExit - raised by Kernel#exit call
|
4
6
|
# Interrupt - typically issued because the user pressed Ctrl+C
|
5
|
-
if
|
6
|
-
|
7
|
-
ABRT.handle_exception(
|
7
|
+
if exception and ![SystemExit, Interrupt].include?(exception.class)
|
8
|
+
require_relative 'abrt/handler'
|
9
|
+
ABRT.handle_exception(exception)
|
8
10
|
end
|
9
11
|
end
|
10
12
|
|
data/lib/abrt/exception.rb
CHANGED
@@ -13,7 +13,7 @@ module ABRT
|
|
13
13
|
# Obtains executable name from backtrace. This should be more reliable then
|
14
14
|
# use of $0 aka $PROGRAM_NAME.
|
15
15
|
def executable
|
16
|
-
backtrace.last[/(.*?):/, 1]
|
16
|
+
backtrace && backtrace.last && backtrace.last[/(.*?):/, 1] || $PROGRAM_NAME
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
data/lib/abrt/handler.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'socket'
|
2
2
|
require 'syslog'
|
3
|
-
|
3
|
+
require_relative 'exception'
|
4
4
|
|
5
5
|
module ABRT
|
6
6
|
|
@@ -10,7 +10,7 @@ module ABRT
|
|
10
10
|
syslog.notice "detected unhandled Ruby exception in '#{exception.executable}'"
|
11
11
|
|
12
12
|
# Report only scripts with absolute path.
|
13
|
-
write_dump(exception) if exception.
|
13
|
+
write_dump(exception) if exception.executable[0, 1] == '/'
|
14
14
|
end
|
15
15
|
|
16
16
|
private
|
@@ -19,22 +19,24 @@ private
|
|
19
19
|
@syslog ||= Syslog.open 'abrt'
|
20
20
|
end
|
21
21
|
|
22
|
-
def self.report(exception, io =
|
22
|
+
def self.report(exception, io = nil)
|
23
|
+
io ||= abrt_socket
|
24
|
+
|
23
25
|
io.write "PUT / HTTP/1.1\r\n\r\n"
|
24
26
|
io.write "PID=#{Process.pid}\0"
|
25
|
-
io.write "EXECUTABLE=#{exception.executable}\0"
|
27
|
+
io.write "EXECUTABLE=#{exception.executable.gsub(/\u0000/, '')}\0"
|
26
28
|
io.write "ANALYZER=Ruby\0"
|
27
29
|
io.write "TYPE=Ruby\0"
|
28
30
|
io.write "BASENAME=rbhook\0"
|
29
|
-
io.write "REASON=#{exception.format.first}\0"
|
30
|
-
io.write "BACKTRACE=#{exception.format.join("\n")}\0"
|
31
|
+
io.write "REASON=#{exception.format.first.gsub(/\u0000/, '')}\0"
|
32
|
+
io.write "BACKTRACE=#{exception.format.join("\n").gsub(/\u0000/, '')}\0"
|
31
33
|
io.close_write
|
32
34
|
|
33
35
|
yield io.read
|
34
36
|
|
35
37
|
io.close
|
36
38
|
rescue StandardError => e
|
37
|
-
syslog.err "can't communicate with ABRT daemon, is it running? #{e.message}"
|
39
|
+
syslog.err "%s", "can't communicate with ABRT daemon, is it running? #{e.message}"
|
38
40
|
end
|
39
41
|
|
40
42
|
def self.write_dump(exception)
|
@@ -49,7 +51,7 @@ private
|
|
49
51
|
(not code) or
|
50
52
|
(code >= 400)
|
51
53
|
then
|
52
|
-
syslog.err "error sending data to ABRT daemon: #{response}"
|
54
|
+
syslog.err "%s", "error sending data to ABRT daemon: #{response}"
|
53
55
|
end
|
54
56
|
end
|
55
57
|
end
|
@@ -59,8 +61,8 @@ private
|
|
59
61
|
VAR_RUN = '/var/run'
|
60
62
|
ABRT_SOCKET_PATH = File.join VAR_RUN, 'abrt/abrt.socket'
|
61
63
|
|
62
|
-
def self.abrt_socket
|
63
|
-
UNIXSocket.new
|
64
|
+
def self.abrt_socket(path = ABRT_SOCKET_PATH)
|
65
|
+
UNIXSocket.new path
|
64
66
|
end
|
65
67
|
|
66
68
|
end
|
metadata
CHANGED
@@ -1,50 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abrt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vít Ondruch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIDNDCCAhygAwIBAgIBADANBgkqhkiG9w0BAQUFADBAMREwDwYDVQQDDAh2b25k
|
14
|
-
cnVjaDEXMBUGCgmSJomT8ixkARkWB3Rpc2NhbGkxEjAQBgoJkiaJk/IsZAEZFgJj
|
15
|
-
ejAeFw0xMzA1MDMxMzAxMTdaFw0xNDA1MDMxMzAxMTdaMEAxETAPBgNVBAMMCHZv
|
16
|
-
bmRydWNoMRcwFQYKCZImiZPyLGQBGRYHdGlzY2FsaTESMBAGCgmSJomT8ixkARkW
|
17
|
-
AmN6MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAncN0MmV/yPenbHDQ
|
18
|
-
zdds08rxdMV+wxefWw5J0rJtHJ6K/YXyvaJIGUmhas5G1aMao06d3k2eo31ouv7l
|
19
|
-
NJgwEpLgtkY2SymJlWJcnVW4nAALuAEMAqlXA4rMdr/AiWWfQio8SI+f5iAz4eeH
|
20
|
-
FzSsWoGVApdW+KCPh3RrUeZdaKcXJvVBjOH39QSY0wZcnb2J60TphqgF7jx2Ofpf
|
21
|
-
QrBcD8MUD03xOFVXA1FZjEPyDkYKHElYcdZh8U2ZRAcHj+BiefaYQHg5eFbfIdma
|
22
|
-
JNuijda6JNyavokhMPQ7ibaB6oDYxjTzbWTgPZJwEDq5z4nZYmynXwxudxgSlmSG
|
23
|
-
4ZPqXwIDAQABozkwNzAJBgNVHRMEAjAAMB0GA1UdDgQWBBSVtjoVmQK/PkQOwue1
|
24
|
-
qIXjLS7rjjALBgNVHQ8EBAMCBLAwDQYJKoZIhvcNAQEFBQADggEBAD4F4/e0PnRD
|
25
|
-
T2pmeCZbNK6yuGs9AAjQlekvkruN8Ck4/mcvMZUxC46rMk2jr8jGnQ3sClwUttUA
|
26
|
-
D+cud/XD3p1k5058DpTZddAAWI6f6XNssQiVVW4XCQpwlPHhAsPzll0R3n9iSxn0
|
27
|
-
GRU6V7ftlvwpFdU7UMCr8meuDax/r2k5l0jYDYfvZd6M+TMZD5rFaWy7duBgo2lF
|
28
|
-
MsEhUGw96Wk/RKtXAqIaz1kkg90Anr/bLv9+gnUkDFhaw9I31X50kpFIpypHiJOI
|
29
|
-
zPwVLWf9qPrCLgldbnK0hrfRF18e82pCH4xutYwpjjwm25we11cuPjUwnk28M6ZW
|
30
|
-
QwJ1VezDtIo=
|
31
|
-
-----END CERTIFICATE-----
|
32
|
-
date: 2013-10-22 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-06-22 00:00:00.000000000 Z
|
33
12
|
dependencies:
|
34
13
|
- !ruby/object:Gem::Dependency
|
35
14
|
name: rspec
|
36
15
|
requirement: !ruby/object:Gem::Requirement
|
37
16
|
requirements:
|
38
|
-
- - ~>
|
17
|
+
- - "~>"
|
39
18
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
19
|
+
version: '3.5'
|
41
20
|
type: :development
|
42
21
|
prerelease: false
|
43
22
|
version_requirements: !ruby/object:Gem::Requirement
|
44
23
|
requirements:
|
45
|
-
- - ~>
|
24
|
+
- - "~>"
|
46
25
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
26
|
+
version: '3.5'
|
48
27
|
description: Provides ABRT reporting support for libraries/applications written using
|
49
28
|
Ruby.
|
50
29
|
email: v.ondruch@tiscali.cz
|
@@ -52,15 +31,15 @@ executables: []
|
|
52
31
|
extensions: []
|
53
32
|
extra_rdoc_files:
|
54
33
|
- LICENSE.txt
|
55
|
-
- README.
|
34
|
+
- README.md
|
56
35
|
files:
|
57
36
|
- LICENSE.txt
|
58
|
-
- README.
|
37
|
+
- README.md
|
59
38
|
- Rakefile
|
39
|
+
- config/ruby_event.conf
|
40
|
+
- lib/abrt.rb
|
60
41
|
- lib/abrt/exception.rb
|
61
42
|
- lib/abrt/handler.rb
|
62
|
-
- lib/abrt.rb
|
63
|
-
- config/ruby_event.conf
|
64
43
|
homepage: http://github.com/voxik/abrt-ruby
|
65
44
|
licenses:
|
66
45
|
- MIT
|
@@ -71,17 +50,16 @@ require_paths:
|
|
71
50
|
- lib
|
72
51
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
52
|
requirements:
|
74
|
-
- -
|
53
|
+
- - ">="
|
75
54
|
- !ruby/object:Gem::Version
|
76
55
|
version: '0'
|
77
56
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
57
|
requirements:
|
79
|
-
- -
|
58
|
+
- - ">="
|
80
59
|
- !ruby/object:Gem::Version
|
81
60
|
version: '0'
|
82
61
|
requirements: []
|
83
|
-
|
84
|
-
rubygems_version: 2.0.12
|
62
|
+
rubygems_version: 3.1.2
|
85
63
|
signing_key:
|
86
64
|
specification_version: 4
|
87
65
|
summary: ABRT support for Ruby.
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
metadata.gz.sig
DELETED