spork可以使用rake任务吗?
答
我知道没有标准的开箱即用解决方案。
Rake没有--drb选项,spork在这里没有帮助。 当然,自定义解决方案是可能的。这将需要扩展耙子。
我认为rake任务的运行并不像测试那么频繁,为什么问题还没有解决。
+0
谢谢。我基本上想要像spin这样的东西(https://github.com/jstorimer/spin),它分叉了一个加载的Rails进程和所有的gem。 – matthuhiggins
答
rake test:units
testdrb -I test/ test/unit/
rake test:functionals
testdrb -I test/ test/functional/
rake test:integration
testdrb -I test/ test/integration/
+0
哦,上帝,我爱你的男人......这是我需要的命令:D – lfzawacki
答
您可以使用irake gem,它可以从控制台执行rake任务。
一下添加到Gemfile中:
gem 'irake'
然后捆绑并启动控制台
$ bundle install
$ rails console
...并等待Rails环境载入(仅一次)。然后,你可以这样做:
rake "db:migrate"
如果要列出的任务,您可以:
Rake::Task.tasks.each{|t| puts t.name }; nil
我加了下面的宙斯(HTTPS我自己的答案:// github上。 COM /伯克/宙斯)。还有DHH正在开发的rails/command gem(https://github.com/rails/commands)。 – matthuhiggins