我想在custom_plan.rb中添加一个自定义的zeus命令,用于启动solr/sunspot,并使其在zeus启动时为测试/开发环境自动启动。
我目前正在使用rake任务为两个实例运行solr:
rake sunspot:solr:start RAILS_ENV=test; rake sunspot:solr:start RAILS_ENV=development我想把这个作为命令添加到zeus custom_plan.rb中:
require 'zeus/rails'
class CustomPlan < Zeus::Rails
def solr
# something like this?
# Sunspot::Rails::Server.new.start
end
end
Zeus.plan = CustomPlan.new发布于 2013-10-26 07:32:51
我找到了一种使用guard-太阳黑子插件的方法。
将gem 'guard-sunspot‘添加到您的Gemfile中,并将其添加到Guardfile中:
guard 'sunspot', :environment => 'test' do
watch('Gemfile.lock')
watch('config/sunspot.yml')
endhttps://stackoverflow.com/questions/17275480
复制相似问题