2010-11-24 20:03:04 +00:00
|
|
|
#!/usr/bin/env rake
|
2004-11-24 01:04:44 +00:00
|
|
|
require 'rake/testtask'
|
2011-05-24 18:08:11 +00:00
|
|
|
require 'rubygems/package_task'
|
2004-11-24 01:04:44 +00:00
|
|
|
|
|
|
|
require 'date'
|
2005-01-01 18:10:10 +00:00
|
|
|
require 'rbconfig'
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2010-04-26 15:25:07 +00:00
|
|
|
|
2007-09-26 01:24:07 +00:00
|
|
|
task :default => :test
|
2009-11-11 00:50:15 +00:00
|
|
|
task :test => 'test:isolated'
|
2007-09-26 01:24:07 +00:00
|
|
|
|
2006-11-02 03:34:03 +00:00
|
|
|
## This is required until the regular test task
|
|
|
|
## below passes. It's not ideal, but at least
|
|
|
|
## we can see the failures
|
2009-11-11 00:50:15 +00:00
|
|
|
namespace :test do
|
|
|
|
task :isolated do
|
|
|
|
dir = ENV["TEST_DIR"] || "**"
|
2010-06-24 08:56:16 +00:00
|
|
|
Dir["test/#{dir}/*_test.rb"].each do |file|
|
2009-11-11 00:50:15 +00:00
|
|
|
next true if file.include?("fixtures")
|
2011-09-10 02:00:33 +00:00
|
|
|
dash_i = [
|
|
|
|
'test',
|
|
|
|
'lib',
|
|
|
|
"#{File.dirname(__FILE__)}/../activesupport/lib",
|
|
|
|
"#{File.dirname(__FILE__)}/../actionpack/lib"
|
|
|
|
]
|
|
|
|
ruby "-I#{dash_i.join ':'}", file
|
2010-06-24 08:56:16 +00:00
|
|
|
end
|
2009-11-11 00:50:15 +00:00
|
|
|
end
|
2006-11-02 03:34:03 +00:00
|
|
|
end
|
|
|
|
|
2009-11-11 00:50:15 +00:00
|
|
|
Rake::TestTask.new('test:regular') do |t|
|
2009-04-22 23:10:49 +00:00
|
|
|
t.libs << 'test' << "#{File.dirname(__FILE__)}/../activesupport/lib"
|
2006-08-29 09:15:28 +00:00
|
|
|
t.pattern = 'test/**/*_test.rb'
|
|
|
|
t.warning = true
|
|
|
|
t.verbose = true
|
|
|
|
end
|
2005-07-13 02:12:00 +00:00
|
|
|
|
2009-07-02 09:47:03 +00:00
|
|
|
# Update spinoffs -------------------------------------------------------------------
|
2005-07-02 06:23:35 +00:00
|
|
|
|
2010-07-23 19:11:29 +00:00
|
|
|
desc "Updates application README to the latest version Railties README"
|
|
|
|
task :update_readme do
|
|
|
|
readme = "lib/rails/generators/rails/app/templates/README"
|
|
|
|
rm readme
|
|
|
|
cp "./README.rdoc", readme
|
|
|
|
end
|
|
|
|
|
2009-02-06 01:57:02 +00:00
|
|
|
desc 'Generate guides (for authors), use ONLY=foo to process just "foo.textile"'
|
2009-05-16 15:02:43 +00:00
|
|
|
task :generate_guides do
|
2009-03-24 12:15:43 +00:00
|
|
|
ENV["WARN_BROKEN_LINKS"] = "1" # authors can't disable this
|
2009-02-06 01:57:02 +00:00
|
|
|
ruby "guides/rails_guides.rb"
|
|
|
|
end
|
|
|
|
|
2010-05-24 16:07:08 +00:00
|
|
|
# Validate guides -------------------------------------------------------------------------
|
|
|
|
desc 'Validate guides, use ONLY=foo to process just "foo.html"'
|
|
|
|
task :validate_guides do
|
|
|
|
ruby "guides/w3c_validator.rb"
|
|
|
|
end
|
|
|
|
|
2004-11-24 01:04:44 +00:00
|
|
|
# Generate GEM ----------------------------------------------------------------------------
|
|
|
|
|
2009-12-01 00:46:09 +00:00
|
|
|
spec = eval(File.read('railties.gemspec'))
|
2004-11-24 01:04:44 +00:00
|
|
|
|
2011-05-24 18:08:11 +00:00
|
|
|
Gem::PackageTask.new(spec) do |pkg|
|
2006-09-15 09:56:52 +00:00
|
|
|
pkg.gem_spec = spec
|
2004-11-24 01:04:44 +00:00
|
|
|
end
|
|
|
|
|
2005-03-27 13:33:54 +00:00
|
|
|
# Publishing -------------------------------------------------------
|
2009-12-29 11:19:38 +00:00
|
|
|
|
2010-02-05 02:28:45 +00:00
|
|
|
desc "Release to gemcutter"
|
2010-02-05 08:03:03 +00:00
|
|
|
task :release => :package do
|
|
|
|
require 'rake/gemcutter'
|
|
|
|
Rake::Gemcutter::Tasks.new(spec).define
|
|
|
|
Rake::Task['gem:push'].invoke
|
|
|
|
end
|
2005-03-27 13:33:54 +00:00
|
|
|
|
2009-03-05 11:20:00 +00:00
|
|
|
desc "Publish the guides"
|
2009-05-16 15:02:43 +00:00
|
|
|
task :pguides => :generate_guides do
|
2009-05-12 21:21:29 +00:00
|
|
|
require 'rake/contrib/sshpublisher'
|
2009-03-05 11:20:00 +00:00
|
|
|
mkdir_p 'pkg'
|
|
|
|
`tar -czf pkg/guides.gz guides/output`
|
|
|
|
Rake::SshFilePublisher.new("web.rubyonrails.org", "/u/sites/guides.rubyonrails.org/public", "pkg", "guides.gz").upload
|
|
|
|
`ssh web.rubyonrails.org 'cd /u/sites/guides.rubyonrails.org/public/ && tar -xvzf guides.gz && mv guides/output/* . && rm -rf guides*'`
|
2008-06-19 03:34:15 +00:00
|
|
|
end
|