Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (64 sloc) 1.7 KB
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 $0.match(/1\.9$/) # use gem1.9 if we used rake1.9
# NOTE: the functional tests assume MongoDB is running.
desc "Test the MongoDB Ruby driver."
task :test do
Rake::Task['test:unit'].invoke
Rake::Task['test:functional'].invoke
end
namespace :test do
Rake::TestTask.new(:unit) do |t|
t.test_files = FileList['test/unit/*_test.rb']
t.verbose = true
end
Rake::TestTask.new(:functional) do |t|
t.test_files = FileList['test/test*.rb']
t.verbose = true
end
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('html')
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 <<EOS
#{gem_command} build mongo-ruby-driver.gemspec &&
sudo #{gem_command} install mongo-*.gem &&
rm mongo-*.gem
EOS
end
desc "Install the optional c extensions"
task :install_extensions do
sh <<EOS
#{gem_command} build mongo-extensions.gemspec &&
sudo #{gem_command} install mongo_ext-*.gem &&
rm mongo_ext-*.gem
EOS
end
end
task :default => :list
task :list do
system 'rake -T'
end
Something went wrong with that request. Please try again.