Hi Vit,

I'd rather use 'Ruby' as value of the analyzer field. If the analyzer field is 
set to 'Python' the ABRT believes that the backtrace field contains a python 
backtrace. A new analyzer/type needs a proper configuration of events, 
therefore I prepared a patch that changes the analyzer value to 'Ruby' and 
adds a configuration file.

(I changed rubygem-abrt.spec because the configuration file must be installed 
to /etc/libreport/events.d/).

The patches are attached.


Regards
Jakub


On Monday 09 of July 2012 15:47:51 Vít Ondruch wrote:
> Hi,
> 
> Updated ABRT gem version 0.0.2 is available at RubyGems.org if you like
> to test it. I'd love to hear some feedback.
> 
> There were done following changes:
> 
> * Improved code base
> * Better handling of some edge cases, such as call to Kernel#exit or
> Ctrl+C event
> * Test suite added
> * Improved documentation
> 
> I also prepared RPM for Fedora. Review is available at
> https://bugzilla.redhat.com/show_bug.cgi?id=838568
> 
> 
> Vit
--- rubygem-abrt.spec.old	2012-07-10 11:32:27.292788337 +0200
+++ rubygem-abrt.spec	2012-07-10 11:19:24.903770490 +0200
@@ -47,6 +47,8 @@ gem install --local --install-dir .%{gem
 mkdir -p %{buildroot}%{gem_dir}
 cp -a .%{gem_dir}/* \
         %{buildroot}%{gem_dir}/
+mkdir -p %{buildroot}%{_sysconfdir}/libreport/events.d/
+ln -s %{gem_instdir}/config/ruby_event.conf %{buildroot}%{_sysconfdir}/libreport/events.d/
 
 %check
 pushd .%{gem_instdir}
@@ -62,6 +64,8 @@ popd
 %{gem_libdir}
 %exclude %{gem_cache}
 %{gem_spec}
+%config(noreplace) %{gem_instdir}/config/*
+%{_sysconfdir}/libreport/events.d/*
 
 %files doc
 %doc %{gem_docdir}
>From a3f747c8aedb2198144ac51e12d7966929ccdf7b Mon Sep 17 00:00:00 2001
From: Jakub Filak <[email protected]>
Date: Tue, 10 Jul 2012 10:30:11 +0200
Subject: [PATCH] Use 'Ruby' string as a value of the analyzer field

---
 abrt.gemspec              |    1 +
 config/ruby_event.conf    |   10 ++++++++++
 lib/abrt/handler.rb       |    4 +---
 spec/abrt_handler_spec.rb |    2 +-
 4 files changed, 13 insertions(+), 4 deletions(-)
 create mode 100644 config/ruby_event.conf

diff --git a/abrt.gemspec b/abrt.gemspec
index 0e6c586..2ca474c 100644
--- a/abrt.gemspec
+++ b/abrt.gemspec
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
     "README.rdoc",
     "Rakefile",
     Dir["lib/**/*"],
+    Dir["config/*"],
   ].flatten
   s.homepage = "http://github.com/voxik/abrt-ruby";
   s.licenses = ["MIT"]
diff --git a/config/ruby_event.conf b/config/ruby_event.conf
new file mode 100644
index 0000000..7c6e24f
--- /dev/null
+++ b/config/ruby_event.conf
@@ -0,0 +1,10 @@
+EVENT=post-create analyzer=Ruby
+        abrt-action-analyze-python
+
+EVENT=report_Bugzilla analyzer=Ruby
+        test -f component || abrt-action-save-package-data
+        reporter-bugzilla -b -c /etc/libreport/plugins/bugzilla.conf
+
+# Reporting of Ruby exceptions
+EVENT=report-gui analyzer=Ruby
+        report-gtk -e report_Bugzilla -- "$DUMP_DIR"
diff --git a/lib/abrt/handler.rb b/lib/abrt/handler.rb
index a9fd4c3..03729e1 100644
--- a/lib/abrt/handler.rb
+++ b/lib/abrt/handler.rb
@@ -24,9 +24,7 @@ private
     io.write "PUT / HTTP/1.1\r\n\r\n"
     io.write "PID=#{Process.pid}\0"
     io.write "EXECUTABLE=#{$PROGRAM_NAME}\0"
-    # TODO: Do we need specialized Ruby analyzer?
-    # io.write "ANALYZER=Ruby\0"
-    io.write "ANALYZER=Python\0"
+    io.write "ANALYZER=Ruby\0"
     io.write "BASENAME=rbhook\0"
     io.write "REASON=#{backtrace.first}\0"
     io.write "BACKTRACE=#{backtrace.join("\n")}\0"
diff --git a/spec/abrt_handler_spec.rb b/spec/abrt_handler_spec.rb
index ad759a7..bf4a68a 100644
--- a/spec/abrt_handler_spec.rb
+++ b/spec/abrt_handler_spec.rb
@@ -33,7 +33,7 @@ describe "ABRT" do
       io.string.should == "PUT / HTTP/1.1\r\n\r\n" +
         "PID=#{Process.pid}\u0000" +
         "EXECUTABLE=/usr/bin/rspec\u0000" +
-        "ANALYZER=Python\u0000" +
+        "ANALYZER=Ruby\u0000" +
         "BASENAME=rbhook\u0000" +
         "REASON=/foo/bar.rb:3:in `block in func': baz (RuntimeError)\u0000" +
         "BACKTRACE=/foo/bar.rb:3:in `block in func': baz (RuntimeError)\n" +
-- 
1.7.10.4

Reply via email to