Class: Abide::CLI::JiraAuthCommand

Inherits:
CmdParse::Command
  • Object
show all
Defined in:
lib/abide_dev_utils/cli/jira.rb

Constant Summary collapse

CMD_NAME =
'auth'
CMD_SHORT =
'Test authentication with Jira'
CMD_LONG =
'Allows you to test authenticating with Jira'

Instance Method Summary collapse

Constructor Details

#initializeJiraAuthCommand

Returns a new instance of JiraAuthCommand.



34
35
36
37
38
# File 'lib/abide_dev_utils/cli/jira.rb', line 34

def initialize
  super(CMD_NAME, takes_commands: false)
  short_desc(CMD_SHORT)
  long_desc(CMD_LONG)
end

Instance Method Details

#executeObject



40
41
42
43
44
45
46
# File 'lib/abide_dev_utils/cli/jira.rb', line 40

def execute
  client = JIRA.client
  myself = JIRA.myself(client)
  return if myself.attrs['name'].empty?

  Abide::CLI::OUTPUT.simple("Successfully authenticated user #{myself.attrs['name']}!")
end