Project

General

Profile

Actions

Feature #8566

open

[PATCH] Allow to configure additional preludes

Added by vo.x (Vit Ondruch) over 11 years ago. Updated almost 10 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:55630]

Description

Could you please accept the patch [1], which adds new '--with-prelude' configuration option. This configuration option allows to specify additional preludes and compile it into prelude.c, therefore execute the code on each start of Ruby.

= Rationale

In Fedora/RHEL/CentOS, there is ABRT tool [2], which allows to automatically report program failures. I developed abrt gem [3, 4], which adds support for catching of unhandled Ruby exceptions, this in turns help improve the quality of Fedora and software we ship.

Every Ruby programmer could require this gem and it would report the bugs, however, there is no way how to convince everybody, that they should use abrt gem. Therefore, it would make more sense, if the gem is automatically loaded by Ruby itself, when it is available on system. For that, I could patch Ruby, but I think somebody else could benefit from this feature as well, hence I am proposing this patch to upstream.

JFYI, Motohiro Kosaki once proposed to add ABRT support to Ruby [5], but I think it would be far better if Ruby knows nothing about ABRT by default and we could solve it on distribution level.

Thanks for considering.

[1] https://github.com/voxik/ruby/commit/efcca5238cf0804275e76d99a599190250d9dd0c
[2] https://fedorahosted.org/abrt/
[3] http://rubygems.org/gems/abrt
[4] https://github.com/voxik/abrt-ruby
[5] https://github.com/kosaki/ruby/commit/6283017dc2747f306808ce530292dc51273746ec

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Status changed from Open to Feedback
  • Priority changed from Normal to 3

rubygems/defaults/operating_system.rb is just for that purpose, I think.

Updated by vo.x (Vit Ondruch) almost 10 years ago

Actually, this is good idea. The downside is that it will not work with --disable-gems I believe (although the abrt-ruby library is a gem ;).

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Status changed from Feedback to Closed

Exactly, but what you need is a way to load the gem, isn't it?

Updated by vo.x (Vit Ondruch) almost 10 years ago

  • Status changed from Closed to Open

Unfortunately placing something like:

begin
  require 'abrt'
rescue LoadError
end

into operating_system.rb does not work, because operating_system is loaded before RubyGems are initialized and the Ruby's require is replaced by RubyGems counterpart.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0