[Rubygems-developers] Executing code after installing gem

Eric Hodel drbrain at segment7.net
Tue Nov 25 22:17:34 EST 2008

On Nov 25, 2008, at 04:39 AM, Matt King wrote:
> 2008/11/25 Luis Lavena <luislavena at gmail.com>:
>>> Well because it's not something a user will execute at the CLI,  
>>> it's a
>>> required executable by the gem itself in order for some  
>>> functionality
>>> to work.
>> By required executable you mean a binary? Or you're calling/shelling
>> out to another ruby script that you bundle?
>> If you provide more information (ala: details) will be much more easy
>> for us to contribute ideas to proper implement this without guessing
>> :-)
> Alright, so the gem is a Rails app that gets symlinked from several
> directories. The app uses background_job (bj), and in the gem there is
> a jobs/ folder. background_job requires all of these files within this
> directory to be world executable. And it must live in the jobs/
> folder. It never gets executed by a user at the CLI, but when a job is
> submitted via the Rails app, it spins it off using the corresponding
> files in this folder.

That's a shame, if they are all ruby scripts there's no need to chmod  
them, bj could execute them directly via system like:

   system "#{Gem.ruby} path/to/my/script"

More information about the Rubygems-developers mailing list