class Slipsquare::Middleware::CheckCredentials

Public Instance Methods

call(env) click to toggle source
# File lib/slipsquare/middleware/check_credentials.rb, line 8
def call(env)

  say "Checking credentials with Dropbox..."

  begin
      env['dropbox-client'].ls
  rescue Dropbox::API::Error => e
      say "Connection to Dropbox failed (#{e})", :red
      say "Check your .slipsquare file, and double check your credentials are correct", :yellow
      exit 1
  end

  say "Connection to dropbox successful!", :green

  @app.call(env)
end