-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a visual timeline so you can see your progress.
- Loading branch information
Showing
5 changed files
with
64 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
#--------------------------------------------------------------------------------------- | ||
# | ||
# 123 - a timeline to help your work flow: do -> doing -> done | ||
# 123.do - a timeline to help your work flow: do -> doing -> done | ||
# | ||
# Author: Nigel Hamilton ([email protected]) | ||
# Copyright licence: Artistic 2.0 | ||
|
@@ -13,8 +13,9 @@ use Do::Editor; | |
use Do::Timeline::Entry; | ||
use Do::Timeline::Grammar; | ||
use Do::Timeline::Viewport; | ||
use Do::Timeline::UI; | ||
|
||
class Do::Timeline does Do::Timeline::Viewport { | ||
class Do::Timeline does Do::Timeline::Viewport does Do::Timeline::UI { | ||
|
||
has $.file; | ||
has %.entries; | ||
|
@@ -84,22 +85,36 @@ class Do::Timeline does Do::Timeline::Viewport { | |
my $entry-at-line = $.file.IO.slurp.match(/^ .*? '[' $entry-id ']'/).lines.elems // 1; | ||
self.open-editor-at-line($entry-at-line); | ||
} | ||
|
||
multi method edit-matching-line (Str $match-string, $offset = 0) { | ||
my $line-number = 1; | ||
for $.file.IO.slurp.lines -> $line { | ||
last if $line.starts-with($match-string); | ||
$line-number++; | ||
} | ||
|
||
Do::Editor.new.open($!file, $line-number + $offset); | ||
|
||
# reload the 123.do file and save any changes - this enables entries to move | ||
self.load; | ||
self.save; | ||
} | ||
|
||
multi method edit { | ||
# which line is NOW on in the 123.do file? | ||
my $now-at-line = $.file.IO.slurp.match(/^.*?^^NOW/).lines.elems // 0; | ||
self.open-editor-at-line(1 + $now-at-line); | ||
} | ||
|
||
submethod estimate-tasks-per-day { | ||
method estimate-tasks-per-day { | ||
my %past-entries = self.entries.values.map(*.Slip).grep(*.is-past).classify(*.daycount); | ||
|
||
# default to 6 tasks per day | ||
return 6 unless %past-entries; | ||
|
||
my @past-day-entry-counts = %past-entries.values.map(*.elems); | ||
|
||
# average daily velocity previously in the past | ||
# average daily velocity based on previously completed tasks in the past | ||
return @past-day-entry-counts.sum div @past-day-entry-counts.elems; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters