# File lib/heroku/commands/app.rb, line 30
    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)
      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 app_urls(name)
      rescue Timeout::Error
        display "Timed Out! Check heroku info for status updates."
      end

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