plansheet 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/examples/backpack.yml +10 -0
- data/exe/plansheet +5 -12
- data/exe/plansheet-sorter +4 -11
- data/exe/plansheet-validator +19 -0
- data/lib/plansheet/project.rb +62 -0
- data/lib/plansheet/version.rb +1 -1
- data/lib/plansheet.rb +1 -0
- metadata +7 -3
- data/project.schema.yaml +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bddf541a519a646283dbd872816140c667290b05fe81a38a79297e283f48f87b
|
4
|
+
data.tar.gz: 49e9670228ddb622b9cc332f4bd5f8b943bf674b242851212aabfa6384a1162f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 697436e3c7dbc92323a321c75b23ef47a2c4c6f632f93bd4686a95a84b9edd4004691055d2aadfb75f802aaf1b4d88554f3a4f32e8e79942c4e073c65835dd5a
|
7
|
+
data.tar.gz: 285490462d0ff27a9e3a81ae09baaac60754260e6a64fc15c5ad52887d2d1df815e41c84854b98cdbe07d5d6799ddb39f1fc99e52de4b44c41ea85e6b46f2bd0
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -0,0 +1,10 @@
|
|
1
|
+
- project: Add snazzy patches to backpack
|
2
|
+
status: planning
|
3
|
+
tasks:
|
4
|
+
- gather patches around the house in one spot
|
5
|
+
- determine which patches to put on
|
6
|
+
- find thread that matches patch colors
|
7
|
+
- plug in sewing machine
|
8
|
+
- put thread onto bobbin
|
9
|
+
- sew patches onto backpack
|
10
|
+
|
data/exe/plansheet
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "yaml"
|
5
|
+
require "plansheet"
|
5
6
|
|
6
7
|
begin
|
7
8
|
config = YAML.load_file "#{Dir.home}/.plansheet.yml"
|
@@ -9,16 +10,6 @@ rescue StandardError
|
|
9
10
|
abort "unable to load plansheet config file"
|
10
11
|
end
|
11
12
|
|
12
|
-
status_priority = {
|
13
|
-
"wip" => 1,
|
14
|
-
"ready" => 2,
|
15
|
-
"blocked" => 3,
|
16
|
-
"planning" => 4,
|
17
|
-
"idea" => 5,
|
18
|
-
"dropped" => 6,
|
19
|
-
"done" => 7
|
20
|
-
}
|
21
|
-
|
22
13
|
project_hash = {}
|
23
14
|
projects = Dir.glob("*yml", base: config["projects_dir"])
|
24
15
|
projects.each do |l|
|
@@ -42,7 +33,9 @@ projects.each do |l|
|
|
42
33
|
end
|
43
34
|
end
|
44
35
|
|
45
|
-
sorted_hash = project_hash.sort_by
|
36
|
+
sorted_hash = project_hash.sort_by do |_, v|
|
37
|
+
Plansheet::PROJECT_STATUS_PRIORITY[v[:status]]
|
38
|
+
end
|
46
39
|
|
47
40
|
def project_minipage(proj)
|
48
41
|
p proj
|
@@ -67,7 +60,7 @@ projects_str << <<~FRONTMATTER
|
|
67
60
|
# Date: #{Date.today}
|
68
61
|
FRONTMATTER
|
69
62
|
|
70
|
-
sorted_hash.first(
|
63
|
+
sorted_hash.first(60).each do |_, p|
|
71
64
|
projects_str << project_minipage(p)
|
72
65
|
end
|
73
66
|
|
data/exe/plansheet-sorter
CHANGED
@@ -4,16 +4,7 @@
|
|
4
4
|
# An ugly script to sort projects by status (and eventually priority)
|
5
5
|
|
6
6
|
require "yaml"
|
7
|
-
|
8
|
-
status_priority = {
|
9
|
-
"wip" => 1,
|
10
|
-
"ready" => 2,
|
11
|
-
"blocked" => 3,
|
12
|
-
"planning" => 4,
|
13
|
-
"idea" => 5,
|
14
|
-
"dropped" => 6,
|
15
|
-
"done" => 7
|
16
|
-
}
|
7
|
+
require "plansheet"
|
17
8
|
|
18
9
|
def project_priority(project)
|
19
10
|
if project["status"]
|
@@ -27,6 +18,8 @@ end
|
|
27
18
|
|
28
19
|
filename = ARGV.first
|
29
20
|
contents = YAML.load_file(filename)
|
30
|
-
sorted_hash = contents.sort_by
|
21
|
+
sorted_hash = contents.sort_by do |project|
|
22
|
+
Plansheet::PROJECT_STATUS_PRIORITY[project_priority project]
|
23
|
+
end
|
31
24
|
|
32
25
|
File.write(filename, YAML.dump(sorted_hash))
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "plansheet"
|
5
|
+
require "kwalify"
|
6
|
+
require "yaml"
|
7
|
+
require "pp"
|
8
|
+
|
9
|
+
# TODO: yuck!
|
10
|
+
filename = ARGV.first
|
11
|
+
validator = Kwalify::Validator.new(Plansheet::PROJECT_SCHEMA)
|
12
|
+
errors = validator.validate(YAML.load_file(filename))
|
13
|
+
# Check YAML validity
|
14
|
+
if errors && !errors.empty?
|
15
|
+
errors.each do |err|
|
16
|
+
puts "- [#{err.path}] #{err.message}"
|
17
|
+
end
|
18
|
+
abort "Schema errors in #{filename}"
|
19
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaml"
|
4
|
+
|
5
|
+
module Plansheet
|
6
|
+
PROJECT_STATUS_PRIORITY = {
|
7
|
+
"wip" => 1,
|
8
|
+
"ready" => 2,
|
9
|
+
"blocked" => 3,
|
10
|
+
"planning" => 4,
|
11
|
+
"idea" => 5,
|
12
|
+
"dropped" => 6,
|
13
|
+
"done" => 7
|
14
|
+
}.freeze
|
15
|
+
|
16
|
+
# Once there's some stability in plansheet and dc-kwalify, will pre-load this
|
17
|
+
# to save the later YAML.load
|
18
|
+
PROJECT_YAML_SCHEMA = <<~YAML
|
19
|
+
desc: dc-tasks project schema
|
20
|
+
type: seq
|
21
|
+
sequence:
|
22
|
+
- type: map
|
23
|
+
mapping:
|
24
|
+
"project":
|
25
|
+
desc: Project name
|
26
|
+
type: str
|
27
|
+
required: yes
|
28
|
+
"status":
|
29
|
+
desc: The current status of the project
|
30
|
+
type: str
|
31
|
+
enum:
|
32
|
+
- wip # project is a work-in-progress
|
33
|
+
- ready # project is fully scoped, ready to go
|
34
|
+
- blocked # project is blocked, but otherwise ready/wip
|
35
|
+
- planning # project in planning phase
|
36
|
+
- idea # project is little more than an idea
|
37
|
+
- dropped # project has been explicitly dropped, but
|
38
|
+
# want to keep around for reference, etc
|
39
|
+
- done # project is finished, but want to keep around
|
40
|
+
# for reference, etc.
|
41
|
+
"priority":
|
42
|
+
desc: Project priority (not currently implemented)
|
43
|
+
type: str
|
44
|
+
enum:
|
45
|
+
- high
|
46
|
+
- low
|
47
|
+
"tasks":
|
48
|
+
desc: List of tasks to do
|
49
|
+
type: seq
|
50
|
+
sequence:
|
51
|
+
- type: str
|
52
|
+
"done":
|
53
|
+
desc: List of tasks which have been completed
|
54
|
+
type: seq
|
55
|
+
sequence:
|
56
|
+
- type: str
|
57
|
+
"notes":
|
58
|
+
desc: Free-form notes string
|
59
|
+
type: str
|
60
|
+
YAML
|
61
|
+
PROJECT_SCHEMA = YAML.safe_load(PROJECT_YAML_SCHEMA)
|
62
|
+
end
|
data/lib/plansheet/version.rb
CHANGED
data/lib/plansheet.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plansheet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Crosby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dc-kwalify
|
@@ -30,6 +30,7 @@ email:
|
|
30
30
|
executables:
|
31
31
|
- plansheet
|
32
32
|
- plansheet-sorter
|
33
|
+
- plansheet-validator
|
33
34
|
extensions: []
|
34
35
|
extra_rdoc_files: []
|
35
36
|
files:
|
@@ -40,16 +41,19 @@ files:
|
|
40
41
|
- LICENSE.txt
|
41
42
|
- README.md
|
42
43
|
- Rakefile
|
44
|
+
- examples/backpack.yml
|
43
45
|
- exe/plansheet
|
44
46
|
- exe/plansheet-sorter
|
47
|
+
- exe/plansheet-validator
|
45
48
|
- lib/plansheet.rb
|
49
|
+
- lib/plansheet/project.rb
|
46
50
|
- lib/plansheet/version.rb
|
47
|
-
- project.schema.yaml
|
48
51
|
homepage: https://dafyddcrosby.com
|
49
52
|
licenses:
|
50
53
|
- MIT
|
51
54
|
metadata:
|
52
55
|
homepage_uri: https://dafyddcrosby.com
|
56
|
+
rubygems_mfa_required: 'true'
|
53
57
|
post_install_message:
|
54
58
|
rdoc_options: []
|
55
59
|
require_paths:
|
data/project.schema.yaml
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
desc: dc-tasks project schema
|
2
|
-
type: seq
|
3
|
-
sequence:
|
4
|
-
- type: map
|
5
|
-
mapping:
|
6
|
-
"project":
|
7
|
-
desc: Project name
|
8
|
-
type: str
|
9
|
-
required: yes
|
10
|
-
"status":
|
11
|
-
desc: The current status of the project
|
12
|
-
type: str
|
13
|
-
enum:
|
14
|
-
- wip # project is a work-in-progress
|
15
|
-
- ready # project is fully scoped, ready to go
|
16
|
-
- blocked # project is blocked, but otherwise ready/wip
|
17
|
-
- planning # project in planning phase
|
18
|
-
- idea # project is little more than an idea
|
19
|
-
- dropped # project has been explicitly dropped, but
|
20
|
-
# want to keep around for reference, etc
|
21
|
-
- done # project is finished, but want to keep around
|
22
|
-
# for reference, etc.
|
23
|
-
"priority":
|
24
|
-
desc: Project priority (not currently implemented)
|
25
|
-
type: str
|
26
|
-
enum:
|
27
|
-
- high
|
28
|
-
- low
|
29
|
-
"tasks":
|
30
|
-
desc: List of tasks to do
|
31
|
-
type: seq
|
32
|
-
sequence:
|
33
|
-
- type: str
|
34
|
-
"done":
|
35
|
-
desc: List of tasks which have been completed
|
36
|
-
type: seq
|
37
|
-
sequence:
|
38
|
-
- type: str
|
39
|
-
"notes":
|
40
|
-
desc: Free-form notes string
|
41
|
-
type: str
|