Sha256: 4d2380846cca733599c8a2a33e99a040fc19542031e87353980dc9fd2231e184

Contents?: true

Size: 836 Bytes

Versions: 1

Compression:

Stored size: 836 Bytes

Contents

# frozen_string_literal: true

module Dude
  module Commands
    class Start < Dry::CLI::Command
      include Settings

      desc 'Start task (Do checkout, track and move actions)'

      argument :id, required: true, desc: 'The card short ID'

      def call(id:)
        Commands::Move.new.call(id: id, list: selected_list('in_progress'))
        Commands::Checkout.new.call(id: id)
        Commands::Track.new.call(id: id)
      end

      private

      def selected_list(list)
        case list
        when 'todo' then settings['TODO_LIST_NAME']
        when 'in_progress' then settings['IN_PROGRESS_LIST_NAME']
        when 'code_review' then settings['CODE_REVIEW_LIST_NAME']
        when 'testing' then settings['TESTING_LIST_NAME']
        when 'done' then settings['DONE_LIST_NAME']
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dude-cli-2.0.7 lib/dude/commands/start.rb