Class: GithubFlowCli::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/github_flow_cli/cli.rb

Instance Method Summary collapse

Instance Method Details

#loginObject



11
12
13
14
15
16
17
18
19
# File 'lib/github_flow_cli/cli.rb', line 11

def 
  Config.username = ask("Github username:")
  password = ask("password:", echo: false)
  Config.oauth_token = authorize(Config.username, password)
  puts "\nsuccessfully login!"
rescue Octokit::Unauthorized
  puts "\nauthentication failed, please try again."
  retry
end

#repoObject



27
28
29
# File 'lib/github_flow_cli/cli.rb', line 27

def repo
  puts(Local.repo&.slug || "remote repo not found!")
end

#userObject



22
23
24
# File 'lib/github_flow_cli/cli.rb', line 22

def user
  puts API.user[:login]
end