Sha256: c398c88e41822b37a2e11b871fcfd7237ff67c44cff2723ad5244923762b5d4c

Contents?: true

Size: 516 Bytes

Versions: 5

Compression:

Stored size: 516 Bytes

Contents

module Flydata
  module Command
    class Login < Base
      def run
        email = ask("FlyData Email:  ")
        password = ask("FlyData password:  ") {|q| q.echo = false}
        flydata.credentials = Flydata::Credentials.new(email, password)

        login
      end

      private
      def login
        flydata.post('/users/sign_in')
        if flydata.response.code == 201 # 201: Created
          say("Login succeeded!")
          flydata.credentials.authenticate!
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flydata-0.0.1.2011102401 lib/flydata/command/login.rb
flydata-0.0.1.2011102303 lib/flydata/command/login.rb
flydata-0.0.1.2011102302 lib/flydata/command/login.rb
flydata-0.0.1.2011102301 lib/flydata/command/login.rb
flydata-0.0.1.2011101801 lib/flydata/command/login.rb