abrt 0.3.0 → 0.5.0
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.
- checksums.yaml +5 -5
- data/README.md +5 -2
- data/lib/abrt/handler.rb +3 -3
- data/lib/abrt/util_linux_logger.rb +34 -0
- data/lib/abrt.rb +5 -3
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d0b6e26b81e5052b5cf17c7fdea271e206d27612f56a9bd98fec04e4f9a89cf1
|
4
|
+
data.tar.gz: 0e526cc80dc7f85b739af4f7cf8dc4a12ff1dd7de7a7e8167bbd1ce03e073ad1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82a335ae9c7556506936c2fc1bb0cdf0d87e33010b97564905968b6b9d982e3bc853d952ff80cfa95dfad8803ece4c7fd1bbed2e2e9c76280b65288ca461b6de
|
7
|
+
data.tar.gz: adc538512fd0733b8b1ab1faac791dcfc2fa38469d747f0a3b3f7872dc4ef11b196f699a7bc15614e22bb11ea182b25c2c9cfc575d76b1a137e14765335369b9
|
data/README.md
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
[](https://travis-ci.org/voxik/abrt-ruby)
|
2
|
-
|
3
1
|
# abrt
|
4
2
|
|
5
3
|
Provides ABRT reporting support for libraries/applications written using Ruby.
|
@@ -20,6 +18,11 @@ gem "abrt", :require => false
|
|
20
18
|
|
21
19
|
line into your *Gemfile*.
|
22
20
|
|
21
|
+
### Dependencies
|
22
|
+
|
23
|
+
This library is using `logger` command from util-linux for logging purposes.
|
24
|
+
Please make sure it is available on your system for proper functionality.
|
25
|
+
|
23
26
|
## Usage
|
24
27
|
|
25
28
|
There are several ways how to run any application with ABRT handler enabled.
|
data/lib/abrt/handler.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'socket'
|
2
|
-
|
3
|
-
|
2
|
+
require_relative 'util_linux_logger'
|
3
|
+
require_relative 'exception'
|
4
4
|
|
5
5
|
module ABRT
|
6
6
|
|
@@ -16,7 +16,7 @@ module ABRT
|
|
16
16
|
private
|
17
17
|
|
18
18
|
def self.syslog
|
19
|
-
@syslog ||=
|
19
|
+
@syslog ||= UtilLinuxLogger.open 'abrt'
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.report(exception, io = nil)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# UtilLinuxLogger is small utility class intended to be drop in replacement for
|
2
|
+
# Syslog. It uses `logger` command from util-linux project to provide system
|
3
|
+
# logging facilities.
|
4
|
+
#
|
5
|
+
# It implements just minimal interface required by ABRT project.
|
6
|
+
class UtilLinuxLogger
|
7
|
+
# :yields: syslog
|
8
|
+
#
|
9
|
+
# Open the UtilLinuxLoggersyslog facility.
|
10
|
+
#
|
11
|
+
# `ident` is a String which identifies the calling program.
|
12
|
+
def self.open(ident)
|
13
|
+
self.new(ident)
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(ident)
|
17
|
+
@ident = ident
|
18
|
+
end
|
19
|
+
|
20
|
+
def notice(format_string, *arguments)
|
21
|
+
log 'user.notice', format_string, *arguments
|
22
|
+
end
|
23
|
+
|
24
|
+
def err(format_string, *arguments)
|
25
|
+
log 'user.err', format_string, *arguments
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
def log(priority, format_string, *arguments)
|
30
|
+
IO.popen "logger -p #{priority} -t #{@ident} --socket-errors=off", 'w' do |io|
|
31
|
+
io.write sprintf(format_string, *arguments)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
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
|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abrt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vít Ondruch
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-08-01 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rspec
|
@@ -40,11 +39,11 @@ files:
|
|
40
39
|
- lib/abrt.rb
|
41
40
|
- lib/abrt/exception.rb
|
42
41
|
- lib/abrt/handler.rb
|
42
|
+
- lib/abrt/util_linux_logger.rb
|
43
43
|
homepage: http://github.com/voxik/abrt-ruby
|
44
44
|
licenses:
|
45
45
|
- MIT
|
46
46
|
metadata: {}
|
47
|
-
post_install_message:
|
48
47
|
rdoc_options: []
|
49
48
|
require_paths:
|
50
49
|
- lib
|
@@ -59,9 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
58
|
- !ruby/object:Gem::Version
|
60
59
|
version: '0'
|
61
60
|
requirements: []
|
62
|
-
|
63
|
-
rubygems_version: 2.6.10
|
64
|
-
signing_key:
|
61
|
+
rubygems_version: 3.6.2
|
65
62
|
specification_version: 4
|
66
63
|
summary: ABRT support for Ruby.
|
67
64
|
test_files: []
|