Class: Abide::CLI::JiraFromXccdfCommand
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- Abide::CLI::JiraFromXccdfCommand
- Defined in:
- lib/abide_dev_utils/cli/jira.rb
Constant Summary collapse
- CMD_NAME =
'from_xccdf'
- CMD_SHORT =
'Creates a parent issue with subtasks from a xccdf file'
- CMD_LONG =
'Creates a parent issue with subtasks for a benchmark and any uncovered controls'
Instance Method Summary collapse
- #execute(path, project) ⇒ Object
-
#initialize ⇒ JiraFromXccdfCommand
constructor
A new instance of JiraFromXccdfCommand.
Constructor Details
#initialize ⇒ JiraFromXccdfCommand
Returns a new instance of JiraFromXccdfCommand.
122 123 124 125 126 127 128 |
# File 'lib/abide_dev_utils/cli/jira.rb', line 122 def initialize super(CMD_NAME, takes_commands: false) short_desc(CMD_SHORT) long_desc(CMD_LONG) argument_desc(PATH: 'An XCCDF file from the abide puppet ticket coverage command', PROJECT: 'A Jira project') .on('-d', '--dry-run', 'Print to console instead of saving objects') { |_| @data[:dry_run] = true } end |
Instance Method Details
#execute(path, project) ⇒ Object
130 131 132 133 134 135 136 |
# File 'lib/abide_dev_utils/cli/jira.rb', line 130 def execute(path, project) Abide::CLI::VALIDATE.file(path) @data[:dry_run] = false if @data[:dry_run].nil? client = JIRA.client(options: {}) proj = JIRA.project(client, project) JIRA.new_issues_from_xccdf(client, proj, path, dry_run: @data[:dry_run]) end |