plansheet 0.24.1 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fae1a985802ab6da236f5f3d54224b4468ae5cc5e6beba86510293e7a92fe0a8
4
- data.tar.gz: b2fe70fc1cb48dd794f561ff5037d2311366bb7e64c901cf4f32d33c0592e45b
3
+ metadata.gz: 1d6783f3c90e7d781de642be7c98e2a8469e48d8576405a5554cf92282632f2e
4
+ data.tar.gz: 39de90d2ad1d6c371c1626b56ffba32d79e293b9adaa0c01bb3d8113cc16225d
5
5
  SHA512:
6
- metadata.gz: f68b48246ce4e8b10c66dd805f783fd822886b168aa57bb7db71012934bd2f21f8a76c8f26dab6c8bf4f8156529b897a5d33c02cba2e67d39224579626ee00a0
7
- data.tar.gz: 751a5a7beffa1c35d7723521db61aa0ca26d1fafb6643017bfd2c3a3cb14e63dd5d4f775df34e2a9b644c24a8d582e0cd19d9cfd4a3b009673b9fb6d70faef55
6
+ metadata.gz: d30350f829b3db7e0b6d1163d55b835c55bef408c1c34ffc16a209837b9f4f1573b2d51d46fe294c4e48eeb1018a11a04701b100edce353c68c39becff5c9cca
7
+ data.tar.gz: fac00b40c31909b7d785e8938f49f877f02872875d72246bc8413dd84d34b857a0a3840605d0e22ac60a288091a6d28629eb915bb3ece4b2930c5e1ea8fbf841
data/.rubocop.yml CHANGED
@@ -11,6 +11,9 @@ Style/StringLiteralsInInterpolation:
11
11
  Enabled: true
12
12
  EnforcedStyle: double_quotes
13
13
 
14
+ Style/GuardClause:
15
+ Enabled: false
16
+
14
17
  Layout/LineLength:
15
18
  Max: 120
16
19
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- plansheet (0.24.1)
4
+ plansheet (0.25.1)
5
5
  dc-kwalify (~> 1.0)
6
6
  diffy (= 3.4.2)
7
7
  rgl (= 0.5.8)
@@ -198,7 +198,7 @@ module Plansheet
198
198
 
199
199
  puts "#{@path} has changed, writing"
200
200
  require "diffy"
201
- puts Diffy::Diff.new(updated_projects_string, yaml_dump(load_file)).to_s(:color)
201
+ puts Diffy::Diff.new(yaml_dump(load_file), updated_projects_string).to_s(:color)
202
202
  File.write @path, updated_projects_string
203
203
  end
204
204
 
@@ -138,13 +138,21 @@ module Plansheet
138
138
  # Convert the field to minutes
139
139
  @time_estimate_minutes = Plansheet.parse_time_duration(@time_estimate)
140
140
  end
141
- if @time_estimate_minutes # rubocop:disable Style/GuardClause
141
+ if @time_estimate_minutes
142
142
  # Rewrite time_estimate field
143
143
  @time_estimate = Plansheet.build_time_duration(@time_estimate_minutes)
144
144
 
145
145
  yms = yearly_minutes_saved
146
146
  @time_roi_payoff = yms.to_f / @time_estimate_minutes if yms
147
147
  end
148
+
149
+ if done?
150
+ @completed_on ||= Date.today unless recurring?
151
+ remove_instance_variable("@status") if @status
152
+ remove_instance_variable("@time_estimate") if @time_estimate
153
+ remove_instance_variable("@time_estimate_minutes") if @time_estimate
154
+ remove_instance_variable("@time_roi_payoff") if @time_roi_payoff
155
+ end
148
156
  end
149
157
 
150
158
  def yearly_minutes_saved
@@ -287,11 +295,6 @@ module Plansheet
287
295
  task_based_status
288
296
  end
289
297
 
290
- def process_recurring
291
- # TODO: Tasks will be moved from done->tasks if recurring project is
292
- # starting again
293
- end
294
-
295
298
  # Due date either explicit or recurring
296
299
  def due
297
300
  return @due if @due
@@ -345,6 +348,10 @@ module Plansheet
345
348
  status == "dropped" || status == "done"
346
349
  end
347
350
 
351
+ def done?
352
+ status == "done"
353
+ end
354
+
348
355
  def self.task_time_estimate(str)
349
356
  Plansheet.parse_time_duration(Regexp.last_match(1)) if str.match(TIME_EST_REGEX)
350
357
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plansheet
4
- VERSION = "0.24.1"
4
+ VERSION = "0.25.1"
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.24.1
4
+ version: 0.25.1
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 00:00:00.000000000 Z
11
+ date: 2022-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dc-kwalify