0
我在宙斯的定制计划,在那里我运行一些rake任务是这样的:Rails弹簧配置与Zeus类似吗?
require 'zeus/rails'
class CustomPlan < Zeus::Rails
def rots
`bundle exec rots 1> log/rots.log &`
end
def stripe_mock
`bundle exec stripe-mock-server 1> log/stripe-mock-server.log &`
end
end
Zeus.plan = CustomPlan.new
和宙斯配置:
{
"command": "ruby -rubygems -r./custom_plan -eZeus.go",
"plan": {
"boot": {
"default_bundle": {
"development_environment": {
"prerake": {"rake": []},
"console": ["c"]
},
"test_environment": {
"test_helper": {"test": ["rspec"]}
}
},
"rots": {},
"stripe_mock": {}
}
}
}
而且我发现这个链接:https://github.com/rails/spring#configuration,但我不正确理解我可以如何运行和停止我的自定义佣金任务。
我尝试它是这样的:
class CustomPlan
def initialize
`bundle exec rots 1> log/rots.log &`
`bundle exec stripe-mock-server 1> log/stripe-mock-server.log &`
end
end
CustomPlan.new
这个工作,但是当我通过spring stop
停止春天,stripe-mock-server
没有关闭。
这是在春季运行和停止自定义耙的一些聪明的解决方案吗?
感谢