Class: Octopolo::Scripts::GithubAuth
- Inherits:
-
Object
- Object
- Octopolo::Scripts::GithubAuth
- Includes:
- CLIWrapper, UserConfigWrapper
- Defined in:
- lib/octopolo/scripts/github_auth.rb
Instance Attribute Summary collapse
-
#auth_response ⇒ Object
Returns the value of attribute auth_response.
-
#password ⇒ Object
Returns the value of attribute password.
-
#user_defined_token ⇒ Object
Returns the value of attribute user_defined_token.
-
#username ⇒ Object
Returns the value of attribute username.
Attributes included from UserConfigWrapper
Attributes included from CLIWrapper
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#auth_response ⇒ Object
Returns the value of attribute auth_response.
13 14 15 |
# File 'lib/octopolo/scripts/github_auth.rb', line 13 def auth_response @auth_response end |
#password ⇒ Object
Returns the value of attribute password.
12 13 14 |
# File 'lib/octopolo/scripts/github_auth.rb', line 12 def password @password end |
#user_defined_token ⇒ Object
Returns the value of attribute user_defined_token.
14 15 16 |
# File 'lib/octopolo/scripts/github_auth.rb', line 14 def user_defined_token @user_defined_token end |
#username ⇒ Object
Returns the value of attribute username.
11 12 13 |
# File 'lib/octopolo/scripts/github_auth.rb', line 11 def username @username end |
Class Method Details
.execute ⇒ Object
16 17 18 |
# File 'lib/octopolo/scripts/github_auth.rb', line 16 def self.execute new.execute end |
Instance Method Details
#execute ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/octopolo/scripts/github_auth.rb', line 20 def execute case ask_auth_method when "Generate an API token with my credentials" ask_credentials request_token when "I'll enter an access token manually" ask_token verify_token end store_token rescue GitHub::BadCredentials => e cli.say e. end |