Class: Abt::Providers::Devops::Commands::Pick

Inherits:
BaseCommand show all
Defined in:
lib/abt/providers/devops/commands/pick.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

#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/pick.rb', line 12

def self.description
  "Pick work item for current git repository"
end

.flagsObject



16
17
18
19
20
# File 'lib/abt/providers/devops/commands/pick.rb', line 16

def self.flags
  [
    ["-d", "--dry-run", "Keep existing configuration"]
  ]
end

.usageObject



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

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

Instance Method Details

#performObject



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/abt/providers/devops/commands/pick.rb', line 22

def perform
  require_local_config!
  require_board!

  warn("#{project_name} - #{board['name']}")

  work_item = select_work_item
  print_work_item(organization_name, project_name, board, work_item)

  return if flags[:"dry-run"]

  update_config(work_item)
end