Class: GithubFlowCli::CLI
- Inherits:
-
Thor
- Object
- Thor
- GithubFlowCli::CLI
- Defined in:
- lib/github_flow_cli/cli.rb
Instance Method Summary collapse
Instance Method Details
#login ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/github_flow_cli/cli.rb', line 11 def login Config.username = ask("Github username:") password = ask("password:", echo: false) Config.oauth_token = (Config.username, password) puts "\nsuccessfully login!" rescue Octokit::Unauthorized puts "\nauthentication failed, please try again." retry end |
#repo ⇒ Object
27 28 29 |
# File 'lib/github_flow_cli/cli.rb', line 27 def repo puts(Local.repo&.slug || "remote repo not found!") end |
#user ⇒ Object
22 23 24 |
# File 'lib/github_flow_cli/cli.rb', line 22 def user puts API.user[:login] end |