plansheet 0.25.1 → 0.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/plansheet/project.rb +3 -1
- data/lib/plansheet/sheet/latex.rb +55 -0
- data/lib/plansheet/sheet.rb +1 -53
- data/lib/plansheet/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4064aa7163d4ad0b941b17a4b3f10541fde5188d2b84e1c5b8fe43fd82eadbb
|
4
|
+
data.tar.gz: a67509fae6401fd25e42ab35ef810a0bba0f82f73173ab2a5061206b2e4d9f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4d07c885342474b0205fceec3e625fc000dd92b164987eaab1603ce453d1e7473c3281a30047470d8c15f7e4dce9e587f1c19365a0d7a56a12b93478f038024
|
7
|
+
data.tar.gz: 7ab35b12fcdc63e00d0dd6e2b2b54e4d27634d1b950c2298c55886b3f8c461cc272bbb507404edfad156ff646148802f099d3c1a054bd000284622f1f1e9ce72
|
data/Gemfile.lock
CHANGED
data/lib/plansheet/project.rb
CHANGED
@@ -329,6 +329,8 @@ module Plansheet
|
|
329
329
|
|
330
330
|
def last_for_deferral
|
331
331
|
return @last_done + Plansheet.parse_date_duration(@last_for) if @last_done
|
332
|
+
|
333
|
+
Date.today
|
332
334
|
end
|
333
335
|
|
334
336
|
def lead_time_deferral
|
@@ -341,7 +343,7 @@ module Plansheet
|
|
341
343
|
end
|
342
344
|
|
343
345
|
def recurring?
|
344
|
-
!@frequency.nil? || !@day_of_week.nil? || !@last_done.nil?
|
346
|
+
!@frequency.nil? || !@day_of_week.nil? || !@last_done.nil? || !@last_for.nil?
|
345
347
|
end
|
346
348
|
|
347
349
|
def dropped_or_done?
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
module Plansheet
|
5
|
+
# The Sheet class constructs a Markdown/LaTeX file for use with pandoc
|
6
|
+
class Sheet
|
7
|
+
def initialize(output_file, project_arr)
|
8
|
+
projects_str = String.new
|
9
|
+
projects_str << sheet_header
|
10
|
+
|
11
|
+
project_arr.each do |p|
|
12
|
+
projects_str << project_minipage(p)
|
13
|
+
end
|
14
|
+
puts "Writing to #{output_file}"
|
15
|
+
File.write(output_file, projects_str)
|
16
|
+
end
|
17
|
+
|
18
|
+
def sheet_header
|
19
|
+
<<~FRONTMATTER
|
20
|
+
---
|
21
|
+
geometry: margin=1.5cm
|
22
|
+
---
|
23
|
+
\\thispagestyle{empty}
|
24
|
+
|
25
|
+
# Date: #{Date.today}
|
26
|
+
FRONTMATTER
|
27
|
+
end
|
28
|
+
|
29
|
+
def project_minipage(proj)
|
30
|
+
str = String.new
|
31
|
+
str << "\\begin{minipage}{6cm}\n"
|
32
|
+
str << project_header(proj)
|
33
|
+
proj&.tasks&.each do |t|
|
34
|
+
str << "$\\square$ #{sanitize_string(t)} \\\\\n"
|
35
|
+
end
|
36
|
+
str << "\\end{minipage}\n"
|
37
|
+
str
|
38
|
+
end
|
39
|
+
|
40
|
+
def sanitize_string(str)
|
41
|
+
str.gsub("_", '\_')
|
42
|
+
end
|
43
|
+
|
44
|
+
def project_header(proj)
|
45
|
+
str = String.new
|
46
|
+
str << "#{sanitize_string(proj.namespace)}: #{sanitize_string(proj.name)}\\\\\n"
|
47
|
+
str << proj.status.to_s
|
48
|
+
str << " - #{sanitize_string(proj.location)}" if proj.location
|
49
|
+
str << " due: #{proj.due}" if proj.due
|
50
|
+
str << " time: #{proj.time_estimate}" if proj.time_estimate
|
51
|
+
str << " \\\\\n"
|
52
|
+
str
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/lib/plansheet/sheet.rb
CHANGED
@@ -1,55 +1,3 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
module Plansheet
|
5
|
-
# The Sheet class constructs a Markdown/LaTeX file for use with pandoc
|
6
|
-
class Sheet
|
7
|
-
def initialize(output_file, project_arr)
|
8
|
-
projects_str = String.new
|
9
|
-
projects_str << sheet_header
|
10
|
-
|
11
|
-
project_arr.each do |p|
|
12
|
-
projects_str << project_minipage(p)
|
13
|
-
end
|
14
|
-
puts "Writing to #{output_file}"
|
15
|
-
File.write(output_file, projects_str)
|
16
|
-
end
|
17
|
-
|
18
|
-
def sheet_header
|
19
|
-
<<~FRONTMATTER
|
20
|
-
---
|
21
|
-
geometry: margin=1.5cm
|
22
|
-
---
|
23
|
-
\\thispagestyle{empty}
|
24
|
-
|
25
|
-
# Date: #{Date.today}
|
26
|
-
FRONTMATTER
|
27
|
-
end
|
28
|
-
|
29
|
-
def project_minipage(proj)
|
30
|
-
str = String.new
|
31
|
-
str << "\\begin{minipage}{6cm}\n"
|
32
|
-
str << project_header(proj)
|
33
|
-
proj&.tasks&.each do |t|
|
34
|
-
str << "$\\square$ #{sanitize_string(t)} \\\\\n"
|
35
|
-
end
|
36
|
-
str << "\\end{minipage}\n"
|
37
|
-
str
|
38
|
-
end
|
39
|
-
|
40
|
-
def sanitize_string(str)
|
41
|
-
str.gsub("_", '\_')
|
42
|
-
end
|
43
|
-
|
44
|
-
def project_header(proj)
|
45
|
-
str = String.new
|
46
|
-
str << "#{sanitize_string(proj.namespace)}: #{sanitize_string(proj.name)}\\\\\n"
|
47
|
-
str << proj.status.to_s
|
48
|
-
str << " - #{sanitize_string(proj.location)}" if proj.location
|
49
|
-
str << " due: #{proj.due}" if proj.due
|
50
|
-
str << " time: #{proj.time_estimate}" if proj.time_estimate
|
51
|
-
str << " \\\\\n"
|
52
|
-
str
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
3
|
+
require_relative "sheet/latex"
|
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.
|
4
|
+
version: 0.26.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-07-
|
11
|
+
date: 2022-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dc-kwalify
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- lib/plansheet/project/stringify.rb
|
77
77
|
- lib/plansheet/project/yaml.rb
|
78
78
|
- lib/plansheet/sheet.rb
|
79
|
+
- lib/plansheet/sheet/latex.rb
|
79
80
|
- lib/plansheet/version.rb
|
80
81
|
homepage: https://dafyddcrosby.com
|
81
82
|
licenses:
|