rails--rails/actionpack/Rakefile

53 lines
1.1 KiB
Ruby
Raw Normal View History

require 'rake/testtask'
require 'rubygems/package_task'
test_files = Dir.glob('test/**/*_test.rb')
2013-07-14 18:51:15 +00:00
desc "Default Task"
2009-09-13 17:42:13 +00:00
task :default => :test
# Run the unit tests
Rake::TestTask.new do |t|
t.libs << 'test'
# make sure we include the tests in alphabetical order as on some systems
# this will not happen automatically and the tests (as a whole) will error
t.test_files = test_files.sort
2008-09-10 18:03:32 +00:00
t.warning = true
2012-02-03 13:01:24 +00:00
t.verbose = true
2008-09-10 18:03:32 +00:00
end
namespace :test do
task :isolated do
2013-07-14 18:51:15 +00:00
test_files.all? do |file|
sh(Gem.ruby, '-w', '-Ilib:test', file)
end or raise "Failures"
end
end
2011-09-22 11:52:52 +00:00
spec = eval(File.read('actionpack.gemspec'))
Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
end
2013-06-21 08:57:00 +00:00
desc "Release to rubygems"
task :release => :package do
require 'rake/gemcutter'
Rake::Gemcutter::Tasks.new(spec).define
Rake::Task['gem:push'].invoke
end
2010-02-05 02:28:45 +00:00
task :lines do
load File.expand_path('..', File.dirname(__FILE__)) + '/tools/line_statistics'
files = FileList["lib/**/*.rb"]
CodeTools::LineStatistics.new(files).print_loc
end
rule '.rb' => '.y' do |t|
sh "racc -l -o #{t.name} #{t.source}"
end
task compile: 'lib/action_dispatch/journey/parser.rb'