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
沒有關閉。
這是在春季運行和停止自定義耙的一些聰明的解決方案嗎?
感謝