require 'rubygems' require 'rubygems/specification' require 'fileutils' require 'rake' require 'rake/testtask' require 'rake/gempackagetask' begin require 'rake/contrib/rubyforgepublisher' rescue LoadError end require 'rbconfig' include Config gem_command = "gem" gem_command = "gem1.9" if CONFIG["MAJOR"] == "1" && CONFIG["MINOR"] == "9" # NOTE: some of the tests assume Mongo is running Rake::TestTask.new do |t| t.test_files = FileList['tests/test*.rb'] end desc "Generate documentation" task :rdoc do version = eval(File.read("mongo-ruby-driver.gemspec")).version out = File.join('html', version.to_s) FileUtils.rm_rf(out) system "rdoc --main README.rdoc --op #{out} --inline-source --quiet README.rdoc `find lib -name '*.rb'`" end desc "Publish documentation to mongo.rubyforge.org" task :publish => [:rdoc] do # Assumes docs are in ./html Rake::RubyForgePublisher.new(GEM, RUBYFORGE_USER).upload end namespace :gem do desc "Install the gem locally" task :install do sh < :list task :list do system 'rake -T' end