Sha256: 22fe254f3dfe859fd1b72e8e77a5e2c101eeff98da2a396a268f023796e52ef5
Contents?: true
Size: 1.24 KB
Versions: 18
Compression:
Stored size: 1.24 KB
Contents
module Doing # State queries for a Doing entry module ItemState ## ## Test if item has a @done tag ## ## @return [Boolean] true item has @done tag ## def finished? tags?('done') end ## ## Test if item does not contain @done tag ## ## @return [Boolean] true if item is missing @done tag ## def unfinished? tags?('done', negate: true) end ## ## Test if item is included in never_finish config and ## thus should not receive a @done tag ## ## @return [Boolean] item should receive @done tag ## def should_finish? should?('never_finish') end ## ## Test if item is included in never_time config and ## thus should not receive a date on the @done tag ## ## @return [Boolean] item should receive @done date ## def should_time? should?('never_time') end private def should?(key) config = Doing.settings return true unless config[key].is_a?(Array) config[key].each do |tag| if tag =~ /^@/ return false if tags?(tag.sub(/^@/, '').downcase) elsif section.downcase == tag.downcase return false end end true end end end
Version data entries
18 entries across 18 versions & 1 rubygems