Class: Pebbles::Command::Auth
Overview
authentication (login, logout)
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#index ⇒ Object
auth.
-
#login ⇒ Object
auth:login.
-
#logout ⇒ Object
auth:logout.
-
#token ⇒ Object
auth:token.
-
#whoami ⇒ Object
auth:whoami.
Methods inherited from Base
#api, #app, #initialize, namespace
Methods included from Helpers
#action, #ask, #confirm_command, #create_git_remote, #debug, #debugging?, #display, #error, error_with_failure, error_with_failure=, #flatten_hash, #format_bytes, #format_error, #format_with_bang, #git, #has_git?, #has_git_remote?, #has_http_git_entry_in_netrc, #home_directory, #hputs, #json_decode, #launchy, #line_formatter, #longest, #output_with_bang, #running_on_a_mac?, #running_on_windows?, #styled_array, #styled_error, #styled_hash, #styled_header, #update_git_remote, #with_tty
Constructor Details
This class inherits a constructor from Pebbles::Command::Base
Instance Method Details
#index ⇒ Object
auth
Authenticate, display token and current user
10 11 12 13 14 |
# File 'lib/pebbles/command/auth.rb', line 10 def index validate_arguments! Pebbles::Command::Help.new.send(:help_for_command, current_command) end |
#login ⇒ Object
auth:login
log in with your Pebblescape credentials
Example:
$ pebbles auth:login Enter your Pebblescape credentials: Email: [email protected] Password (typing will be hidden): Authentication successful.
28 29 30 31 32 33 |
# File 'lib/pebbles/command/auth.rb', line 28 def login validate_arguments! Pebbles::Auth.login display "Authentication successful." end |
#logout ⇒ Object
auth:logout
clear local authentication credentials
Example:
$ pebbles auth:logout Local credentials cleared.
46 47 48 49 50 51 |
# File 'lib/pebbles/command/auth.rb', line 46 def logout validate_arguments! Pebbles::Auth.logout display "Local credentials cleared." end |
#token ⇒ Object
auth:token
display your api token
Example:
$ pebbles auth:token ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCD
64 65 66 67 68 |
# File 'lib/pebbles/command/auth.rb', line 64 def token validate_arguments! display Pebbles::Auth.api_key end |