Class: Foreman::CLI
Class Method Summary collapse
Instance Method Summary collapse
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.
24 25 26 27 |
# File 'lib/foreman/cli.rb', line 24 def is_thor_reserved_word?(word, type) return false if word == 'run' super end |
Instance Method Details
#check ⇒ Object
55 56 57 58 |
# File 'lib/foreman/cli.rb', line 55 def check error "no processes defined" unless engine.procfile.entries.length > 0 puts "valid procfile detected (#{engine.procfile.process_names.join(', ')})" end |
#export(format, location = nil) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/foreman/cli.rb', line 45 def export(format, location=nil) check_procfile! formatter = Foreman::Export.formatter(format) formatter.new(location, engine, ).export rescue Foreman::Export::Exception => ex error ex. end |
#run(*args) ⇒ Object
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/foreman/cli.rb', line 62 def run(*args) engine.apply_environment! begin exec args.join(" ") rescue Errno::EACCES error "not executable: #{args.first}" rescue Errno::ENOENT error "command not found: #{args.first}" end end |
#start ⇒ Object
30 31 32 33 |
# File 'lib/foreman/cli.rb', line 30 def start check_procfile! engine.start end |