2009-11-09 06:31:59 -05:00
|
|
|
dir = File.dirname(__FILE__)
|
|
|
|
require "#{dir}/lib/active_model/version"
|
2009-08-31 20:09:16 -04:00
|
|
|
|
|
|
|
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
|
|
|
PKG_NAME = 'activemodel'
|
|
|
|
PKG_VERSION = ActiveModel::VERSION::STRING + PKG_BUILD
|
|
|
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
|
|
|
RELEASE_NAME = "REL #{PKG_VERSION}"
|
|
|
|
|
|
|
|
|
2008-06-28 02:29:47 -04:00
|
|
|
require 'rake/testtask'
|
2008-05-16 01:29:55 -04:00
|
|
|
|
2008-06-28 02:29:47 -04:00
|
|
|
task :default => :test
|
|
|
|
|
2009-10-16 14:56:59 -04:00
|
|
|
Rake::TestTask.new do |t|
|
2009-11-09 06:31:59 -05:00
|
|
|
t.libs << "#{dir}/test"
|
|
|
|
t.test_files = Dir.glob("#{dir}/test/cases/**/*_test.rb").sort
|
2009-09-05 20:10:21 -04:00
|
|
|
t.warning = true
|
2008-06-28 02:29:47 -04:00
|
|
|
end
|
2009-08-31 20:09:16 -04:00
|
|
|
|
2009-11-10 19:50:15 -05:00
|
|
|
namespace :test do
|
|
|
|
task :isolated do
|
|
|
|
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
|
|
|
|
Dir.glob("#{dir}/test/**/*_test.rb").all? do |file|
|
|
|
|
system(ruby, '-w', "-I#{dir}/lib", "-I#{dir}/test", file)
|
|
|
|
end or raise "Failures"
|
|
|
|
end
|
2009-05-13 04:10:37 -04:00
|
|
|
end
|
2008-06-28 02:29:47 -04:00
|
|
|
|
2009-08-31 20:09:16 -04:00
|
|
|
|
|
|
|
require 'rake/rdoctask'
|
|
|
|
|
2008-05-16 01:29:55 -04:00
|
|
|
# Generate the RDoc documentation
|
2008-06-28 02:29:47 -04:00
|
|
|
Rake::RDocTask.new do |rdoc|
|
2009-11-09 06:31:59 -05:00
|
|
|
rdoc.rdoc_dir = "#{dir}/doc"
|
2008-05-16 01:29:55 -04:00
|
|
|
rdoc.title = "Active Model"
|
|
|
|
rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
|
|
|
|
rdoc.options << '--charset' << 'utf-8'
|
2008-06-22 13:38:25 -04:00
|
|
|
rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
|
2009-11-09 06:31:59 -05:00
|
|
|
rdoc.rdoc_files.include("#{dir}/README", "#{dir}/CHANGES")
|
|
|
|
rdoc.rdoc_files.include("#{dir}/lib/**/*.rb")
|
2008-06-29 15:13:58 -04:00
|
|
|
end
|
2009-08-31 20:09:16 -04:00
|
|
|
|
|
|
|
|
|
|
|
require 'rake/packagetask'
|
|
|
|
require 'rake/gempackagetask'
|
|
|
|
|
2009-11-09 06:31:59 -05:00
|
|
|
spec = eval(File.read("#{dir}/activemodel.gemspec"))
|
2009-08-31 20:09:16 -04:00
|
|
|
|
|
|
|
Rake::GemPackageTask.new(spec) do |p|
|
|
|
|
p.gem_spec = spec
|
|
|
|
end
|