require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test it!' Rake::TestTask.new(:test) do |t| t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate RDoc documentation' Rake::RDocTask.new(:rdoc) do |rdoc| files = ['README', 'LICENSE', 'lib/**/*.rb'] rdoc.rdoc_files.add(files) rdoc.main = "README" # page to start on rdoc.title = "ambition" rdoc.template = File.exists?(t="/Users/chris/ruby/projects/err/rock/template.rb") ? t : "/var/www/rock/template.rb" rdoc.rdoc_dir = 'doc' # rdoc output folder rdoc.options << '--inline-source' end desc 'Generate coverage reports' task :rcov do `rcov -e gems test/*_test.rb` puts 'Generated coverage reports.' end begin require 'rubygems' gem 'echoe', '=1.3' ENV['RUBY_FLAGS'] = "" require 'echoe' Echoe.new('ambition', '0.1.0') do |p| p.rubyforge_name = 'err' p.summary = "Ambition builds SQL from plain jane Ruby." p.description = "Ambition builds SQL from plain jane Ruby." p.url = "http://errtheblog.com/" p.author = 'Chris Wanstrath' p.email = "chris@ozmm.org" p.extra_deps << ['ParseTree', '=2.0.1'] p.extra_deps << ['activerecord', '>=1.15.0'] end rescue LoadError => boom puts "You are missing a dependency required for meta-operations on this gem." puts "#{boom.to_s.capitalize}." end