Sha256: b136ac3c1e2ac37804fb93d14c4fb787bf624ce25cc2ae08621d11aa198c005d

Contents?: true

Size: 805 Bytes

Versions: 7

Compression:

Stored size: 805 Bytes

Contents

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

7 entries across 7 versions & 1 rubygems

Version Path
dude-cli-2.0.6 lib/dude/commands/start.rb
dude-cli-2.0.5 lib/dude/commands/start.rb
dude-cli-2.0.4 lib/dude/commands/start.rb
dude-cli-2.0.3 lib/dude/commands/start.rb
dude-cli-2.0.2 lib/dude/commands/start.rb
dude-cli-2.0.1 lib/dude/commands/start.rb
dude-cli-2.0.0 lib/dude/commands/start.rb