plansheet 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/Gemfile.lock +1 -1
- data/exe/plansheet +13 -2
- data/lib/plansheet/version.rb +1 -1
- metadata +2 -4
- data/exe/plansheet-validator +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e78fa7422ef53cce690b2d8500c406ac6bb2136d195725b3d839d67cc234c780
|
4
|
+
data.tar.gz: 65093bd8b89bf39b2a144de85867bcb4635e41f5a8c379b8486c0a8a0135cebb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a70d01f6617f79041d95e4a1b596f68c36de68a9be8abd7be684f3d394dd15a5d49bc0a7560435670fab7d5fc59dd505c1f4adee0aba68d7feaed46cc2f61bcb
|
7
|
+
data.tar.gz: f63764aaaca3a1a7efa75c07f2776d279171dc297cee0d34306416690fb2b08f5c85697f7d1ebc1a40a03671727f3162f0293d552231405c0084438a61dfb9b6
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/exe/plansheet
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
require "kwalify"
|
4
5
|
require "yaml"
|
5
6
|
require "plansheet"
|
6
7
|
|
@@ -14,6 +15,15 @@ project_hash = {}
|
|
14
15
|
projects = Dir.glob("*yml", base: config["projects_dir"])
|
15
16
|
projects.each do |l|
|
16
17
|
contents = YAML.load_file(File.join(config["projects_dir"], l))
|
18
|
+
validator = Kwalify::Validator.new(Plansheet::PROJECT_SCHEMA)
|
19
|
+
errors = validator.validate(contents)
|
20
|
+
# Check YAML validity
|
21
|
+
if errors && !errors.empty?
|
22
|
+
$stderr.write "Schema errors in #{l}\n"
|
23
|
+
errors.each { |err| puts "- [#{err.path}] #{err.message}" }
|
24
|
+
abort
|
25
|
+
end
|
26
|
+
|
17
27
|
key = l.gsub(".yml", "")
|
18
28
|
contents.each do |project|
|
19
29
|
key = project["project"]
|
@@ -38,7 +48,6 @@ sorted_hash = project_hash.sort_by do |_, v|
|
|
38
48
|
end
|
39
49
|
|
40
50
|
def project_minipage(proj)
|
41
|
-
p proj
|
42
51
|
str = String.new
|
43
52
|
str << "\\begin{minipage}{5cm}\n"
|
44
53
|
str << "#{proj[:name]} - #{proj[:status]} \\\\\n"
|
@@ -64,7 +73,9 @@ sorted_hash.first(60).each do |_, p|
|
|
64
73
|
projects_str << project_minipage(p)
|
65
74
|
end
|
66
75
|
|
76
|
+
output_file = "#{config["output_dir"]}/projects.md"
|
77
|
+
puts "Writing to #{output_file}"
|
67
78
|
Dir.mkdir config["output_dir"] unless Dir.exist? config["output_dir"]
|
68
|
-
f = File.open(
|
79
|
+
f = File.open(output_file, "w")
|
69
80
|
f.write(projects_str)
|
70
81
|
f.close
|
data/lib/plansheet/version.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.3.
|
4
|
+
version: 0.3.3
|
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-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dc-kwalify
|
@@ -30,7 +30,6 @@ email:
|
|
30
30
|
executables:
|
31
31
|
- plansheet
|
32
32
|
- plansheet-sorter
|
33
|
-
- plansheet-validator
|
34
33
|
extensions: []
|
35
34
|
extra_rdoc_files: []
|
36
35
|
files:
|
@@ -44,7 +43,6 @@ files:
|
|
44
43
|
- examples/backpack.yml
|
45
44
|
- exe/plansheet
|
46
45
|
- exe/plansheet-sorter
|
47
|
-
- exe/plansheet-validator
|
48
46
|
- lib/plansheet.rb
|
49
47
|
- lib/plansheet/project.rb
|
50
48
|
- lib/plansheet/version.rb
|
data/exe/plansheet-validator
DELETED
@@ -1,19 +0,0 @@
|
|
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
|