Giter Club home page Giter Club logo

abrt-ruby's Introduction

Build Status

abrt

Provides ABRT reporting support for libraries/applications written using Ruby.

Please note that ABRT will be able to report errors only for applications which are already RPM packaged. Errors in other applications are ignored.

Installation

$ gem install abrt

or if you're using Bundler, put

gem "abrt", :require => false

line into your Gemfile.

Usage

There are several ways how to run any application with ABRT handler enabled.

  1. Use require 'abrt' at the beginning of your application.
  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.
  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.
  4. In Fedora, since ruby-2.0.0.247-9.fc19, Ruby loads abrt gem automatically.

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.

Contributing to abrt

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • 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.

Copyright

Copyright (c) 2012-2017 VĂ­t Ondruch. See LICENSE.txt for further details.

abrt-ruby's People

Contributors

cristifalcas avatar voxik avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

abrt-ruby's Issues

Make sure the test suite runs from linked directory.

  1) ABRT handles exception in 'abrt.rb' with RubyGems disabled
     Failure/Error:
       expect { system "ruby --disable-gems #{abrt_rb}" }
         .to output(/\A\Z/).to_stdout_from_any_process
         .and output(output_message_pattern).to_stderr_from_any_process
     
       expected block to output /\A\/builddir\/abrt-0.4.0\/spec\/..\/lib\/abrt.rb:\d+:in `<main>': can't modify frozen Array(: \[1, 2, 3\])? \((FrozenError|RuntimeError)\)\n\Z/ to stderr, but output "/usr/bin/ruby-mri: No such file or directory -- /builddir/abrt-0.4.0/spec/../lib/abrt.rb (LoadError)\n"
     # ./spec/abrt_spec.rb:9:in `block (3 levels) in <top (required)>'

  2) ABRT handles exception in 'abrt.rb' with RubyGems enabled
     Failure/Error:
       expect { system "ruby --disable-gems -rrubygems #{abrt_rb}" }
         .to output(/\A\Z/).to_stdout_from_any_process
         .and output(output_message_pattern).to_stderr_from_any_process
     
       expected block to output /\A\/builddir\/abrt-0.4.0\/spec\/..\/lib\/abrt.rb:\d+:in `<main>': can't modify frozen Array(: \[1, 2, 3\])? \((FrozenError|RuntimeError)\)\n\Z/ to stderr, but output "/usr/bin/ruby-mri: No such file or directory -- /builddir/abrt-0.4.0/spec/../lib/abrt.rb (LoadError)\n"
     # ./spec/abrt_spec.rb:15:in `block (3 levels) in <top (required)>'

nothing gets created on el6 when running will_ruby_raise

It looks like the gem is working and is loaded, because when I run:

will_ruby_raise

Will raise.
/usr/bin/will_ruby_raise:4:in `/': divided by 0 (ZeroDivisionError)
from /usr/bin/will_ruby_raise:4

I see in /var/log/abrt.log this line:
2014-12-30T07:15:50.806200-05:00 machine.domain abrt[16433]: detected unhandled Ruby exception in '/usr/bin/will_ruby_raise'

But nothing gets created in /var/spool/abrt and no email is sent.

All other tests work (will_cpp_segfault, will_oops, will_python_raise, etc.), so I don't think it's a configuration problem.

rake not found on use case with Bundler

I expected this project worked on Bundler, as I saw Gemfile on the project.

$ ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]

$ bundle install --path vendor/bundle

$ bundle exec rake -T
bundler: failed to load command: rake (/usr/local/ruby-2.7.1/bin/rake)
Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?
  /usr/local/ruby-2.7.1/lib/ruby/2.7.0/bundler/rubygems_integration.rb:374:in `block in replace_bin_path'
  /usr/local/ruby-2.7.1/lib/ruby/2.7.0/bundler/rubygems_integration.rb:402:in `block in replace_bin_path'
  /usr/local/ruby-2.7.1/bin/rake:23:in `<top (required)>'

Do you have a reason not to do like this?

$ git diff
diff --git a/.travis.yml b/.travis.yml
index 0d92a15..9d2c642 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,4 +9,4 @@ rvm:
   - "2.6"
   - "2.7"
   - "ruby-head"
-script: rake
+script: bundle exec rake
diff --git a/abrt.gemspec b/abrt.gemspec
index 7b40c32..f3d33fa 100644
--- a/abrt.gemspec
+++ b/abrt.gemspec
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
     s.cert_chain = ["voxik-public_cert.pem"]
   end
 
+  s.add_development_dependency(%q<rake>)
   s.add_development_dependency(%q<rspec>, ["~> 3.5"])
 end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.