plansheet 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a563b95ceb3605f848e88baabd37ba4c2512d621bbac5b656b53333143ac22b
4
- data.tar.gz: b92dd0d8690e7bd164f396d898b0b2bc530092537d05024d4d01ac8211583f59
3
+ metadata.gz: 7ccfb13735d8626143db08903deac727870c66e6bd6fec21648fd70bf4050727
4
+ data.tar.gz: 847f0a0f78cdb0035ee03829f2761e3780fb6296738ac89bcca55635079b9e3a
5
5
  SHA512:
6
- metadata.gz: 82917bb297389a27eeda311ea87e940b73c84b7b1605f0b6887b2c4b32bd825ce84427446087144da1b1559c5afa0edcf51de0c3dc65562c1a0235f7c358b7c8
7
- data.tar.gz: be2d3efa2d984fba4bc23ed71be01788187a63d91166dd9baf51dac84e0ff74a7ec52e45b7fdfac9bfc92d370a71012fdd22d40dc43bd3a63b3a636a40ce6da2
6
+ metadata.gz: 34835dc03602c977afb76a4b5202f3ccf7322445086550d11d6506a4cce329f437d1f1a650b8500f46f6f81d72879f8a0ed506ed087411c68c1362b50523aeb8
7
+ data.tar.gz: ff0832cc110fa2f8ab2350867aa9c3642cc4eeb6ad9bea9cb620e69dceb4afe5f8e139d9c23f4d9bfd5270000ebc4f5885d1a6cce5ea5db2270edd3caf277428
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plansheet (0.1.0)
4
+ plansheet (0.2.0)
5
5
  dc-kwalify (~> 1.0)
6
6
 
7
7
  GEM
data/exe/plansheet CHANGED
@@ -56,7 +56,7 @@ def project_minipage(proj)
56
56
  str
57
57
  end
58
58
 
59
- require 'date'
59
+ require "date"
60
60
  projects_str = String.new
61
61
  projects_str << <<~FRONTMATTER
62
62
  ---
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # An ugly script to sort projects by status (and eventually priority)
5
+
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
+ }
17
+
18
+ def project_priority(project)
19
+ if project["status"]
20
+ project["status"]
21
+ elsif project["tasks"]
22
+ "planning"
23
+ else
24
+ "idea"
25
+ end
26
+ end
27
+
28
+ filename = ARGV.first
29
+ contents = YAML.load_file(filename)
30
+ sorted_hash = contents.sort_by { |project| status_priority[project_priority project] }
31
+
32
+ File.write(filename, YAML.dump(sorted_hash))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plansheet
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
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.1.0
4
+ version: 0.2.0
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-18 00:00:00.000000000 Z
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dc-kwalify
@@ -29,6 +29,7 @@ email:
29
29
  - dave@dafyddcrosby.com
30
30
  executables:
31
31
  - plansheet
32
+ - plansheet-sorter
32
33
  extensions: []
33
34
  extra_rdoc_files: []
34
35
  files:
@@ -40,6 +41,7 @@ files:
40
41
  - README.md
41
42
  - Rakefile
42
43
  - exe/plansheet
44
+ - exe/plansheet-sorter
43
45
  - lib/plansheet.rb
44
46
  - lib/plansheet/version.rb
45
47
  - project.schema.yaml