如何用大神监控重启两个ruby脚本?

how to monitor and restart two ruby scripts with God?

我已经能够 运行 单个 ruby 脚本的单个神文件:

God.watch do |w|
  w.name = "twilio"
  w.start = "ruby ~/code/site/iron.io/twilio-listen.rb"
  w.keepalive
end

但我有两个脚本,希望上帝看着它们(twilio-listen.rb 和 slack-listen.rb)

我该怎么做?

您应该能够在同一个上帝配置文件中为两者指定监视。如果您需要一起停止或重新启动它们,您可能还想添加一个名为 listeners 的组。例如,

God.watch do |w|
  w.name = "twilio"
  w.group = "listeners"
  w.start = "ruby ~/code/site/iron.io/twilio-listen.rb"
  w.keepalive
end

God.watch do |w|
  w.name = "slack"
  w.group = "listeners"
  w.start = "ruby ~/code/site/iron.io/slack-listen.rb"
  w.keepalive
end