Don't depend on hoe anymore. We'll roll our own rake tasks

This commit is contained in:
Bryan Helmkamp 2008-11-05 18:34:56 -05:00
parent f1bf1013c9
commit 5d8a47fc39
1 changed files with 16 additions and 31 deletions

View File

@ -1,43 +1,30 @@
require 'rubygems' require 'rubygems'
require 'hoe'
require 'spec' require 'spec'
require 'spec/rake/spectask' require 'spec/rake/spectask'
require 'spec/rake/verify_rcov'
require './lib/webrat.rb' require './lib/webrat.rb'
Hoe.new('webrat', Webrat::VERSION) do |p| # Hoe.new('webrat', Webrat::VERSION) do |p|
p.rubyforge_name = 'webrat' # p.rubyforge_name = 'webrat'
p.summary = 'Ruby Acceptance Testing for Web applications' # p.summary = 'Ruby Acceptance Testing for Web applications'
#
p.developer "Bryan Helmkamp", "bryan@brynary.com" # p.developer "Bryan Helmkamp", "bryan@brynary.com"
p.developer "Seth Fitzsimmons", "seth@mojodna.net" # p.developer "Seth Fitzsimmons", "seth@mojodna.net"
#
p.description = p.paragraphs_of('README.txt', 4..6).join("\n\n") # p.description = p.paragraphs_of('README.txt', 4..6).join("\n\n")
p.url = p.paragraphs_of('README.txt', 1).first.split("\n").first.strip # p.url = p.paragraphs_of('README.txt', 1).first.split("\n").first.strip
p.changes = p.paragraphs_of('History.txt', 0..3).join("\n\n") # p.changes = p.paragraphs_of('History.txt', 0..3).join("\n\n")
#
p.extra_deps << ["hpricot", ">= 0.6"] # p.extra_deps << ["hpricot", ">= 0.6"]
#
p.remote_rdoc_dir = '' # Release to root # p.remote_rdoc_dir = '' # Release to root
end # end
desc "Upload rdoc to brynary.com" desc "Upload rdoc to brynary.com"
task :publish_rdoc => :docs do task :publish_rdoc => :docs do
sh "scp -r doc/ brynary.com:/apps/uploads/webrat" sh "scp -r doc/ brynary.com:/apps/uploads/webrat"
end end
Rake::TaskManager.class_eval do
def remove_task(task_name)
@tasks.delete(task_name.to_s)
end
end
def remove_task(task_name)
Rake.application.remove_task(task_name)
end
remove_task "test"
remove_task "test_deps"
desc "Run API and Core specs" desc "Run API and Core specs"
Spec::Rake::SpecTask.new do |t| Spec::Rake::SpecTask.new do |t|
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
@ -54,12 +41,10 @@ Spec::Rake::SpecTask.new(:rcov) do |t|
end end
end end
require 'spec/rake/verify_rcov'
RCov::VerifyTask.new(:verify_rcov => :rcov) do |t| RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
t.threshold = 96.2 # Make sure you have rcov 0.7 or higher! t.threshold = 96.2 # Make sure you have rcov 0.7 or higher!
end end
remove_task "default"
task :default do task :default do
Rake::Task["verify_rcov"].invoke Rake::Task["verify_rcov"].invoke
end end