Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Sep 09 23:53:46 -0700 2009 | |
| |
LICENSE | Thu Sep 10 00:02:49 -0700 2009 | |
| |
README.rdoc | Sat Oct 03 07:13:13 -0700 2009 | |
| |
tasks/ | Tue Sep 29 11:28:44 -0700 2009 |
This rake tasks file provides tasks to manage the release of gems on Github. It is a single file that can be included in your project, so you do not have to add another dependency to your gem. It uses the information about the gem found in the project’s gemspec file to define relevant tasks.
Getting started
- Make sure that you have a gemspec file in the root of your project.
- Make sure that you have the git gem installed: gem install git.
- Put the github-gem.rake file in the tasks directory of your project
- Include the file in your Rakefile and register the tasks:
load('tasks/github-gem.rake') # Register the gem release tasks in the gem namespace GithubGem::RakeTasks.new(:gem) do |config| # Note that the following values are all default values and can # therefore be omitted if they are not changed. config.gemspec_file = GithubGem.detect_gemspec_file config.main_include = GithubGem.detect_main_include config.root_dir = Dir.pwd config.test_pattern = 'test/**/*_test.rb' config.spec_pattern = 'spec/**/*_spec.rb' config.local_branch = 'master' config.remote = 'origin' config.remote_branch = 'master' end
Release
The rake gem:release VERSION=1.2.3 will release a new version of the gem:
- It will update the version number and date in the gemspec file.
- It will set the files setting in the gemspec file to an array of all the files that are currently in the git repository.
- It will set the test_files setting according to the test_pattern and spec_pattern provided in the configuration.
- It will update the VERSION constant in the main include file of your gem if with the new version number it exists.
- It will update the VERSION file with the new version number if it exists.
- It will commit all these changes to the git repository.
- It will create a tag using the new version number.
- It will push the commit and tag to Github.
- It will release the .gem file on Rubyforge if the .gemspec file contains a rubyforge_project setting. Make sure that you have installed the rubyforge gem (>= 2.0) and configured it properly for this to work.
Release checks
Before the gem will be released, the following checks will be performed:
- Check whether all unit tests pass (if any)
- Check whether all RSpec examples pass (if any)
- Check whether the gem builds successfully.
- Check the validity of the version number (it should be higher than the previous version)
- Check whether the git repository is in clean state and all changes from the remote repository have been pulled.
- Check whether the rubyforge gem is configured properly if the rubyforge_project setting is specified in the gemspec file.
You can invoke these tests without a release by running the rake gem:release_checks VERSION=1.2.3 task.
Test and spec tasks
Note that this gem will also create gem tasks for running the unit tests (if any) and for running the RSpec examples (if any) so that these can be included in the gem release checks.
Self-update
A self-update rake task is included, to download the latest version of the gem management tasks from Github. Run:
rake gem:update_tasks
About
- Written by Willem van Bergen.
- Released under the MIT license (see LICENSE).







