A basic structure for ruby gems. To setup a new project, run:
mkdir myproject cd myproject curl -sLS https://raw.github.com/rcarver/gembase/master/init.sh | sh
You can also use this to convert an existing project. The script will overwrite any existing files, but git will show you the diff.
gembase projects conform to the following rules:
- README.md exists
- CHANGELOG.md is formatted as
git-changelogwould do it (
brew install git-extras)
- lib/project.rb exists
- lib/project/version.rb contains a
- project.gemspec exists
- Gemfile contains "gemspec", such that dependencies are defined in project.gemspec
- Gemfile.lock is in .gitignore
rakeruns the full test suite
rake runruns a server if applicable
rake releaseensures an up-to-date gemspec and CHANGELOG, sets a git tag based on
VERSION(a rubyforge project is not assumed). and pushes those changes.
Gembase makes it trivial to tag and release new versions of your code. A release here simply means a tagged version at GitHub, along with information in the CHANGELOGE.md.
Please note that at this time Gembase does not push anything to rubygems This could be added but must not be a requirement for Gembase conformance.
- Ensure that the code you wish to release is on the
- Update the VERSION string, found in
rake release. The changelog will open for editing in your $EDITOR. Make any necessary changes (typically set the version number and edit the commit messages), then save and close the file.
- That's it. Gembase will tag and push a commit including the VERSION and CHANGELOG changes.
Rakefile.base defines most tasks for you. At the minimum, your Rakefile should look something like this:
load 'Rakefile.base' # define :test task and whatever else you want.
Keeping up to date with the latest rake tasks is easy.
If you don't want gembase to bootstrap your entire project but would like to use its conventions rake tasks, just grab Rakefile.base and load it up.
curl -sO https://raw.github.com/rcarver/gembase/master/Rakefile.base
Gembase was created to keep Typekit's internal gems consistent. It was written by Ryan Carver and Matt Colyer.