Sha256: 37ed6daa0432fc13f2d7d7148677f43c3dd42e902ce39783ff9e1e280c924055

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

require 'markdo/commands/command'

module Markdo
  class SummaryCommand < Command
    def run
      print_count('Overdue', task_collection.overdue)
      print_count('Starred', task_collection.with_tag('star'))
      print_count('Today', task_collection.due_today)
      print_count('Tomorrow', task_collection.due_tomorrow)
      print_count('Soon', task_collection.due_soon)

      print_count('Inbox', inbox_task_collection.all)
    end

    private

    def print_count(name, tasks)
      count = tasks.length

      unless count.zero?
        @stdout.puts "#{name}: #{count}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
markdo-0.2.0 lib/markdo/commands/summary_command.rb