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.



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

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

Instance Method Details

#executeObject



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

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