2009-11-09 06:31:59 -05:00
|
|
|
dir = File.dirname(__FILE__)
|
2009-08-31 20:09:16 -04:00
|
|
|
|
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|
|
2010-02-28 19:26:00 -05:00
|
|
|
t.libs << "test"
|
2014-09-05 10:02:48 -04:00
|
|
|
t.test_files = Dir.glob("#{dir}/test/cases/**/*_test.rb").sort
|
2009-09-05 20:10:21 -04:00
|
|
|
t.warning = true
|
2012-02-03 08:01:24 -05:00
|
|
|
t.verbose = true
|
2014-09-27 10:37:44 -04:00
|
|
|
t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
|
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
|
|
|
|
Dir.glob("#{dir}/test/**/*_test.rb").all? do |file|
|
2013-07-26 05:07:25 -04:00
|
|
|
sh(Gem.ruby, '-w', "-I#{dir}/lib", "-I#{dir}/test", file)
|
2009-11-10 19:50:15 -05:00
|
|
|
end or raise "Failures"
|
|
|
|
end
|
2009-05-13 04:10:37 -04:00
|
|
|
end
|
2008-06-28 02:29:47 -04:00
|
|
|
|
2011-05-24 14:08:11 -04:00
|
|
|
require 'rubygems/package_task'
|
2009-08-31 20:09:16 -04:00
|
|
|
|
2009-11-09 06:31:59 -05:00
|
|
|
spec = eval(File.read("#{dir}/activemodel.gemspec"))
|
2009-08-31 20:09:16 -04:00
|
|
|
|
2011-05-24 14:08:11 -04:00
|
|
|
Gem::PackageTask.new(spec) do |p|
|
2009-08-31 20:09:16 -04:00
|
|
|
p.gem_spec = spec
|
|
|
|
end
|
2010-02-04 21:28:45 -05:00
|
|
|
|
2013-06-21 04:57:00 -04:00
|
|
|
desc "Release to rubygems"
|
2010-02-05 03:03:03 -05:00
|
|
|
task :release => :package do
|
|
|
|
require 'rake/gemcutter'
|
|
|
|
Rake::Gemcutter::Tasks.new(spec).define
|
|
|
|
Rake::Task['gem:push'].invoke
|
|
|
|
end
|