With the transition from RubyForge to Gemcutter, I along with many other rubyists made the transition from using hoe to jeweler.
One of the features of hoe I missed was the ability to produce announcement emails when releasing gems.
Ad_agency is a simple gem to help fill that hole.
In your rake file for a jeweler project you should have something like:
require 'jeweler' Jeweler::Tasks.new do |gem| # ruby code to initialize your gem spec end Jeweler::GemcutterTasks.new
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
Add the following after the line requiring jeweler require 'lib/ad_agency'
or you can replace that line since ad_agency requires jeweler itself
Updating History.txt from your git log
To regenerate your History.txt file from your git log run
This will produce a history file from your git commit history, in reverse chronological order
The commit matching each git tag will be preceded by a line like this
In addition if a tag for the version in the VERSION file doesn't exist, the History file will start as if the tag v<version> existed.
This allows the history file to reflect what it will be if rake release were issued next, since jeweler tags the the commit this way.
Generating an announcement
To produce an announcement run the rake task:
rake advertise:email_body -s
Running this task prints an announcement to stdout, the -s option supresses noise from rake.
I don't (yet?) support actually sending the email, for my use (on a Mac) I pipe the output into pbcopy and paste it as an email body in my email client.
The output is in the following form:
Announcing <<gem name>> version <<major>>.<<minor>>.<<patch>> <<gem summary>>
—— End of output —–
<<gem name>>, <<gem summary>>, and <<gem description>> are those set by the gem specification in your RAKEFILE.
<<major>>, <<minor>>, and <<patch>> are set from the contents of your VERSION file, which is managed by the jeweler version rake tasks.
If you have a History.txt file in your project it will be used to produce the changes section. It expects the sections of the History.txt file to be separated by lines which match the regular expression:
Or one or more initial equal signs followed by a major.minor.patch version number. The History.txt file is copied to the announcement up to but not including the first separator line with a different major and minor version from the current version.
Copyright © 2010 Rick DeNatale. See LICENSE for details.