Class: Travis::CLI::Login
- Inherits:
-
ApiCommand
- Object
- Command
- ApiCommand
- Travis::CLI::Login
- Defined in:
- lib/travis/cli/login.rb
Constant Summary
Constants included from Tools::Assets
Instance Attribute Summary collapse
-
#callback ⇒ Object
Returns the value of attribute callback.
-
#github_login ⇒ Object
Returns the value of attribute github_login.
-
#github_otp ⇒ Object
Returns the value of attribute github_otp.
-
#github_password ⇒ Object
Returns the value of attribute github_password.
-
#github_token ⇒ Object
Returns the value of attribute github_token.
Attributes inherited from ApiCommand
Attributes inherited from Command
#arguments, #config, #force_interactive, #formatter, #input, #output
Instance Method Summary collapse
Methods inherited from ApiCommand
#authenticate, #detected_endpoint?, #endpoint_config, #enterprise?, #initialize, #org?, #pro?, #setup, #sync
Methods included from Travis::Client::Methods
#access_token, #access_token=, #account, #accounts, #api_endpoint, #api_endpoint=, #artifact, #broadcasts, #build, #cancel, #explicit_api_endpoint?, #github_auth, #job, #listen, #repo, #repos, #restart, #user, #worker, #workers
Methods inherited from Command
abstract, abstract?, #check_completion, #check_ruby, #check_version, command_name, #command_name, #debug, description, #execute, #help, #info, #initialize, #last_check, #on_signal, #parse, #say, #setup, skip, #terminal, #usage, #write_to
Methods included from Tools::Assets
Methods included from Parser
Constructor Details
This class inherits a constructor from Travis::CLI::ApiCommand
Instance Attribute Details
#callback ⇒ Object
Returns the value of attribute callback.
13 14 15 |
# File 'lib/travis/cli/login.rb', line 13 def callback @callback end |
#github_login ⇒ Object
Returns the value of attribute github_login.
13 14 15 |
# File 'lib/travis/cli/login.rb', line 13 def github_login @github_login end |
#github_otp ⇒ Object
Returns the value of attribute github_otp.
13 14 15 |
# File 'lib/travis/cli/login.rb', line 13 def github_otp @github_otp end |
#github_password ⇒ Object
Returns the value of attribute github_password.
13 14 15 |
# File 'lib/travis/cli/login.rb', line 13 def github_password @github_password end |
#github_token ⇒ Object
Returns the value of attribute github_token.
13 14 15 |
# File 'lib/travis/cli/login.rb', line 13 def github_token @github_token end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/travis/cli/login.rb', line 15 def run self.github_token ||= Travis::Tools::TokenFinder.find(:explode => explode?, :github => github_endpoint.host) if auto? generate_github_token unless github_token endpoint_config['access_token'] = github_auth(github_token) success("Successfully logged in!") ensure callback.call if callback end |