4 w.start = File.join(File.dirname(__FILE__), *%w[simple_server.rb])
7 # determine the state on startup
8 w.transition(:init, { true => :up, false => :start }) do |on|
9 on.condition(:process_running) do |c|
14 # determine when process has finished starting
15 w.transition(:start, :up) do |on|
16 on.condition(:process_running) do |c|
21 # start if process is not running
22 w.transition(:up, :start) do |on|
23 on.condition(:process_exits)