Sha256: 4bf706e3f06c5e85c33336a1a0104ac6366b94c76fef07480a8364ac71c92bfb

Contents?: true

Size: 838 Bytes

Versions: 2

Compression:

Stored size: 838 Bytes

Contents

class Tane::Commands::Signup < Tane::Commands::Base
  include Tane::Helpers

  class << self
    def process(args)
      warn_if_credentials

      email, password = prompt_for_credentials

      auth_token, errors = Tane::Helpers::Cloudfuji.signup(email, password)

      if auth_token.nil?
        term.say "Couldn't signup - "
        errors.each do |field|
          term.say "\n"
          field.last.each do |error|
            term.say "  #{field.first} #{error} \n"
          end
        end
        
        exit
      else
        term.say "Ok, you're signed up as #{email}!"
      end

      term.say "Done!"
      term.say "Saving credentials"
      save_credentials(email, auth_token)
    end


    def help_text
      <<-EOL
Usage:

    tane signup
    
Prompts you to signup for a Cloudfuji account.
EOL
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tane-0.0.5 lib/tane/commands/signup.rb
tane-0.0.4 lib/tane/commands/signup.rb