rails--rails/actionpack/Rakefile

41 lines
790 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require "rake/testtask"
test_files = FileList["test/**/*_test.rb"]
2013-07-14 18:51:15 +00:00
desc "Default Task"
2016-08-06 17:35:13 +00:00
task default: :test
task :package
# Run the unit tests
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = test_files
2008-09-10 18:03:32 +00:00
t.warning = true
2012-02-03 13:01:24 +00:00
t.verbose = true
t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
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 || raise("Failures")
end
end
2011-09-22 11:52:52 +00:00
task :lines do
load File.expand_path("../tools/line_statistics", __dir__)
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"