Class: Abt::Providers::Devops::Commands::BranchName

Inherits:
BaseCommand show all
Defined in:
lib/abt/providers/devops/commands/branch_name.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#config, #path

Attributes inherited from BaseCommand

#ari, #cli, #flags

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Methods inherited from BaseCommand

flags, #initialize

Constructor Details

This class inherits a constructor from Abt::Providers::Devops::BaseCommand

Class Method Details

.descriptionObject



12
13
14
# File 'lib/abt/providers/devops/commands/branch_name.rb', line 12

def self.description
  "Suggest a git branch name for the current/specified work-item."
end

.usageObject



8
9
10
# File 'lib/abt/providers/devops/commands/branch_name.rb', line 8

def self.usage
  "abt branch-name devops[:<organization-name>/<project-name>/<board-id>/<work-item-id>]"
end

Instance Method Details

#performObject



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/abt/providers/devops/commands/branch_name.rb', line 16

def perform
  require_work_item!

  if work_item
    puts name
  else
    abort(<<~TXT)
      Unable to find work item for configuration:
      devops:#{path}
    TXT
  end
end