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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bddf541a519a646283dbd872816140c667290b05fe81a38a79297e283f48f87b
4
- data.tar.gz: 49e9670228ddb622b9cc332f4bd5f8b943bf674b242851212aabfa6384a1162f
3
+ metadata.gz: e78fa7422ef53cce690b2d8500c406ac6bb2136d195725b3d839d67cc234c780
4
+ data.tar.gz: 65093bd8b89bf39b2a144de85867bcb4635e41f5a8c379b8486c0a8a0135cebb
5
5
  SHA512:
6
- metadata.gz: 697436e3c7dbc92323a321c75b23ef47a2c4c6f632f93bd4686a95a84b9edd4004691055d2aadfb75f802aaf1b4d88554f3a4f32e8e79942c4e073c65835dd5a
7
- data.tar.gz: 285490462d0ff27a9e3a81ae09baaac60754260e6a64fc15c5ad52887d2d1df815e41c84854b98cdbe07d5d6799ddb39f1fc99e52de4b44c41ea85e6b46f2bd0
6
+ metadata.gz: a70d01f6617f79041d95e4a1b596f68c36de68a9be8abd7be684f3d394dd15a5d49bc0a7560435670fab7d5fc59dd505c1f4adee0aba68d7feaed46cc2f61bcb
7
+ data.tar.gz: f63764aaaca3a1a7efa75c07f2776d279171dc297cee0d34306416690fb2b08f5c85697f7d1ebc1a40a03671727f3162f0293d552231405c0084438a61dfb9b6
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.6
3
3
  NewCops: enable
4
+ SuggestExtensions: false
4
5
 
5
6
  Style/StringLiterals:
6
7
  Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plansheet (0.3.1)
4
+ plansheet (0.3.3)
5
5
  dc-kwalify (~> 1.0)
6
6
 
7
7
  GEM
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("#{config["output_dir"]}/projects.md", "w")
79
+ f = File.open(output_file, "w")
69
80
  f.write(projects_str)
70
81
  f.close
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plansheet
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.3"
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.3.1
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-22 00:00:00.000000000 Z
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
@@ -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