Module: Plansheet
- Defined in:
- lib/plansheet.rb,
lib/plansheet/pool.rb,
lib/plansheet/time.rb,
lib/plansheet/project.rb,
lib/plansheet/version.rb,
lib/plansheet/sheet/latex.rb,
lib/plansheet/project/yaml.rb,
lib/plansheet/project/stringify.rb
Defined Under Namespace
Modules: TimeUtils Classes: Error, LaTeXSheet, Pool, Project, ProjectYAMLFile
Constant Summary collapse
- PROJECT_STATUS_PRIORITY =
{ "wip" => 1, "ready" => 2, "blocked" => 3, "waiting" => 4, "planning" => 5, "idea" => 6, "paused" => 7, "dropped" => 8, "done" => 9 }.freeze
- NEXT_DOW =
Pre-compute the next days-of-week
0.upto(6).to_h do |x| d = Date.today + x [d.strftime("%A"), d] end.freeze
- VERSION =
"0.31.0"- YAML_TIME_REGEX =
Once there’s some stability in plansheet and dc-kwalify, will pre-load this to save the later YAML.load
"/\\d+[mh] ?\d*m?/"- YAML_DATE_REGEX =
TODO: regex is bad, adjust for better handling of pretty time
"/\\d+[dw]/"- PROJECT_YAML_SCHEMA =
"desc: dc-tasks project schema\ntype: seq\nsequence:\n - type: map\n mapping:\n \"project\":\n desc: Project name\n type: str\n unique: true\n \"namespace\":\n desc: Project name\n type: str\n \"priority\":\n desc: Project priority\n type: str\n enum:\n - high\n - medium\n - low\n \"status\":\n desc: The current status of the project\n type: str\n enum:\n - wip # project is a work-in-progress\n - ready # project has tasks, ready to go\n - waiting # project in waiting on some external person/event\n - blocked # project is blocked by another project, but otherwise ready/wip\n - planning # project in planning phase (set manually)\n - idea # project is little more than an idea\n - paused # project shouldn't be archived, but should be excluded from\n # generated output unless paused projects are requested\n - dropped # project has been explicitly dropped, but\n # want to keep around for reference, etc\n - done # project is finished, but want to keep around\n # for reference, etc.\n \"location\":\n desc: Location\n type: str\n \"notes\":\n desc: Free-form notes string\n type: str\n \"time_estimate\":\n desc: The estimated amount of time before a project is completed\n type: str\n pattern: \#{YAML_TIME_REGEX}\n \"daily_time_roi\":\n desc: The estimated amount of time saved daily by completing this project\n type: str\n pattern: \#{YAML_TIME_REGEX}\n \"weekly_time_roi\":\n desc: The estimated amount of time saved daily by completing this project\n type: str\n pattern: \#{YAML_TIME_REGEX}\n \"yearly_time_roi\":\n desc: The estimated amount of time saved daily by completing this project\n type: str\n pattern: \#{YAML_TIME_REGEX}\n \"day_of_week\":\n desc: recurring day of week project\n type: str\n enum:\n - Sunday\n - Monday\n - Tuesday\n - Wednesday\n - Thursday\n - Friday\n - Saturday\n \"frequency\":\n desc: The amount of time before a recurring project moves to ready status again from when it was last done, with a set due date (eg. a bill becomes due)\n type: str\n pattern: \#{YAML_DATE_REGEX}\n \"last_for\":\n desc: \"The amount of time before a recurring project moves to ready status again from when it was last done, with a set defer date (eg. inflating a bike tire). If your project 'can't wait' a day or two, you should use frequency.\"\n type: str\n pattern: \#{YAML_DATE_REGEX}\n \"lead_time\":\n desc: The amount of time before a recurring project is \"due\" moved to ready where the project (sort of a deferral mechanism) (WIP)\n type: str\n pattern: \#{YAML_DATE_REGEX}\n \"due\":\n desc: Due date of the task\n type: date\n \"defer\":\n desc: Defer task until this day\n type: date\n \"completed_on\":\n desc: When the (non-recurring) project was completed\n type: date\n \"dropped_on\":\n desc: When the project was dropped\n type: date\n \"paused_on\":\n desc: When the project was paused\n type: date\n \"created_on\":\n desc: When the project was created\n type: date\n \"starts_on\":\n desc: For ICS (WIP)\n type: date\n \"last_reviewed\":\n desc: When the project was last reviewed (WIP)\n type: date\n \"last_done\":\n desc: When the recurring project was last completed (WIP)\n type: date\n \"dependencies\":\n desc: The names of projects that need to be completed before this project can be started/completed\n type: seq\n sequence:\n - type: str\n \"externals\":\n desc: List of external commitments, ie who else cares about project completion?\n type: seq\n sequence:\n - type: str\n \"urls\":\n desc: List of URLs that may be pertinent\n type: seq\n sequence:\n - type: str\n \"tasks\":\n desc: List of tasks to do\n type: seq\n sequence:\n - type: str\n \"setup_tasks\":\n desc: List of tasks needed before main project work begins\n type: seq\n sequence:\n - type: str\n \"cleanup_tasks\":\n desc: List of tasks needed before main project work begins\n type: seq\n sequence:\n - type: str\n \"done\":\n desc: List of tasks which have been completed\n type: seq\n sequence:\n - type: str\n \"tags\":\n desc: List of tags (WIP)\n type: seq\n sequence:\n - type: str\n"- PROJECT_SCHEMA =
YAML.safe_load(PROJECT_YAML_SCHEMA)
Class Method Summary collapse
-
.load_config ⇒ Object
TODO: config schema validation.
Class Method Details
.load_config ⇒ Object
TODO: config schema validation
11 12 13 14 15 |
# File 'lib/plansheet.rb', line 11 def self.load_config YAML.load_file "#{Dir.home}/.plansheet.yml" rescue StandardError abort "unable to load plansheet config file" end |