Class: Foreman::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/foreman/cli.rb

Instance Method Summary collapse

Instance Method Details

#export(format, location = nil) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/foreman/cli.rb', line 33

def export(format, location=nil)
  check_procfile!

  formatter = case format
    when "upstart" then Foreman::Export::Upstart
    when "inittab" then Foreman::Export::Inittab
    else error "Unknown export format: #{format}."
  end

  formatter.new(engine).export(location,
    :name        => options[:app],
    :user        => options[:user],
    :log         => options[:log],
    :concurrency => options[:concurrency]
  )
rescue Foreman::Export::Exception => ex
  error ex.message
end

#start(process = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/foreman/cli.rb', line 14

def start(process=nil)
  check_procfile!
  
  if process
    engine.execute(process)
  elsif options[:screen]
    engine.screen
  else
    engine.start
  end
end