class Scooter::Commands::App

Public Instance Methods

run() click to toggle source
# File lib/scooter/commands/app.rb, line 6
def run
  Scooter.ui.verbose("Executing the `#{name}` command.")

  begin
    if options['version']
      app = ::Marathon::App.version(options['id'], options['name'])
    else
      app = ::Marathon::App.get(options['id'])
    end

    if options['json']
      Scooter.ui.info(app.info_to_json)
    else
      Scooter.ui.info(app.to_pretty_s)
    end
  rescue ::Marathon::Error::NotFoundError => e
    Scooter.ui.warn(e)
  end
  
  Scooter.ui.verbose("Execution of `#{name}` command has completed.")
end