require 'rubygems' require 'bundler' Bundler::GemHelper.install_tasks require 'spec/rake/spectask' desc 'Creates database for examples' task :populate_db do require 'fileutils' pwd = File.dirname __FILE__ db = "#{pwd}/examples/database.db" sh %{sqlite3 #{db} < #{pwd}/examples/database.sql} FileUtils.cp db, "#{pwd}/examples/active_record_example/database.db" FileUtils.cp db, "#{pwd}/examples/data_mapper_example/database.db" FileUtils.cp db, "#{pwd}/examples/sequel_example/database.db" end task :default => :spec desc 'Run specs' Spec::Rake::SpecTask.new(:spec) do |st| st.libs = ['lib', 'spec'] st.spec_files = FileList['spec/**/*_spec.rb'] st.spec_opts = ['--format specdoc', '--color'] end desc 'Run rcov' Spec::Rake::SpecTask.new(:rcov) do |rct| rct.libs = ['lib', 'spec'] rct.rcov = true rct.rcov_opts = ['-x gems', '-x usr', '-x spec'] rct.spec_files = FileList['spec/**/*.rb'] rct.spec_opts = ['--format specdoc', '--color'] end