Class: Foreman::CLI
- Inherits:
-
Thor
- Object
- Thor
- Foreman::CLI
- Defined in:
- lib/foreman/cli.rb
Instance Method Summary collapse
- #execute(process, procfile = "Procfile") ⇒ Object
- #export(app, procfile = "Procfile", format = "upstart") ⇒ Object
- #scale(app, process, amount) ⇒ Object
- #screen(procfile = "Procfile") ⇒ Object
- #start(procfile = "Procfile") ⇒ Object
Instance Method Details
#execute(process, procfile = "Procfile") ⇒ Object
18 19 20 21 |
# File 'lib/foreman/cli.rb', line 18 def execute(process, procfile="Procfile") error "#{procfile} does not exist." unless procfile_exists?(procfile) Foreman::Engine.new(procfile).execute(process) end |
#export(app, procfile = "Procfile", format = "upstart") ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/foreman/cli.rb', line 32 def export(app, procfile="Procfile", format="upstart") error "#{procfile} does not exist." unless procfile_exists?(procfile) formatter = case format when "upstart" then Foreman::Export::Upstart else error "Unknown export format: #{format}." end formatter.new(Foreman::Engine.new(procfile)).export(app) end |
#scale(app, process, amount) ⇒ Object
45 46 47 48 49 |
# File 'lib/foreman/cli.rb', line 45 def scale(app, process, amount) config = Foreman::Configuration.new(app) error "No such process: #{process}." unless config.processes[process] config.scale(process, amount) end |