RubyGems post-install hook

Discussion in 'Ruby' started by Alex Gutteridge, Jul 21, 2006.

  1. Hi,

    I'm trying to package a Ruby library using Gems but have run into the
    problem of needing to execute some post-install commands a la setup.rb.
    Searching the archives brought this up from Dec 2004:

    http://makeashorterlink.com/?N1E21217D

    Am I right in thinking that RubyGems doesn't support these kind of
    post-install hooks? Are there any plans to in the future?

    As a proof of concept I knocked together a hacked rubygems which uses
    the SerializableProc class from Ruby Quiz 38
    (http://www.rubyquiz.com/quiz38.html) to allow something like this to
    work:

    require 'rubygems'

    spec = Gem::Specification.new do |s|
    s.name = "test"
    s.version = "0.2.1"
    s.summary = "A test"

    #....yadda...yadda....

    #This proc gets stored in the gem and called after installation
    s.post_install_proc =
    SerializableProc.new %q{ system("echo 'I ran'") }

    end

    It's buggy as hell, but with a bit of cleaning is essentially all I
    would need for my purposes.

    --
    Alex Gutteridge <-u.ac.jp>
     
    Alex Gutteridge, Jul 21, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Dybdahl Ahle

    distutils install-data-hook

    Thomas Dybdahl Ahle, Sep 14, 2007, in forum: Python
    Replies:
    0
    Views:
    277
    Thomas Dybdahl Ahle
    Sep 14, 2007
  2. Trevor
    Replies:
    5
    Views:
    601
    Bill Kelly
    Jan 29, 2005
  3. Replies:
    7
    Views:
    139
    Margarita Tomova
    Feb 20, 2008
  4. Trans

    RubyGems pre/post install

    Trans, Mar 25, 2007, in forum: Ruby
    Replies:
    5
    Views:
    146
    Eric Hodel
    Mar 27, 2007
  5. Luis Saffie

    git post-receive service hook gem

    Luis Saffie, Oct 29, 2010, in forum: Ruby
    Replies:
    0
    Views:
    160
    Luis Saffie
    Oct 29, 2010
Loading...

Share This Page