Dr Nic

New Gem Generator gets RSpec [video]

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:

Related posts:

  1. Hacking someone’s gem with github and gemcutter Ever used a rubygem, found a bug, and just...
  2. Future proofing your Ruby code. Ruby 1.9.1 is coming. Bugger. I’m a Ruby monogamist. I use the Ruby...
  3. newgem 1.0.0 all thanks to Cucumber The New Gem Generator (newgem) was exciting, moderately revolutionary, and...
  4. RubiGen video from RejectConf Berlin Go straight to video below I took a video recorder...
  5. RejectConf tonight – RailsConfEurope 2007 Tonight only. Live in Berlin. One show only. RejectConf. Woohoo!...

4 Responses to “New Gem Generator gets RSpec [video]”

  1. Chris says:

    Hi,

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

  2. Dr Nic says:

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

  3. Orion says:

    Hi Nick,

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

    Orion

  4. erik Scheirer says:

    Looks very interesting – video wasn’t working though.

    I am trying this out, see how it goes. One thing I would offer so far: the page looks a little odd with the little scrollable div in the middle of the page, which has the content I was actually looking for. I would make it taller and wider …

    Thanks for the great work, I am really happy you’ve put this out there!