Sha256: b6c1c19e6a2740deedd4d79a1230252a3434cd323aa6e168f80bc10590e3ffe2
Contents?: true
Size: 1.21 KB
Versions: 16
Compression:
Stored size: 1.21 KB
Contents
module Evertils module Type class PriorityQueue < Type::Base NOTEBOOK = :'Priority Queue' COLOUR = 0xffe8b7 # # @since 0.3.7 def initialize(config, *args) super(config, *args) @title = @format.date_templates[NOTEBOOK] @content = find_previous end # # @since 0.3.9 def tags [ "day-#{Date.today.yday}", "week-#{Date.today.cweek}", "month-#{Date.today.month}" ] end private # Find a previous note # @since 0.3.7 def find_previous day = Date.today note = nil Notify.info('Searching for last PQ...') (1..MAX_SEARCH_SIZE).each do |iter| day -= 1 dow = @format.day_of_week(day.strftime('%a')) # always skip weekends, even if there is a note for those days next if %i[Sa Su].include?(dow) note_title = "Queue For [#{day.strftime('%B %-d')} - #{dow}]" note = @note_helper.model.find_note_contents(note_title).entity Notify.info(" (#{iter}) #{note_title}") break unless note.nil? end @api.convert_to_xml(note.content).prepare end end end end
Version data entries
16 entries across 16 versions & 1 rubygems