小编Lau*_*man的帖子

如何加快Ruby/Rake任务的速度

rake --tasks需要大约18秒才能运行.这只是加载所有任务所需的时间,因此我定义的任何任务至少需要花费这么多时间才能运行:

$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
Run Code Online (Sandbox Code Playgroud)

我的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
Run Code Online (Sandbox Code Playgroud)

知道为什么耙子花了很多次?谢谢

ruby rake sinatra

8
推荐指数
2
解决办法
3009
查看次数

标签 统计

rake ×1

ruby ×1

sinatra ×1