plansheet 0.7.0 → 0.7.1

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: 98932ed8f5a5d06da4b2f6135d1321e5376a1af2f837d4a65b9f806c7f06b8d9
4
- data.tar.gz: 0ef6f026f7bcbc4712d008ca2843a0b5a9d1715038b2fc91534a8c9951697ec6
3
+ metadata.gz: d9c1a116df170c31d73c29dce213b757743c0e49bbee8c86a47ce7ce09009730
4
+ data.tar.gz: 2baeb58d82c15823d9beb3e6504bb452e14cabded159f9931bf2300fdaed5d8f
5
5
  SHA512:
6
- metadata.gz: 95217512c48168c26ef2c5f937dd8b94530bccea1149c2e90df1db039243b9ffb4582efe26ea14ae6393845daa4d8f5a4fec36cff82231d7b6ab6fc6a1255ff6
7
- data.tar.gz: '095dcda8264517252297a7aba139f8c51bddfbe04880acb9a16d2eb3f4a479003e1ee453902acf65fde2ad89720b522b6d6bd118e3f1f3202f2aab9f9ec50d04'
6
+ metadata.gz: a87a4f7386a651ca82d385600f7b32ee78ff436406d596b6c2966ed721bdcee16f9bd4ad73b158be03305541dceda0d525e68ea2dc520a028fb603a6b5f0c1c0
7
+ data.tar.gz: d679906ef154e9b84e9282e1811ac0dff8da8b4dfb17c6e0e24d7f08226933346c4229468ddf51526e7532af7bdfd9a502557b64efc6439c128716a380e86d86
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-06-02 13:34:43 UTC using RuboCop version 1.29.1.
3
+ # on 2022-06-02 13:59:36 UTC using RuboCop version 1.29.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -11,6 +11,11 @@
11
11
  Metrics/CyclomaticComplexity:
12
12
  Max: 8
13
13
 
14
+ # Offense count: 1
15
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
16
+ Metrics/MethodLength:
17
+ Max: 12
18
+
14
19
  # Offense count: 1
15
20
  # Configuration parameters: IgnoredMethods.
16
21
  Metrics/PerceivedComplexity:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plansheet (0.7.0)
4
+ plansheet (0.7.1)
5
5
  dc-kwalify (~> 1.0)
6
6
 
7
7
  GEM
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "yaml"
4
+ require "date"
4
5
 
5
6
  module Plansheet
6
7
  PROJECT_STATUS_PRIORITY = {
@@ -57,6 +58,12 @@ module Plansheet
57
58
  "notes":
58
59
  desc: Free-form notes string
59
60
  type: str
61
+ "due":
62
+ desc: Due date of the task (WIP)
63
+ type: date
64
+ "defer":
65
+ desc: Defer task until this day (WIP)
66
+ type: date
60
67
  "externals":
61
68
  desc: List of external commitments, ie who else cares about project completion?
62
69
  type: seq
@@ -91,9 +98,10 @@ module Plansheet
91
98
 
92
99
  # NOTE: The order of these affects presentation!
93
100
  STRING_PROPERTIES = %w[priority status location notes].freeze
101
+ DATE_PROPERTIES = %w[due defer].freeze
94
102
  ARRAY_PROPERTIES = %w[externals urls tasks done].freeze
95
103
 
96
- ALL_PROPERTIES = STRING_PROPERTIES + ARRAY_PROPERTIES
104
+ ALL_PROPERTIES = STRING_PROPERTIES + DATE_PROPERTIES + ARRAY_PROPERTIES
97
105
 
98
106
  attr_reader :name, *ALL_PROPERTIES
99
107
 
@@ -146,6 +154,9 @@ module Plansheet
146
154
  STRING_PROPERTIES.each do |o|
147
155
  str << stringify_string_property(o)
148
156
  end
157
+ DATE_PROPERTIES.each do |o|
158
+ str << stringify_string_property(o)
159
+ end
149
160
  ARRAY_PROPERTIES.each do |o|
150
161
  str << stringify_array_property(o)
151
162
  end
@@ -160,6 +171,14 @@ module Plansheet
160
171
  end
161
172
  end
162
173
 
174
+ def stringify_date_property(prop)
175
+ if instance_variable_defined? "@#{prop}"
176
+ "#{prop}: #{instance_variable_get("@#{prop}")}\n"
177
+ else
178
+ ""
179
+ end
180
+ end
181
+
163
182
  def stringify_array_property(prop)
164
183
  str = String.new
165
184
  if instance_variable_defined? "@#{prop}"
@@ -188,7 +207,7 @@ module Plansheet
188
207
  def initialize(path)
189
208
  @path = path
190
209
  # TODO: this won't GC, inline validation instead?
191
- @raw = YAML.load_file(path)
210
+ @raw = YAML.load_file(path, permitted_classes: [Date])
192
211
  validate_schema
193
212
  @projects = @raw.map { |proj| Project.new proj }
194
213
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plansheet
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plansheet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Crosby