class Markdo::QueryCommand

Public Instance Methods

run(string) click to toggle source
# File lib/markdo/commands/query_command.rb, line 5
def run(string)
  regexp = Regexp.new(string, Regexp::IGNORECASE)
  tasks = task_collection.with_match(regexp).reject(&:complete?)

  tasks.each do |task|
    @stdout.puts(task.line)
  end
end