rake - 任务大约需要18秒才能运行。这仅仅是它需要加载所有任务的时间,因此我定义至少需要这个时间量运行任何任务:如何加速Ruby/Rake任务
$time rake --tasks
rake db:clean # Cleaning up database
rake passenger:restart # Restart Application
rake spec # Run specs
real 0m18.816s
user 0m7.306s
sys 0m5.665s
我的Rakefile:
$: << "."
require "rubygems"
require "rspec/core/rake_task"
desc "Run those specs"
task :spec do
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = %w{--colour --format progress}
t.pattern = 'spec/*_spec.rb'
end
end
task :default => :spec
任何想法为什么耙子需要很多次? 谢谢
这是否发生在空的Rakefile?你能向你展示吗? – 2011-12-17 15:39:30
我的rakefile只包含rpec任务,如您在我的文章中看到 – Laughingman 2011-12-17 15:56:13
您确定您拥有正确的Rakefile吗? 'rake -T'显示一个Passenger重启任务,它没有在Rakefile中定义(或包含)。 – 2011-12-20 23:38:58