require 'rake/rdoctask' require 'rake/testtask' require "rubygems" require "rake/gempackagetask" task :default => :'test:chase' namespace :test do desc 'Run all tests against all processors. Use LOCATION to specify web service URL.' task :all do %w(chase tsys emergis moneris).each do |processor| 3.times { puts } puts "#-----------------------" puts "# Testing: " + processor puts "#-----------------------" ENV['PROCESSOR'] = processor begin Rake::Task[:'test:processor'].execute rescue # don't care, just run it again. can examine output later end end end desc 'Run all tests against Chase processor and Production web service. Use LOCATION to specify web service URL.' task :chase do ENV['PROCESSOR'] = 'chase' ENV['LOCATION'] = 'PROD' if ENV['LOCATION'].nil? begin Rake::Task[:'test:processor'].execute rescue # don't care, just run it again. can examine output later end end desc 'Run all the tests against a specific processor. Use LOCATION to specify web service URL.' Rake::TestTask.new(:processor) do |t| t.libs << 'lib' t.pattern = 'test/**/*_test.rb' t.verbose = true end end desc "Build the RDoc" Rake::RDocTask.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "exact4r" rdoc.options << '--main' << 'README' << "--inline-source" << "--line-numbers" rdoc.rdoc_files.include('CHANGELOG', 'LICENCE', 'README', 'VERSION', 'lib/**/*.rb') } desc "Build the exact4r gem" spec = Gem::Specification.new do |s| s.name="exact4r" s.author = "E-xact Transactions Ltd." s.homepage = "http://e-xact4r.rubyforge.org/" s.rubyforge_project = "exact4r" s.email = "dredmond@e-xact.com" s.version=`cat VERSION` s.summary = 'E-xact Web Services Client Library.' s.files = FileList["./**/**"].to_a s.has_rdoc = true s.extra_rdoc_files = ['CHANGELOG', 'LICENCE', 'README', 'VERSION'] s.rdoc_options << '--main' << 'README' << '--inline-source' << '--line-numbers' s.add_dependency('activesupport', '>= 2.3.2') s.add_dependency('builder', '>= 2.1.2') end Rake::GemPackageTask.new(spec) do |pkg| pkg.need_tar = true end