# File lib/heroku/command/apps.rb, line 107
  def create
    remote  = extract_option('--remote', 'heroku')
    stack   = extract_option('--stack', 'aspen-mri-1.8.6')
    timeout = extract_option('--timeout', 30).to_i
    addons  = (extract_option('--addons', '') || '').split(',')
    name    = args.shift.downcase.strip rescue nil
    name    = heroku.create_request(name, {:stack => stack})
    display("Creating #{name}...", false)
    info    = heroku.info(name)
    begin
      Timeout::timeout(timeout) do
        loop do
          break if heroku.create_complete?(name)
          display(".", false)
          sleep 1
        end
      end
      display " done"

      addons.each do |addon|
        display "Adding #{addon} to #{name}... "
        heroku.install_addon(name, addon)
      end

      display [ info[:web_url], info[:git_url] ].join(" | ")
    rescue Timeout::Error
      display "Timed Out! Check heroku info for status updates."
    end

    create_git_remote(name, remote || "heroku")
  end