README.markdown in jeweler-1.3.0 vs README.markdown in jeweler-1.4.0

- old
+ new

@@ -1,40 +1,40 @@ # Jeweler: Craft the perfect RubyGem Jeweler provides two things: * Rake tasks for managing gems and versioning of a <a href="http://github.com">GitHub</a> project - * A generator for creating kickstarting a new project + * A generator for creating/kickstarting a new project ## Quick Links * [Wiki](http://wiki.github.com/technicalpickles/jeweler) + * [Mailing List](http://groups.google.com/group/jeweler-rb) * [Bugs](http://github.com/technicalpickles/jeweler/issues) * [Donate](http://pledgie.org/campaigns/2604) ## Installing # Install the gem: sudo gem install jeweler - + ## Using in an existing project It's easy to get up and running. Update your Rakefile to instantiate a `Jeweler::Tasks`, and give it a block with details about your project. begin require 'jeweler' Jeweler::Tasks.new do |gemspec| gemspec.name = "the-perfect-gem" - gemspec.summary = "Summarize your gem" - gemspec.description = "Describe your gem" + gemspec.summary = "One line summary of your gem" + gemspec.description = "A different and possibly longer explanation of" gemspec.email = "josh@technicalpickles.com" gemspec.homepage = "http://github.com/technicalpickles/the-perfect-gem" - gemspec.description = "TODO" gemspec.authors = ["Josh Nichols"] end rescue LoadError - puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" + puts "Jeweler not available. Install it with: sudo gem install jeweler" end The yield object here, `gemspec`, is a `Gem::Specification` object. See the [Customizing your project's gem specification](http://wiki.github.com/technicalpickles/jeweler/customizing-your-projects-gem-specification) for more details about how you can customize your gemspec. ## Using to start a new project @@ -43,15 +43,15 @@ jeweler the-perfect-gem This will prepare a project in the 'the-perfect-gem' directory, setup to use Jeweler. -It supports a number of options: +It supports a number of options. Here's a taste, but `jeweler --help` will give you the most up-to-date listing: * --create-repo: in addition to preparing a project, it create an repo up on GitHub and enable RubyGem generation * --testunit: generate test_helper.rb and test ready for test/unit - * --minitest: generate test_helper.rb and test ready for minitest + * --minitest: generate test_helper.rb and test ready for minitest * --shoulda: generate test_helper.rb and test ready for shoulda (this is the default) * --rspec: generate spec_helper.rb and spec ready for rspec * --bacon: generate spec_helper.rb and spec ready for bacon * --gemcutter: setup releasing to gemcutter * --rubyforge: setup releasing to rubyforge @@ -70,65 +70,100 @@ This creates a gemspec for your project. It's based on the info you give `Jeweler::Tasks`, the current version of your project, and some defaults that Jeweler provides. ## Gem -Jeweler gives you tasks for building and installing your gem: +Jeweler gives you tasks for building and installing your gem. + rake install + +To build the gem (which will end up in `pkg`), run: + rake build + +To install the gem (and build if necessary), i.e. using gem install, run: + rake install +Note, this does not use `sudo` to install it, so if your ruby setup needs that, you should prefix it with sudo: + + sudo rake install + ## Versioning Jeweler tracks the version of your project. It assumes you will be using a version in the format `x.y.z`. `x` is the 'major' version, `y` is the 'minor' version, and `z` is the patch version. Initially, your project starts out at 0.0.0. Jeweler provides Rake tasks for bumping the version: rake version:bump:major rake version:bump:minor rake version:bump:patch -## Releasing to GitHub +You can also programmatically set the version if you wish. Typically, you use this to have a module with the version info so clients can access it. The only downside here is you no longer can use the version:bump tasks. + require File.dirname(__FILE__) + "/lib/my_project/version.rb" + + Jeweler::Tasks.new do |gemspec| + gemspec.version = MyProject::VERSION + # more stuff + end + +### Prerelease versioning + +Major, minor, and patch versions have a distant cousin: build. You can use this to add an arbitrary (or you know, regular type) version. This is particularly useful for prereleases. + +You have two ways of doing this: + + * Use `version:write` and specify `BUILD=pre1` + * Edit VERSION by hand to add a fourth version segment + +Jeweler does not provide a `version:bump:build` because the build version can really be anything, so it's hard to know what should be the next bump. + +## Releasing + Jeweler handles releasing your gem into the wild: rake release It does the following for you: * Regenerate the gemspec to the latest version of your project - * Push to GitHub (which results in a gem being build) - * Tag the version and push to GitHub + * git pushes to origin/master branch + * git tags the version and pushes to the origin remote -## Releasing to Gemcutter +As is though, it doesn't actually get your gem anywhere. To do that, you'll need to use rubyforge or gemcutter. +### Releasing to Gemcutter + Jeweler can also handle releasing to [Gemcutter](http://gemcutter.org). There are a few steps you need to do before doing any Gemcutter releases with Jeweler: * [Create an account on Gemcutter](http://gemcutter.org/sign_up) - * Install the Gemcutter gem: sudo gem install gemcutter - * Run 'gemcutter tumble' to set up RubyGems to use gemcutter as the default source + * Install the Gemcutter gem: gem install gemcutter + * Run 'gem tumble' to set up RubyGems to use gemcutter as the default source if you haven't already * Update your Rakefile to make an instance of `Jeweler::GemcutterTasks` A Rakefile setup for gemcutter would include something like this: begin require 'jeweler' - Jeweler::Tasks.new do |gem| - # ommitted for brevity + Jeweler::Tasks.new do |gemspec| + # omitted for brevity end Jeweler::GemcutterTasks.new rescue LoadError puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler" end -With all that setup out of the way, you can now release to Gemcutter with impunity. This would release the current version of your gem. +After you have configured this, `rake release` will now also release to Gemcutter. +If you need to release it without the rest of the release task, you can run: + $ rake gemcutter:release -## Releasing to RubyForge +### Releasing to RubyForge Jeweler can also handle releasing to [RubyForge](http://rubyforge.org). There are a few steps you need to do before doing any RubyForge releases with Jeweler: * [Create an account on RubyForge](http://rubyforge.org/account/register.php) * Request a project on RubyForge. @@ -142,13 +177,13 @@ A Rakefile setup for rubyforge would include something like this: begin require 'jeweler' - Jeweler::Tasks.new do |s| + Jeweler::Tasks.new do |gemspec| # ommitted for brevity - s.rubyforge_project = 'the-perfect-gem' # This line would be new + gemspec.rubyforge_project = 'the-perfect-gem' # This line would be new end Jeweler::RubyforgeTasks.new do |rubyforge| rubyforge.doc_task = "rdoc" end @@ -158,16 +193,16 @@ Now you must initially create a 'package' for your gem in your RubyForge 'project': $ rake rubyforge:setup -With all that setup out of the way, you can now release to RubyForge with impunity. This would release the current version of your gem, and upload the rdoc as your project's webpage. +After you have configured this, `rake release` will now also release to RubyForge. +If you need to release it without the rest of the release task, you can run: + $ rake rubyforge:release -## Release Workflow +## Development and Release Workflow * Hack, commit, hack, commit, etc, etc * `rake version:bump:patch release` to do the actual version bump and release - * Have a delicious scotch - * Install [gemstalker](http://github.com/technicalpickles/gemstalker), and use it to know when gem is built. It typically builds in a few minutes, but won't be installable for another 15 minutes. - + * Have a delicious beverage (I suggest scotch)