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.



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

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

Instance Method Details

#executeObject



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

def execute
  return if AbideDevUtils::Jira.client.myself.attrs['displayName'].empty?

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