plansheet 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6a563b95ceb3605f848e88baabd37ba4c2512d621bbac5b656b53333143ac22b
4
+ data.tar.gz: b92dd0d8690e7bd164f396d898b0b2bc530092537d05024d4d01ac8211583f59
5
+ SHA512:
6
+ metadata.gz: 82917bb297389a27eeda311ea87e940b73c84b7b1605f0b6887b2c4b32bd825ce84427446087144da1b1559c5afa0edcf51de0c3dc65562c1a0235f7c358b7c8
7
+ data.tar.gz: be2d3efa2d984fba4bc23ed71be01788187a63d91166dd9baf51dac84e0ff74a7ec52e45b7fdfac9bfc92d370a71012fdd22d40dc43bd3a63b3a636a40ce6da2
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+ NewCops: enable
4
+
5
+ Style/StringLiterals:
6
+ Enabled: true
7
+ EnforcedStyle: double_quotes
8
+
9
+ Style/StringLiteralsInInterpolation:
10
+ Enabled: true
11
+ EnforcedStyle: double_quotes
12
+
13
+ Layout/LineLength:
14
+ Max: 120
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at dave@dafyddcrosby.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in plansheet.gemspec
6
+ gemspec
7
+
8
+ group :development, optional: true do
9
+ gem "rake", "~> 13.0"
10
+ gem "minitest", "~> 5.0"
11
+ gem "rubocop", "~> 1.21"
12
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,44 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ plansheet (0.1.0)
5
+ dc-kwalify (~> 1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ dc-kwalify (1.0.0)
12
+ minitest (5.15.0)
13
+ parallel (1.22.1)
14
+ parser (3.1.2.0)
15
+ ast (~> 2.4.1)
16
+ rainbow (3.1.1)
17
+ rake (13.0.6)
18
+ regexp_parser (2.4.0)
19
+ rexml (3.2.5)
20
+ rubocop (1.29.1)
21
+ parallel (~> 1.10)
22
+ parser (>= 3.1.0.0)
23
+ rainbow (>= 2.2.2, < 4.0)
24
+ regexp_parser (>= 1.8, < 3.0)
25
+ rexml (>= 3.2.5, < 4.0)
26
+ rubocop-ast (>= 1.17.0, < 2.0)
27
+ ruby-progressbar (~> 1.7)
28
+ unicode-display_width (>= 1.4.0, < 3.0)
29
+ rubocop-ast (1.18.0)
30
+ parser (>= 3.1.1.0)
31
+ ruby-progressbar (1.11.0)
32
+ unicode-display_width (2.1.0)
33
+
34
+ PLATFORMS
35
+ x86_64-linux
36
+
37
+ DEPENDENCIES
38
+ minitest (~> 5.0)
39
+ plansheet!
40
+ rake (~> 13.0)
41
+ rubocop (~> 1.21)
42
+
43
+ BUNDLED WITH
44
+ 2.3.6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 David Crosby
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # Plansheet
2
+
3
+ Plansheet is a simple to-do list generator program that creates a
4
+ structured printout (a la [pandoc](https://pandoc.org)) from a
5
+ pile of formatted [YAML](https://yaml.org) files. Still very much a work-in-progress
6
+
7
+ ## Installation
8
+
9
+ ```ruby
10
+ gem install plansheet
11
+ ```
12
+ ## Usage
13
+
14
+ TODO: Write usage instructions here
15
+
16
+ ## Development
17
+
18
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
19
+
20
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
21
+
22
+ ## Contributing
23
+
24
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dafyddcrosby/plansheet. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/dafyddcrosby/plansheet/blob/main/CODE_OF_CONDUCT.md).
25
+
26
+ ## License
27
+
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
29
+
30
+ ## Code of Conduct
31
+
32
+ Everyone interacting in the Plansheet project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/dafyddcrosby/plansheet/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
+ end
11
+
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
data/exe/plansheet ADDED
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "yaml"
5
+
6
+ begin
7
+ config = YAML.load_file "#{Dir.home}/.plansheet.yml"
8
+ rescue StandardError
9
+ abort "unable to load plansheet config file"
10
+ end
11
+
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
+ project_hash = {}
23
+ projects = Dir.glob("*yml", base: config["projects_dir"])
24
+ projects.each do |l|
25
+ contents = YAML.load_file(File.join(config["projects_dir"], l))
26
+ key = l.gsub(".yml", "")
27
+ contents.each do |project|
28
+ key = project["project"]
29
+ project_hash[key] = {
30
+ name: project["project"]
31
+ }
32
+ %w[tasks desc done].each do |k|
33
+ project_hash[key][k.to_sym] = project[k] if project[k]
34
+ end
35
+ project_hash[key][:status] = if project["status"]
36
+ project["status"]
37
+ elsif project_hash[key][:tasks]
38
+ "planning"
39
+ else
40
+ "idea"
41
+ end
42
+ end
43
+ end
44
+
45
+ sorted_hash = project_hash.sort_by { |_, v| status_priority[v[:status]] }
46
+
47
+ def project_minipage(proj)
48
+ p proj
49
+ str = String.new
50
+ str << "\\begin{minipage}{5cm}\n"
51
+ str << "#{proj[:name]} - #{proj[:status]} \\\\\n"
52
+ proj[:tasks]&.each do |t|
53
+ str << "$\\square$ #{t} \\\\\n"
54
+ end
55
+ str << "\\end{minipage}\n"
56
+ str
57
+ end
58
+
59
+ require 'date'
60
+ projects_str = String.new
61
+ projects_str << <<~FRONTMATTER
62
+ ---
63
+ geometry: margin=3cm
64
+ ---
65
+ \\thispagestyle{empty}
66
+
67
+ # Date: #{Date.today}
68
+ FRONTMATTER
69
+
70
+ sorted_hash.first(30).each do |_, p|
71
+ projects_str << project_minipage(p)
72
+ end
73
+
74
+ Dir.mkdir config["output_dir"] unless Dir.exist? config["output_dir"]
75
+ f = File.open("#{config["output_dir"]}/projects.md", "w")
76
+ f.write(projects_str)
77
+ f.close
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Plansheet
4
+ VERSION = "0.1.0"
5
+ end
data/lib/plansheet.rb ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "plansheet/version"
4
+
5
+ module Plansheet
6
+ class Error < StandardError; end
7
+ # Your code goes here...
8
+ end
@@ -0,0 +1,41 @@
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
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: plansheet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - David Crosby
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-05-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dc-kwalify
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ description: Convert YAML project files into a nice PDF
28
+ email:
29
+ - dave@dafyddcrosby.com
30
+ executables:
31
+ - plansheet
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ".rubocop.yml"
36
+ - CODE_OF_CONDUCT.md
37
+ - Gemfile
38
+ - Gemfile.lock
39
+ - LICENSE.txt
40
+ - README.md
41
+ - Rakefile
42
+ - exe/plansheet
43
+ - lib/plansheet.rb
44
+ - lib/plansheet/version.rb
45
+ - project.schema.yaml
46
+ homepage: https://dafyddcrosby.com
47
+ licenses:
48
+ - MIT
49
+ metadata:
50
+ homepage_uri: https://dafyddcrosby.com
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 2.6.0
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubygems_version: 3.3.7
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: Convert YAML project files into a nice PDF
70
+ test_files: []