New Gem Generator gets RSpec [video]

Posted by Dr Nic on May 27, 2007

slide.007

One day you will be able to write a human description of a RubyGem and it will make it for you. Ok, that’s crap. But the New Gem Generator is doing more and more cooler things lately; so let’s take a peek…

RSpec

For a growing number of people, RSpec is the way to go, over the Test::Unit test suite. Now, thanks to a contribution from Robby Russell and Graeme Nelson during Railsconf.

$ newgem my_cool_gem -t rspec
$ cd my_cool_gem
$ rake  # runs specs

Bonus website

New gems now have a website folder with an index.txt file (redcloth format). Put your glorious promotional materials and tutorials here (plus add additional .txt files as well) and the rake website task will convert them to html files and upload them to your rubyforge website.

The standard template looks like this (you’re encouraged to change some colours or fonts!)

Deploying gems

Ready to release a new X.Y.Z version of your gem? It takes 3 minutes.

  1. Set the version number in lib//version.rb.
  2. Check your Manifest.txt that it includes all new files (via rake check_manifest)
  3. Update History.txt with changes. The default supported format is 2 paragraphs - a header and group of bullet points; these look nice when converted to rdoc format.
  4. Commit the new version to repository.
  5. Deploy/release gem
$ rake deploy VERSION=X.Y.Z

This will release your RubyGem to rubyforge so people can install it; plus upload your website and your rdocs.

You’ll then be prompted to commit a copy of the trunk as a tag REL-X.Y.Z. This could be very useful one day!

Video of NewGem at RejectConf

You can read the pdf slides and/or watch the presentation from RejectConf:

Trackbacks

Use this link to trackback from your own site.

Comments

Leave a response

  1. Chris Sun, 27 May 2007 18:13:57 UTC

    Hi,

    The link to the pdf slides does not work. I get a 404.

  2. Dr Nic Sun, 27 May 2007 18:21:14 UTC

    @chris - thx - link fixed now (after reload)

  3. Orion Thu, 31 May 2007 23:09:55 UTC

    Hi Nick,

    Is there a way to add some sort of message that will be displayed after my gem is installed.

    Orion

Comments