Creating a rubygem - a story and help request

Discussion in 'Ruby' started by Phrogz, Nov 25, 2007.

  1. Phrogz

    Phrogz Guest

    The Story
    I decided that it is finally time for me to stop just putting .rb
    files on my own server, and instead start hosting them as gems.
    (Mostly because I now have one library that relies on another, and I
    need them installed in some common spot for require to work cleanly.)

    So, last night I googled "rubygems create gem gemspec" and the second
    hit was:
    http://rubygems.org/read/chapter/5
    which says "This is a skimpy overview; see the DeveloperGuide for the
    real meat."

    But I couldn't figure out what the DeveloperGuide is, so I googled
    "rubygems DeveloperGuide wiki", and the first hit was:
    http://osdir.com/ml/lang.ruby.gems.devel/2006-06/msg00044.html
    ....
    which is a post from 1.5 years ago by Jim Weirich saying:
    "The wiki is totally decommissioned. I should see if there is a way
    for Tom to disable it."

    OK, so apparently I was looking at bad data. That's not uncommon. I
    decided to start at the source. I go to rubygems.org and...well, you
    can go there and see that it has a link to the same documentation I
    was seeing previously.

    I googled for "DeveloperGuide site:rubygems.org" and found 5 hits that
    all refered to the absent DeveloperGuide.

    I look around on the rubygems.org site in the other documentation. The
    FAQ surprisingly (to me) doesn't have an entry on how to create a
    gemspec. The gemspec reference is a reference, about as useful for
    creating a gemspec as a dictionary is useful for learning how to write
    an English paper.

    The Request
    Help! How do I create a gem? I know that once I do, and upload it to
    rubyforge, that it will magically be available to all. But first I
    need to create one, and...I'm stumped.

    The Request II
    Hey rubygems developers, please put up a simple HOWTO that walks
    someone through the basics of creating their first gem. Preferably,
    put it in prominent locations on your website, in the places where
    Google is bound to land. Please, clean up the documentation to remove
    references to DeveloperGuide, or hotlink the existing link to
    something useful.
     
    Phrogz, Nov 25, 2007
    #1
    1. Advertising

  2. Phrogz

    Bil Kleb Guest

    Phrogz wrote:
    >
    > Help! How do I create a gem? I know that once I do, and upload it to
    > rubyforge, that it will magically be available to all. But first I
    > need to create one, and...I'm stumped.


    When I went through this process the first time, I used the Pick Axe
    chapter written by Chad Fowler and browsed gem specs I found online
    for Hoe, Rake, and the like.

    The next time, I tried Dr. Nic's newgem, but it was overwhelming.

    Now, I use 'sow' that comes with the Hoe gem to create a nice,
    minimalistic gem skeleton, e.g.,

    $ sudo gem install hoe
    $ sow gem_of_gems
    creating project gem_of_gems
    ... done, now go fix all occurrences of 'FIX'

    GemOfGems/Rakefile:9: # p.author = 'FIX'
    GemOfGems/Rakefile:10: # p.email = 'FIX'
    GemOfGems/Rakefile:11: # p.summary = 'FIX'
    GemOfGems/README.txt:2: by FIX (your name)
    GemOfGems/README.txt:3: FIX (url)
    GemOfGems/README.txt:7:FIX (describe your package)
    GemOfGems/README.txt:11:* FIX (list of features or problems)
    GemOfGems/README.txt:15: FIX (code sample of usage)
    GemOfGems/README.txt:19:* FIX (list of requirements)
    GemOfGems/README.txt:23:* FIX (sudo gem install, anything else)
    GemOfGems/README.txt:29:Copyright (c) 2007 FIX

    I leaned on topfunky's blog post to get going:

    http://nubyonrails.com/articles/tutorial-publishing-rubygems-with-hoe

    Regards,
    --
    Bil Kleb
    http://fun3d.larc.nasa.gov
     
    Bil Kleb, Nov 25, 2007
    #2
    1. Advertising

  3. Phrogz

    Phrogz Guest

    Phrogz, Nov 26, 2007
    #3
  4. Phrogz

    7stud -- Guest

    Gavin Kistner wrote:
    > The Request
    > Help! How do I create a gem? I know that once I do, and upload it to
    > rubyforge, that it will magically be available to all. But first I
    > need to create one, and...I'm stumped.
    >


    pickaxe2, Chapter 17 has a section titled: Creating Your Own Gems. I
    haven't read it yet, so I don't know how helpful it is. It's 10 pages
    long.
    --
    Posted via http://www.ruby-forum.com/.
     
    7stud --, Nov 26, 2007
    #4
  5. Phrogz

    Phrogz Guest

    On Nov 25, 10:01 pm, 7stud -- <> wrote:
    > Gavin Kistner wrote:
    > > The Request
    > > Help! How do I create a gem? I know that once I do, and upload it to
    > > rubyforge, that it will magically be available to all. But first I
    > > need to create one, and...I'm stumped.

    >
    > pickaxe2, Chapter 17 has a section titled: Creating Your Own Gems. I
    > haven't read it yet, so I don't know how helpful it is. It's 10 pages
    > long.


    So it does. I'll read through that, but I maintain that Rubygems
    should not rely on a 3rd party must-buy book to document what ought to
    be described on their website.
     
    Phrogz, Nov 26, 2007
    #5
  6. Welcome to the apparent nature of learning important Ruby libs. :)

    Take a look around for some solid docs on Rails. You probably won't
    find anything outside of the RDocs, which aren't sufficient in a lot
    of cases. Though these kinds of docs are being worked on for Rails, I
    think that's just the nature of the beast for other libs until someone
    takes it upon themselves to create something.

    I didn't realize RubyGems lacked something like that; it may be worth
    creating at least a quick reference...

    --Jeremy

    On Nov 26, 2007 9:30 AM, Phrogz <> wrote:
    > On Nov 25, 10:01 pm, 7stud -- <> wrote:
    > > Gavin Kistner wrote:
    > > > The Request
    > > > Help! How do I create a gem? I know that once I do, and upload it to
    > > > rubyforge, that it will magically be available to all. But first I
    > > > need to create one, and...I'm stumped.

    > >
    > > pickaxe2, Chapter 17 has a section titled: Creating Your Own Gems. I
    > > haven't read it yet, so I don't know how helpful it is. It's 10 pages
    > > long.

    >
    > So it does. I'll read through that, but I maintain that Rubygems
    > should not rely on a 3rd party must-buy book to document what ought to
    > be described on their website.
    >
    >




    --
    http://www.jeremymcanally.com/

    My books:
    Ruby in Practice
    http://www.manning.com/mcanally/

    My free Ruby e-book
    http://www.humblelittlerubybook.com/

    My blogs:
    http://www.mrneighborly.com/
    http://www.rubyinpractice.com/
     
    Jeremy McAnally, Nov 26, 2007
    #6
  7. Phrogz

    Marc Heiler Guest

    > So it does. I'll read through that, but I maintain that Rubygems
    > should not rely on a 3rd party must-buy book to document what ought to
    > be described on their website.


    No, you are 100% right on this. And I state this while saying that
    Pickaxe2 was one of the best computer-related books I ever bought and
    read.

    This is why I appreciate noobkit, because it provides good online
    documentation which is freely accessible.
    --
    Posted via http://www.ruby-forum.com/.
     
    Marc Heiler, Nov 26, 2007
    #7
  8. Phrogz

    thefed Guest

    On Nov 26, 2007, at 9:30 AM, Phrogz wrote:
    >
    > So it does. I'll read through that, but I maintain that Rubygems
    > should not rely on a 3rd party must-buy book to document what ought to
    > be described on their website.
    >


    That section is pretty good, but I found that it is easiest with hoe
    (or echoe, haven't does that one yet). I chose to use hoe for my two
    gems because I found a really nice example of how to do it :)

    Here it is:
    http://www.nimblecode.com/files/hoetalk.pdf

    Have fun!

    -Ari Brown
     
    thefed, Nov 26, 2007
    #8
  9. Jaime Iniesta, Nov 27, 2007
    #9
  10. Phrogz

    Bil Kleb Guest

    Jaime Iniesta wrote:
    >
    > Hi! I'm also trying to make my first Ruby gem. I've read that Hoe PDF, but
    > what about the newgem gem?


    From my earlier post:

    "The next time, I tried Dr. Nic's newgem, but it was overwhelming."

    The amount of files it produced was more than my little
    brain could handle.

    Regards,
    --
    Bil Kleb
    http://fun3d.larc.nasa.gov
     
    Bil Kleb, Nov 27, 2007
    #10
  11. Phrogz

    Eric Hodel Guest

    On Nov 26, 2007, at 07:53 AM, Jeremy McAnally wrote:
    > On Nov 26, 2007 9:30 AM, Phrogz <> wrote:
    >> On Nov 25, 10:01 pm, 7stud -- <> wrote:
    >>> Gavin Kistner wrote:
    >>>> The Request
    >>>> Help! How do I create a gem? I know that once I do, and upload it
    >>>> to
    >>>> rubyforge, that it will magically be available to all. But first I
    >>>> need to create one, and...I'm stumped.
    >>>
    >>> pickaxe2, Chapter 17 has a section titled: Creating Your Own
    >>> Gems. I
    >>> haven't read it yet, so I don't know how helpful it is. It's 10
    >>> pages
    >>> long.

    >>
    >> So it does. I'll read through that, but I maintain that Rubygems
    >> should not rely on a 3rd party must-buy book to document what ought
    >> to
    >> be described on their website.

    >
    > Welcome to the apparent nature of learning important Ruby libs. :)
    >
    > Take a look around for some solid docs on Rails. You probably won't
    > find anything outside of the RDocs, which aren't sufficient in a lot
    > of cases. Though these kinds of docs are being worked on for Rails, I
    > think that's just the nature of the beast for other libs until someone
    > takes it upon themselves to create something.
    >
    > I didn't realize RubyGems lacked something like that; it may be worth
    > creating at least a quick reference...


    I could easily throw a quickref under `gem help` somewhere.
     
    Eric Hodel, Nov 28, 2007
    #11
    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. Brian Birtle
    Replies:
    2
    Views:
    2,099
    John Saunders
    Oct 16, 2003
  2. Steve Wagner

    ASP.Net horrow story and questions...

    Steve Wagner, Oct 17, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    542
    Michiel
    Feb 17, 2005
  3. Corban Brook
    Replies:
    1
    Views:
    92
    Andreas S.
    Mar 7, 2006
  4. sebwin
    Replies:
    0
    Views:
    97
    sebwin
    Jan 15, 2008
  5. Johny Goerend
    Replies:
    3
    Views:
    204
    Brian Candler
    Sep 27, 2010
Loading...

Share This Page