New Gem Generator gets RSpec [video]
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.
- Set the version number in
lib/./version.rb - Check your Manifest.txt that it includes all new files (via
rake check_manifest) - Update
History.txtwith changes. The default supported format is 2 paragraphs - a header and group of bullet points; these look nice when converted to rdoc format. - Commit the new version to repository.
- 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.






Hi,
The link to the pdf slides does not work. I get a 404.
@chris - thx - link fixed now (after reload)
Hi Nick,
Is there a way to add some sort of message that will be displayed after my gem is installed.
Orion