class Cumuli::CLI

Public Instance Methods

args() click to toggle source
# File lib/cumuli/cli/cli.rb, line 7
def args
  @args ||= Args.new(ARGV.dup)
end
kill_process() click to toggle source
# File lib/cumuli/cli/cli.rb, line 34
def kill_process
  Process.kill('INT', Process.pid)
end
listen_for_signals() click to toggle source
# File lib/cumuli/cli/cli.rb, line 26
def listen_for_signals
  signals.each do |signal|
    Signal.trap(signal) do
      kill_process
    end
  end
end
run() click to toggle source
# File lib/cumuli/cli/cli.rb, line 3
def run
  spawn_app
end
signals() click to toggle source
# File lib/cumuli/cli/cli.rb, line 21
def signals
  # these are the signals used by Foreman
  ['TERM', 'INT', 'HUP']
end
spawn_app() click to toggle source
# File lib/cumuli/cli/cli.rb, line 11
def spawn_app
  listen_for_signals

  Dir.chdir(args.dir) do
    command = Commander.new("foreman start #{args.foreman_options}").build
    puts "starting ... #{command}"
    spawn_terminal(command)
  end
end
spawn_terminal(command) click to toggle source
# File lib/cumuli/cli/cli.rb, line 38
def spawn_terminal(command)
  Terminal.new(command).spawn
end