SimpleGem

Description

SimpleGem is a gem to help quickly generate a ruby gem project ready to build, test, and deploy.

Installation

sudo gem install kelredd-simple-gem --source=http://gems.github.com

Usage

$ simple-gem my-gem

This will create a gem structure under the ‘./my-gem’. The command is pretty forgiving with the name you supply, it will automatically transform anything that is camelcased into something more ruby-like. If you have an existing gem structure, it will just add/overwrite where necessary and not remove anything.

After generating your gem, go ahead and add information about your gem to both the Rakefile and README.rdoc files. The default version number is “0.1.0”, but if you want to change that, take a look at lib/my_gem/version.rb to make the change - this will automatically be picked up when you rebuild your gem.

Your new gem provides some Rake tasks for convenience:

  • rake gem - Build the gem and drop it into the pkg/ directory for installation.

  • rake test - The default test task, it will run the tests in test. If this is a newly-created gem, your tests will flunk.

  • rake features - a rake task to run any cucumber features you have defined.

  • rake gemspec - Generate my_gem.gemspec file to use if you’re serving your gem (via Github or your own server).

That’s it. Enjoy.

Acceptance Testing

# clone this repo
$ gem install jeremymcanally-context
$ gem install mhennemeyer-matchy
$ rake test

Credit

Many thanks to Patrick Reagan ([email protected]) who is the original author of this gem. The source and credit is largely his. I simply forked his source on Github and extended it for my purposes. The original source can be found here: github.com/reagent/simple-gem/tree/master.

License

Copyright © 2008-2009 Kelly Redding ([email protected]) and Patrick Reagan ([email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.