Class: Foreman::CLI
Class Method Summary collapse
Instance Method Summary collapse
- #check ⇒ Object
- #export(format, location = nil) ⇒ Object
- #run(*args) ⇒ Object
- #start(process = nil) ⇒ Object
- #version ⇒ Object
Methods included from Helpers
Class Method Details
.is_thor_reserved_word?(word, type) ⇒ Boolean
Hackery. Take the run method away from Thor so that we can redefine it.
29 30 31 32 |
# File 'lib/foreman/cli.rb', line 29 def is_thor_reserved_word?(word, type) return false if word == "run" super end |
Instance Method Details
#check ⇒ Object
65 66 67 68 69 70 |
# File 'lib/foreman/cli.rb', line 65 def check check_procfile! engine.load_procfile(procfile) error "no processes defined" unless engine.processes.length > 0 puts "valid procfile detected (#{engine.process_names.join(', ')})" end |
#export(format, location = nil) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/foreman/cli.rb', line 53 def export(format, location=nil) check_procfile! load_environment! engine.load_procfile(procfile) formatter = Foreman::Export.formatter(format) formatter.new(location, engine, ).export rescue Foreman::Export::Exception => ex error ex. end |
#run(*args) ⇒ Object
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/foreman/cli.rb', line 76 def run(*args) load_environment! begin exec engine.env, args.shelljoin rescue Errno::EACCES error "not executable: #{args.first}" rescue Errno::ENOENT error "command not found: #{args.first}" end end |
#start(process = nil) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/foreman/cli.rb', line 35 def start(process=nil) check_procfile! load_environment! engine.load_procfile(procfile) engine.[:formation] = "#{process}=1" if process engine.start end |