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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d6783f3c90e7d781de642be7c98e2a8469e48d8576405a5554cf92282632f2e
4
- data.tar.gz: 39de90d2ad1d6c371c1626b56ffba32d79e293b9adaa0c01bb3d8113cc16225d
3
+ metadata.gz: e4064aa7163d4ad0b941b17a4b3f10541fde5188d2b84e1c5b8fe43fd82eadbb
4
+ data.tar.gz: a67509fae6401fd25e42ab35ef810a0bba0f82f73173ab2a5061206b2e4d9f62
5
5
  SHA512:
6
- metadata.gz: d30350f829b3db7e0b6d1163d55b835c55bef408c1c34ffc16a209837b9f4f1573b2d51d46fe294c4e48eeb1018a11a04701b100edce353c68c39becff5c9cca
7
- data.tar.gz: fac00b40c31909b7d785e8938f49f877f02872875d72246bc8413dd84d34b857a0a3840605d0e22ac60a288091a6d28629eb915bb3ece4b2930c5e1ea8fbf841
6
+ metadata.gz: b4d07c885342474b0205fceec3e625fc000dd92b164987eaab1603ce453d1e7473c3281a30047470d8c15f7e4dce9e587f1c19365a0d7a56a12b93478f038024
7
+ data.tar.gz: 7ab35b12fcdc63e00d0dd6e2b2b54e4d27634d1b950c2298c55886b3f8c461cc272bbb507404edfad156ff646148802f099d3c1a054bd000284622f1f1e9ce72
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plansheet (0.25.1)
4
+ plansheet (0.26.0)
5
5
  dc-kwalify (~> 1.0)
6
6
  diffy (= 3.4.2)
7
7
  rgl (= 0.5.8)
@@ -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
@@ -1,55 +1,3 @@
1
1
  # frozen_string_literal: true
2
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
3
+ require_relative "sheet/latex"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plansheet
4
- VERSION = "0.25.1"
4
+ VERSION = "0.26.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.25.1
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-12 00:00:00.000000000 Z
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: