2008-03-03 00:35:46 +00:00
|
|
|
require 'rubygems'
|
2008-11-05 23:50:11 +00:00
|
|
|
require "rake/gempackagetask"
|
|
|
|
require "rake/clean"
|
2008-04-28 08:57:46 +00:00
|
|
|
require 'spec'
|
|
|
|
require 'spec/rake/spectask'
|
2008-11-05 23:34:56 +00:00
|
|
|
require 'spec/rake/verify_rcov'
|
2008-03-03 00:35:46 +00:00
|
|
|
require './lib/webrat.rb'
|
2008-03-02 20:14:52 +00:00
|
|
|
|
2008-11-05 23:50:11 +00:00
|
|
|
##############################################################################
|
|
|
|
# Package && release
|
|
|
|
##############################################################################
|
|
|
|
spec = Gem::Specification.new do |s|
|
|
|
|
s.name = "webrat"
|
|
|
|
s.version = Webrat::VERSION
|
|
|
|
s.platform = Gem::Platform::RUBY
|
|
|
|
s.author = "Bryan Helmkamp"
|
|
|
|
s.email = "bryan" + "@" + "brynary.com"
|
|
|
|
s.homepage = "http://github.com/brynary/webrat"
|
|
|
|
s.summary = "Webrat. Ruby Acceptance Testing for Web applications"
|
|
|
|
s.bindir = "bin"
|
|
|
|
s.description = s.summary
|
|
|
|
s.require_path = "lib"
|
|
|
|
s.files = %w(History.txt init.rb install.rb MIT-LICENSE.txt README.txt Rakefile TODO.txt) + Dir["lib/**/*"]
|
|
|
|
|
|
|
|
# rdoc
|
|
|
|
s.has_rdoc = true
|
|
|
|
s.extra_rdoc_files = %w(README.txt MIT-LICENSE.txt)
|
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
s.add_dependency "hpricot", ">= 0.6"
|
|
|
|
end
|
|
|
|
|
|
|
|
Rake::GemPackageTask.new(spec) do |package|
|
|
|
|
package.gem_spec = spec
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Show information about the gem.'
|
|
|
|
task :debug_gem do
|
|
|
|
puts spec.to_ruby
|
|
|
|
end
|
|
|
|
|
|
|
|
CLEAN.include ["pkg", "*.gem", "doc", "ri", "coverage"]
|
2008-03-02 20:14:52 +00:00
|
|
|
|
|
|
|
desc "Upload rdoc to brynary.com"
|
2008-03-03 00:35:46 +00:00
|
|
|
task :publish_rdoc => :docs do
|
|
|
|
sh "scp -r doc/ brynary.com:/apps/uploads/webrat"
|
2008-04-28 08:57:46 +00:00
|
|
|
end
|
|
|
|
|
2008-10-25 16:42:38 +00:00
|
|
|
desc "Run API and Core specs"
|
2008-04-28 08:57:46 +00:00
|
|
|
Spec::Rake::SpecTask.new do |t|
|
|
|
|
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
|
2008-10-25 20:56:06 +00:00
|
|
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
2008-04-28 08:57:46 +00:00
|
|
|
end
|
|
|
|
|
2008-10-25 20:56:06 +00:00
|
|
|
desc "Run all specs in spec directory with RCov"
|
|
|
|
Spec::Rake::SpecTask.new(:rcov) do |t|
|
|
|
|
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
|
|
|
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
|
|
|
t.rcov = true
|
|
|
|
t.rcov_opts = lambda do
|
|
|
|
IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
|
2008-04-28 08:57:46 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2008-10-25 20:56:06 +00:00
|
|
|
RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
|
|
|
|
t.threshold = 96.2 # Make sure you have rcov 0.7 or higher!
|
|
|
|
end
|
|
|
|
|
|
|
|
task :default do
|
|
|
|
Rake::Task["verify_rcov"].invoke
|
|
|
|
end
|