Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
119 lines (98 sloc) 3.91 KB
require "rubygems"
require "rake/gempackagetask"
require "rake/rdoctask"
require "spec"
require "spec/rake/spectask" do |t|
t.spec_opts = %w(--format specdoc --colour)
t.libs = ["spec"]
task :default => ["spec"]
# This builds the actual gem. For details of what all these options
# mean, and other ones you can add, check the documentation here:
spec = do |s|
# Change these as appropriate = "musicbrainz_automatcher"
s.version = "0.1.0"
s.summary = "musicbrainz_automatcher matches artists/tracks names to MusicBrainz intelligently" = "Patrick Sinclair" = ""
s.homepage = ""
s.has_rdoc = true
s.extra_rdoc_files = %w(README)
s.rdoc_options = %w(--main README)
# Add any extra files to include in the gem
s.files = %w(README) + Dir.glob("{spec,lib/**/*}")
s.require_paths = ["lib"]
# If you want to depend on other gems, add them here, along with any
# relevant versions
s.add_dependency("Text", "~> 1.1")
s.add_dependency("rbrainz", "~> 0.5")
s.add_dependency("activesupport", "~> 2.3")
# If your tests use any gems, include them here
# If you want to publish automatically to rubyforge, you'll may need
# to tweak this, and the publishing task below too.
s.rubyforge_project = "musicbrainz_automatcher"
# This task actually builds the gem. We also regenerate a static
# .gemspec file, which is useful if something (i.e. GitHub) will
# be automatically building a gem for this project. If you're not
# using GitHub, edit as appropriate. do |pkg|
pkg.gem_spec = spec
# Generate the gemspec file for github.
file = File.dirname(__FILE__) + "/#{}.gemspec", "w") {|f| f << spec.to_ruby }
# Generate documentation do |rd|
rd.main = "README"
rd.rdoc_files.include("README", "lib/**/*.rb")
rd.rdoc_dir = "rdoc"
desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package] do
rm "#{}.gemspec"
# If you want to publish to RubyForge automatically, here's a simple
# task to help do that. If you don't, just get rid of this.
# Be sure to set up your Rubyforge account details with the Rubyforge
# gem; you'll need to run `rubyforge setup` and `rubyforge config` at
# the very least.
require "rake/contrib/sshpublisher"
namespace :rubyforge do
desc "Release gem and RDoc documentation to RubyForge"
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
namespace :release do
desc "Release a new version of this gem"
task :gem => [:package] do
require 'rubyforge'
rubyforge =
rubyforge.userconfig['release_notes'] = spec.summary
path_to_gem = File.join(File.dirname(__FILE__), "pkg", "#{}-#{spec.version}.gem")
puts "Publishing #{}-#{spec.version.to_s} to Rubyforge..."
rubyforge.add_release(spec.rubyforge_project,, spec.version.to_s, path_to_gem)
desc "Publish RDoc to RubyForge."
task :docs => [:rdoc] do
config = YAML.load('~/.rubyforge/user-config.yml'))
host = "#{config['username']}"
remote_dir = "/var/www/gforge-projects/musicbrainz_automatcher/" # Should be the same as the rubyforge project name
local_dir = 'rdoc', remote_dir, local_dir).upload
rescue LoadError
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."