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.



32
33
34
35
36
# File 'lib/abide_dev_utils/cli/jira.rb', line 32

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

Instance Method Details

#executeObject



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

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