2005-01-02 23:16:59 +08:00
|
|
|
require 'rake/testtask'
|
2011-05-25 02:08:11 +08:00
|
|
|
require 'rubygems/package_task'
|
2008-03-18 12:46:51 +08:00
|
|
|
|
2005-01-02 23:16:59 +08:00
|
|
|
task :default => :test
|
2009-09-25 14:16:41 +08:00
|
|
|
Rake::TestTask.new do |t|
|
|
|
|
t.libs << 'test'
|
2005-01-09 23:02:39 +08:00
|
|
|
t.pattern = 'test/**/*_test.rb'
|
2007-10-07 17:15:26 +08:00
|
|
|
t.warning = true
|
2012-02-03 21:01:24 +08:00
|
|
|
t.verbose = true
|
2009-09-25 14:16:41 +08:00
|
|
|
end
|
|
|
|
|
2013-05-29 01:59:55 +08:00
|
|
|
|
2009-09-25 14:16:41 +08:00
|
|
|
namespace :test do
|
2013-05-29 01:59:55 +08:00
|
|
|
task :isolated do
|
|
|
|
ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
|
|
|
|
Dir.glob("test/**/*_test.rb").all? do |file|
|
2013-06-21 20:14:36 +08:00
|
|
|
sh(ruby, '-w', '-Ilib:test', file)
|
2013-05-29 01:59:55 +08:00
|
|
|
end or raise "Failures"
|
2009-09-25 14:16:41 +08:00
|
|
|
end
|
2009-04-23 08:41:28 +08:00
|
|
|
end
|
2005-02-15 23:57:44 +08:00
|
|
|
|
2009-09-25 13:24:34 +08:00
|
|
|
spec = eval(File.read('activesupport.gemspec'))
|
2005-02-15 23:57:44 +08:00
|
|
|
|
2011-05-25 02:08:11 +08:00
|
|
|
Gem::PackageTask.new(spec) do |p|
|
2005-02-15 23:57:44 +08:00
|
|
|
p.gem_spec = spec
|
|
|
|
end
|
|
|
|
|
2013-06-21 16:57:00 +08:00
|
|
|
desc "Release to rubygems"
|
2010-02-05 16:03:03 +08:00
|
|
|
task :release => :package do
|
|
|
|
require 'rake/gemcutter'
|
|
|
|
Rake::Gemcutter::Tasks.new(spec).define
|
|
|
|
Rake::Task['gem:push'].invoke
|
|
|
|
end
|