setup.rb and/or gem assist

Discussion in 'Ruby' started by Hal Fulton, Sep 28, 2004.

  1. Hal Fulton

    Hal Fulton Guest

    Hello all...

    I am rather package-phobic and usually just offer a .tgz and a readme.
    But I'm thinking of doing a little more this time.

    I have an app I want to package, and I want to create a gem.

    I *believe* that setup.rb is still required, is it not??

    Anyhow, I have never used setup.rb except to play with it, and I've
    never created a gem.

    Some of my constraints are:

    1. I have libs that are require'd only by this app (i.e., they are
    just separate pieces for convenience). Where should they go, and
    how should I reference them in the app?
    2. Same question for data files and such. Where to put them, how to
    reference them?
    3. Suppose I have a file of marshalled data and want to run a little
    utility program to load it into a .db -- how/when should I do this?

    Any assistance appreciated.


    Thanks,
    Hal
    Hal Fulton, Sep 28, 2004
    #1
    1. Advertising

  2. Hal Fulton

    Jim Weirich Guest

    Hal Fulton said:
    > Hello all...
    >
    > I am rather package-phobic and

    [...]
    > I have an app I want to package, and I want to create a gem.


    There are two steps to creating a gem ...
    1) Create a Gem Specification.
    2) Run: gem builder gemspecfile.

    The hard part is step one where you need to come up with all the metadata.
    A good place to start is:

    http://rubygems.rubyforge.org/wiki/wiki.pl?CreateAGemInTenMinutes

    The page has a gem spec that you can start with an edit to your
    satisfication.

    Or wait till this weekend and we can help you in person!

    --
    -- Jim Weirich http://onestepback.org
    -----------------------------------------------------------------
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
    Jim Weirich, Sep 28, 2004
    #2
    1. Advertising

  3. Hal Fulton

    Hal Fulton Guest

    Jim Weirich wrote:

    > There are two steps to creating a gem ...
    > 1) Create a Gem Specification.
    > 2) Run: gem builder gemspecfile.


    Reminds me of the old recipe for elephant stew. Or -- was it Carl Sagan
    who said, "To make chicken soup from scratch, you must first create the
    universe"?

    > The hard part is step one where you need to come up with all the metadata.
    > A good place to start is:
    >
    > http://rubygems.rubyforge.org/wiki/wiki.pl?CreateAGemInTenMinutes
    >
    > The page has a gem spec that you can start with an edit to your
    > satisfication.


    Yes, I did read that. My questions were all post-RTFM FWIW. One should
    always RTFM ASAP IMHO.

    > Or wait till this weekend and we can help you in person!


    Now there's a thought.

    Really it shouldn't take long. Maybe Thur evening?

    At any rate, I want to make it available no later than my talk. Just in case
    people want to look at it.


    Thanks,
    Hal
    Hal Fulton, Sep 28, 2004
    #3
  4. On Wed, Sep 29, 2004 at 01:17:27AM +0900, Hal Fulton wrote:
    > Hello all...
    >
    > I am rather package-phobic and usually just offer a .tgz and a readme.
    > But I'm thinking of doing a little more this time.


    If you point me to your .tgz, RPA might repackage it for you ;-)

    > I have an app I want to package, and I want to create a gem.
    >
    > I *believe* that setup.rb is still required, is it not??


    RubyGems does not require setup.rb; it needs a "gemspec".

    > Anyhow, I have never used setup.rb except to play with it, and I've
    > never created a gem.
    >
    > Some of my constraints are:
    >
    > 1. I have libs that are require'd only by this app (i.e., they are
    > just separate pieces for convenience). Where should they go, and
    > how should I reference them in the app?


    If they are packaged independently, you can indicate the dependencies.
    You probably want to install them under a common namespace (myapp/).

    > 2. Same question for data files and such. Where to put them, how to
    > reference them?


    There's a problem with RubyGems + datafiles;
    see http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/110665
    and http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/110679

    Data files are normally found under
    File.join:):Config::CONFIG["datadir"], "share")
    but this won't work with RubyGems so you would have to modify your program.

    > 3. Suppose I have a file of marshalled data and want to run a little
    > utility program to load it into a .db -- how/when should I do this?


    A mechanism to run post-installation scripts is being discussed in
    RubyGems' ML. It seems unlikely to be implemented, though, since the
    majority seems to be against it.

    > Any assistance appreciated.


    Just give me a link to the tgz :)

    --
    Running Debian GNU/Linux Sid (unstable)
    batsman dot geo at yahoo dot com
    Mauricio Fernández, Sep 28, 2004
    #4
  5. Hal Fulton

    Chad Fowler Guest

    On Wed, 29 Sep 2004 02:56:29 +0900, Mauricio Fernández
    <> wrote:
    > > 2. Same question for data files and such. Where to put them, how to
    > > reference them?

    >
    > There's a problem with RubyGems + datafiles;


    "problem" is an overstatement, butyou're generally right. It's
    obviously possible, but it requires RubyGems-specific code. A
    standard ruby library that is gems-aware, as you suggest would be a
    way to abstract it. The second option seems like a recipe for
    disaster.

    > see http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/110665
    > and http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/110679
    >
    > Data files are normally found under
    > File.join:):Config::CONFIG["datadir"], "share")
    > but this won't work with RubyGems so you would have to modify your program.
    >
    > > 3. Suppose I have a file of marshalled data and want to run a little
    > > utility program to load it into a .db -- how/when should I do this?

    >
    > A mechanism to run post-installation scripts is being discussed in
    > RubyGems' ML. It seems unlikely to be implemented, though, since the
    > majority seems to be against it.
    >


    I'd say it _is_ likely, actually. RubyConf will be a great time for
    us to discuss some of the ongoing questions and reach resolutions.

    It's also a great time for attendees to contribute ideas, opinions,
    CODE, etc. :) Looking forward to making some big RubyGems progress as
    a result of its first conference-year birthday.

    > > Any assistance appreciated.

    >
    > Just give me a link to the tgz :)
    >


    If not before the conference, catch me when you get there. We'll
    package your app together.

    There's also a chapter in the Pickaxe II that will help (available
    online as a PDF preview).

    Chad
    Chad Fowler, Sep 28, 2004
    #5
  6. [OT] recipes (was: Re: setup.rb and/or gem assist)

    Hi --

    On Wed, 29 Sep 2004, Hal Fulton wrote:

    > Jim Weirich wrote:
    >
    > > There are two steps to creating a gem ...
    > > 1) Create a Gem Specification.
    > > 2) Run: gem builder gemspecfile.

    >
    > Reminds me of the old recipe for elephant stew.


    I wonder whether that's similar to the recipe for cubed moose. I
    suspect it is.


    David

    --
    David A. Black
    David A. Black, Sep 28, 2004
    #6
  7. On Wed, 29 Sep 2004 04:24:45 +0900, Chad Fowler <> wrote:
    > I'd say it _is_ likely, actually. RubyConf will be a great time for
    > us to discuss some of the ongoing questions and reach resolutions.


    Will there be anybody at RubyConf that has experience with packaging
    and/or full operating systems engineering? Neither Mauricio nor I
    will be there.

    If nobody else with large scale experience step up to be the "voice of
    criticism and care", I think making decisions there is a bad idea.

    Eivind.
    Eivind Eklund, Oct 1, 2004
    #7
  8. Hal Fulton

    vruz Guest

    > If nobody else with large scale experience step up to be the "voice of
    > criticism and care", I think making decisions there is a bad idea.


    Especially being Mr Matz absent from it this year...

    Pushing standards for technical excellence is okay, it's great, it's
    at the very core of the opensource philosophy.

    Pushing standards for the sake of it ignoring experienced people,
    ignoring relevant engineering processes: now that sucks, it's
    anti-opensource.

    Proprietary lock-in, land-grabbing, blocking out "competition", and
    defining standards in closed rooms are practices that have NOTHING to
    do with an opensource community.

    This attempt doesn't have ANYTHING to do with the concept of meritocracy.

    It's not only a bad idea, it's a SHAME.

    The decision of what's a standard and what's not a standard in Ruby
    has always been taken by Mr Yukihiro Matsumoto, and it should be kept
    that way.

    I recognise no other authority in the Rubysphere.

    > Eivind.


    --
    --- vruz
    vruz, Oct 1, 2004
    #8
  9. Hi --

    On Sat, 2 Oct 2004, vruz wrote:

    > > If nobody else with large scale experience step up to be the "voice of
    > > criticism and care", I think making decisions there is a bad idea.

    >
    > Especially being Mr Matz absent from it this year...
    >
    > Pushing standards for technical excellence is okay, it's great, it's
    > at the very core of the opensource philosophy.
    >
    > Pushing standards for the sake of it ignoring experienced people,
    > ignoring relevant engineering processes: now that sucks, it's
    > anti-opensource.
    >
    > Proprietary lock-in, land-grabbing, blocking out "competition", and
    > defining standards in closed rooms are practices that have NOTHING to
    > do with an opensource community.


    Open source does not mean that every person in the world is present at
    every coding session. It means the code -- the result of the work of
    a person or group of people -- is open, which is the case of
    RubyGems.

    > This attempt doesn't have ANYTHING to do with the concept of meritocracy.


    I'm not sure it's supposed to. It's a project -- hopefully a good
    project. If you're talking about its possible eventual role in the
    Ruby distribution, that's obviously completely up to Matz.

    > It's not only a bad idea, it's a SHAME.
    >
    > The decision of what's a standard and what's not a standard in Ruby
    > has always been taken by Mr Yukihiro Matsumoto, and it should be kept
    > that way.
    >
    > I recognise no other authority in the Rubysphere.


    Neither does anyone else. This takes us into realms of speculation
    and accusation that are not appropriate and have nothing to do with
    the RubyGems project (or any other that I know of).


    David

    --
    David A. Black
    David A. Black, Oct 1, 2004
    #9
    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. PCC
    Replies:
    1
    Views:
    364
    bruce barker
    Dec 5, 2003
  2. Replies:
    38
    Views:
    10,969
    ricardo.ekm
    Mar 10, 2009
  3. pythonnewbie
    Replies:
    5
    Views:
    2,181
    pythonnewbie
    Oct 12, 2004
  4. Matthew Holton

    Performance Question and .... Please assist

    Matthew Holton, Jan 15, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    105
    Matthew Holton
    Jan 15, 2004
  5. Austin 7873
    Replies:
    5
    Views:
    185
    Eric Hodel
    Jan 27, 2007
Loading...

Share This Page