syc-task 0.3.2 → 1.0.0
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 +5 -13
- data/README.rdoc +73 -30
- data/bin/console_timer +1 -1
- data/bin/syctask +7 -38
- data/lib/syctask/environment.rb +157 -151
- data/lib/syctask/evaluator.rb +21 -1
- data/lib/syctask/scanner.rb +14 -4
- data/lib/syctask/schedule.rb +126 -118
- data/lib/syctask/settings.rb +6 -4
- data/lib/syctask/statistics.rb +6 -0
- data/lib/syctask/task.rb +91 -82
- data/lib/syctask/task_planner.rb +52 -16
- data/lib/syctask/task_scheduler.rb +3 -3
- data/lib/syctask/task_service.rb +13 -10
- data/lib/syctask/task_tracker.rb +12 -6
- data/lib/syctask/version.rb +2 -2
- data/lib/syctime/time_util.rb +62 -11
- data/lib/sycutil/console_timer.rb +5 -9
- metadata +198 -149
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MmRkMzk0ZWZiYmZjY2M1MjE0ZjQ3MzA2NTZmNzNjMDMzMTgxMjExZA==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6ccfa0f5931e92b569b0eea689ab3a32eb7f11f70678c4bd0974b4e450bde3da
|
4
|
+
data.tar.gz: 2095cd5842e87b9332c208e5043eeba5b79119dbabe258835bc4c17528cd18c8
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NDI5Mzk5OWNiMTg2NWUwOWY0ZWM0YjIzNDA1MzE1NWU0MzNkMTVlNTU1YTg2
|
11
|
-
MjY1YmE5NmQ3OWIyOGYyOGM4YmNhMzg5YzJhOTI0MjNiNmYwZmU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MGY5ZGE4NjZkYTJhMGYzNzBjNmMyZjkyMWYzMGMyOWMyNTliMGQ3ZDIyNjg4
|
14
|
-
OTYwMDdiMWMxZWI2Mjc4YjRjMDAzYzA3NzdhYjczMzIwNjA0MTg0NzY5NWU5
|
15
|
-
ZTMyYmM2Y2I2ZTE2ZjRjMmUzNGE2MTMwNzU0M2VhM2FiMTcyY2M=
|
6
|
+
metadata.gz: 999425e2e7e32be1044a63a622471e65362ff49150c2b6b8e0bac2ce9b7dbea641c1939ac03fde98c09189c4929afe6605d76ae0e79abc8d283cf25d3bfaeb53
|
7
|
+
data.tar.gz: 4e3dbce634f217b62980b2c7ce8b8a77c08a9b40e54a3e1c2b799803ad2b605ce6e50f595ac9336cffd05d6f8f81bed8f31bd090b78b55e1c4e40b3c58f37ad9
|
data/README.rdoc
CHANGED
@@ -58,6 +58,7 @@ list the tasks in a table, e.g. markdown
|
|
58
58
|
Some text before
|
59
59
|
|
60
60
|
@tasks|
|
61
|
+
|
61
62
|
title |description |follow_up |due_date |prio
|
62
63
|
----------------|--------------------------|----------|----------|----
|
63
64
|
Schedule meeting|Invite all developers |2016-09-12|2016-10-12|1
|
@@ -72,13 +73,13 @@ list the tasks in a table, e.g. markdown
|
|
72
73
|
The example above scans all tasks due to the plural 'tasks'. It also scans all
|
73
74
|
tasks that are separated with non-task text and occur after the annotation and
|
74
75
|
confirm to the field structure. Lines that start with '-' will be ignored. So
|
75
|
-
if you want to skip only a
|
76
|
+
if you want to skip only a few tasks within a task list prepend them with '-'.
|
76
77
|
If you have tasks with different fields then you have to add another annotation
|
77
78
|
with the new field structure.
|
78
79
|
|
79
80
|
Possible fields are
|
80
81
|
|
81
|
-
title - the title of the task
|
82
|
+
title - the title of the task - mandatory field!
|
82
83
|
description - the description of the task
|
83
84
|
follow_up - the follow-up date of the task in the form yyyy-mm-dd
|
84
85
|
due_date - the due-date of the task in the form yyyy-mm-dd
|
@@ -86,7 +87,25 @@ Possible fields are
|
|
86
87
|
tags - tags the task is annotated with
|
87
88
|
note - a note for the task
|
88
89
|
|
89
|
-
|
90
|
+
Note: follow_up and due_date can also be written as Follow-up and Due-Date. Also
|
91
|
+
case is ignored.
|
92
|
+
|
93
|
+
As inidcated in the list the title column is mandatory. Without the title column
|
94
|
+
scan will raise an error during a scan.
|
95
|
+
|
96
|
+
Fields that are not part of the above list will be ignored.
|
97
|
+
|
98
|
+
# | Title | Who
|
99
|
+
- | ------------------------------------ | ---
|
100
|
+
1 | Schedule meeting with all developers | Me
|
101
|
+
2 | Write letter to practice writing | You
|
102
|
+
|
103
|
+
In the table only the column Title will be scanned. The '#' and 'Who' column
|
104
|
+
will be ignored during scan. This table is also a table for a minimum scan
|
105
|
+
structure. You need at least to provide a title column so the scan function
|
106
|
+
will recognize the table as a task list.
|
107
|
+
|
108
|
+
Scanning tasks from files
|
90
109
|
|
91
110
|
$ syctask scan 2016-09-10-mom.md 2016-09-09-mom.md
|
92
111
|
|
@@ -171,6 +190,8 @@ added at or after the current time within the time schedule. Tasks that are done
|
|
171
190
|
and scheduled in the future are not shown. Tasks done and in the past are shown
|
172
191
|
with the actual processing time.
|
173
192
|
|
193
|
+
The day starts at 00:00 and ends at 23:59. So 24:00 should be 00:00.
|
194
|
+
|
174
195
|
Create a schedule with working time from 8a.m. to 6p.m. and meetings between
|
175
196
|
9a.m. and 9.30a.m. and 1p.m. and 2.45p.m.
|
176
197
|
$ syctask schedule -w "8:00-18:00" -b "9:00-9:30,13:00-14:45"
|
@@ -241,11 +262,11 @@ Search tasks that match a pattern
|
|
241
262
|
$ syctask list --id "<10" --follow_up ">2013-02-25" --title "My \w task"
|
242
263
|
|
243
264
|
===Inspect tasks
|
244
|
-
Lists each
|
245
|
-
|
265
|
+
Lists each unplanned task and allows to edit, delete, mark as done or plan for
|
266
|
+
today or another day
|
246
267
|
$ syctask inspect
|
247
268
|
0016 Create command for inspection
|
248
|
-
(e)dit, (d)one, de(l)ete, (p)lan, (c)omplete, (s)kip, (q)uit
|
269
|
+
(e)dit, (d)one, de(l)ete, (p)lan, da(t)e, (c)omplete, (s)kip, (b)ack, (q)uit
|
249
270
|
|
250
271
|
===Edit task
|
251
272
|
Edit a task with ID 10 in vi
|
@@ -396,7 +417,7 @@ with
|
|
396
417
|
==== Create schedule
|
397
418
|
I create a schedule with my working hours and meetings that have been scheduled
|
398
419
|
with
|
399
|
-
$ syctask -w "8:00-18:00" -b "9:00-10:00,14:30-16:00" -m "Team,Status"
|
420
|
+
$ syctask schedule -w "8:00-18:00" -b "9:00-10:00,14:30-16:00" -m "Team,Status"
|
400
421
|
|
401
422
|
==== Create an agenda
|
402
423
|
I assign the topics I want to discuss in the meetings to the meetings with
|
@@ -434,7 +455,9 @@ directory with the ID and save the files in this directory. If there is an
|
|
434
455
|
existing directory I link to the file from the ID directory
|
435
456
|
|
436
457
|
==Supported platform
|
437
|
-
syc-task has been tested with 1.9.3.
|
458
|
+
syc-task up to version 0.4.2 has been tested with Ruby 1.9.3. Version 0.4.2 also runs
|
459
|
+
with Ruby 2.7. It also works in Windows using Cygwin. Version 1.0.0 has been upgraded
|
460
|
+
to Ruby 3.2.
|
438
461
|
|
439
462
|
==Add TAB-completion to syctask
|
440
463
|
To activate bash's TAB-completion following lines have to be added to ~/.bashrc
|
@@ -484,16 +507,16 @@ To print to Dell-B1160w-Mono the following command can be used
|
|
484
507
|
$ syctask schedule | lpr -P Dell-B1160w-Mono
|
485
508
|
|
486
509
|
==Release Notes
|
487
|
-
Version 0.0.1
|
510
|
+
===Version 0.0.1
|
488
511
|
Implementation of new, update, list and done commands.
|
489
512
|
|
490
|
-
Version 0.0.4
|
513
|
+
===Version 0.0.4
|
491
514
|
* delete: deleting tasks or remove tasks from a task plan
|
492
515
|
* plan: plan tasks and add them to the task plan
|
493
516
|
* schedule: create a schedule with work and busy time and assign the tasks from
|
494
517
|
the task plan to the free times
|
495
518
|
|
496
|
-
Version 0.0.6
|
519
|
+
===Version 0.0.6
|
497
520
|
* start: start a task and track the lead time
|
498
521
|
* stop: stop the tracking and print the lead time of the task
|
499
522
|
* start, stop: the task is logged in the ~/.tasks/task.log file when added and
|
@@ -506,10 +529,10 @@ Version 0.0.6
|
|
506
529
|
the provided dates task plan. If both dates are set the task is added to both
|
507
530
|
dates task plans
|
508
531
|
|
509
|
-
Version 0.0.7
|
532
|
+
===Version 0.0.7
|
510
533
|
* updated rdoc
|
511
534
|
|
512
|
-
Version 0.1.15
|
535
|
+
===Version 0.1.15
|
513
536
|
* IDs are now unique independent of the task or project directory. After
|
514
537
|
upgrading from a version 0.0.7 or older the user asked whether to re-index
|
515
538
|
the tasks. It is adviced to tar the tasks before re-indexing with
|
@@ -550,24 +573,25 @@ Version 0.1.15
|
|
550
573
|
mark as done or plan
|
551
574
|
* Update command now has a duration flag to set the task's duration
|
552
575
|
|
553
|
-
Version 0.2.0
|
576
|
+
====Version 0.2.0
|
554
577
|
* Migrated from TestUnit to Minitest
|
555
|
-
* Implemented _timeleap_ {<img src="https://badge.fury.io/rb/timeleap.svg" alt="Gem Version" />}[http://badge.fury.io/rb/timeleap]
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
578
|
+
* Implemented _timeleap_ {<img src="https://badge.fury.io/rb/timeleap.svg" alt="Gem Version" />}[http://badge.fury.io/rb/timeleap]
|
579
|
+
which allows to specify additional time distances to yesterday, today
|
580
|
+
tomorrow. Time distances come in two flavors as long and short forms.
|
581
|
+
|
582
|
+
Examples for long forms are
|
583
|
+
- yesterday|today|tomorrow
|
584
|
+
- next|previous_monday|tuesday|...|sunday
|
585
|
+
- monday|tuesday|...|sunday_in|back_1_week|month|year
|
586
|
+
- in|back_10_days|weeks|months|years
|
587
|
+
|
588
|
+
Examples for short forms are
|
589
|
+
- y|tod|tom
|
590
|
+
- n|pmo|tu|..|su
|
591
|
+
- mo|tu|...|sui|b1w|m|y
|
592
|
+
- i|b10d|w|m|y
|
569
593
|
|
570
|
-
Version 0.2.1
|
594
|
+
====Version 0.2.1
|
571
595
|
* Fix a bug in `syctask delete --plan`
|
572
596
|
* Add indicator '>' to task list when task contains notes
|
573
597
|
* Refactor migration from version 0.0.7 and when user has deleted system files.
|
@@ -575,11 +599,30 @@ Version 0.2.1
|
|
575
599
|
also define directories to be excluded. This is especially helpful to omit
|
576
600
|
search in large mounted directories, like from NAS servers.
|
577
601
|
|
578
|
-
Version 0.3.1
|
602
|
+
====Version 0.3.1
|
579
603
|
* Add csv output spearated by ';' to the list command
|
580
604
|
* Fix bug when schedule file is empty
|
581
605
|
* Add scan command to scan tasks from files
|
582
606
|
|
607
|
+
====Version 0.3.2
|
608
|
+
* Fix bugs of missing class lib/syctask/scanner.rb
|
609
|
+
|
610
|
+
====Version 0.4.2
|
611
|
+
* delete command can take now ranges of ids, e.g. 1,2,4-8,5,20-25
|
612
|
+
* inspect can now go back in the task list
|
613
|
+
* inspect will now show the updated task after making changes to the task in
|
614
|
+
edit
|
615
|
+
* inspect allows to specify a follow_up date
|
616
|
+
* scan will ignore columns that are not part of a syctask task
|
617
|
+
* scan recognizes 'Follow-up' as well as 'follow_up' now. That is an underscore
|
618
|
+
can be replaced with '-'
|
619
|
+
* Fix bug when scanning tables that have spaces between separator and column
|
620
|
+
* When tasks.log file is missing `syctask inspect` prints warning with reason
|
621
|
+
why statistics cannot be printed
|
622
|
+
|
623
|
+
====Version 1.0.0
|
624
|
+
* Upgrade to Ruby 3.2.2
|
625
|
+
|
583
626
|
==Development
|
584
627
|
Pull from Github and then run
|
585
628
|
|
data/bin/console_timer
CHANGED
data/bin/syctask
CHANGED
@@ -48,7 +48,7 @@ command :settings do |c|
|
|
48
48
|
puts options[:taskdir]
|
49
49
|
dir = File.expand_path(options[:taskdir]) unless options[:taskdir].empty?
|
50
50
|
if dir
|
51
|
-
unless File.
|
51
|
+
unless File.exist? dir
|
52
52
|
puts sprintf("Directory %s doesn't exist!", dir).color(:red)
|
53
53
|
print sprintf("%s ", "Create it (Y/n)?").color(:red)
|
54
54
|
set_taskdir = gets.chomp == 'Y'
|
@@ -99,7 +99,7 @@ command :info do |c|
|
|
99
99
|
dir = options[:dir]
|
100
100
|
dir ||= ENV['HOME']
|
101
101
|
dir = File.expand_path(dir)
|
102
|
-
help_now! "Directory #{dir} does not exists" unless File.
|
102
|
+
help_now! "Directory #{dir} does not exists" unless File.exist? dir
|
103
103
|
id = options[:id]
|
104
104
|
if id
|
105
105
|
tasks = Syctask::get_files(dir, [], /#{id}\.task/)
|
@@ -212,8 +212,8 @@ command :delete do |c|
|
|
212
212
|
c.flag :plan
|
213
213
|
|
214
214
|
c.desc 'IDs of the tasks to remove'
|
215
|
-
c.arg_name 'ID1,ID2
|
216
|
-
c.flag [:i, :id], :must_match => /^\d+(?:,\d+)*|\d+/
|
215
|
+
c.arg_name 'ID1,ID2,ID3-ID4,...,IDn'
|
216
|
+
c.flag [:i, :id], :must_match => /^\d+(?:,\d+|-\d+)*|\d+/
|
217
217
|
|
218
218
|
c.action do |global_options,options,args|
|
219
219
|
help_now! "You must provide tasks ids to delete" unless options[:id]
|
@@ -324,8 +324,8 @@ command :edit do |c|
|
|
324
324
|
task = @service.read(global_options[:taskdir], args[0])
|
325
325
|
if task
|
326
326
|
task_file = "#{task.dir}/#{task.id}.task"
|
327
|
-
if File.
|
328
|
-
system "vi #{task_file}" if File.
|
327
|
+
if File.exist? task_file
|
328
|
+
system "vi #{task_file}" if File.exist? task_file
|
329
329
|
else
|
330
330
|
puts sprintf("--> Task %s doesn't exist", task_file).color(:red)
|
331
331
|
end
|
@@ -682,7 +682,7 @@ pre do |global,command,options,args|
|
|
682
682
|
global[:taskdir] = global[:t] = dir.squeeze("/")
|
683
683
|
end
|
684
684
|
|
685
|
-
if command.name == :new and not File.
|
685
|
+
if command.name == :new and not File.exist? global[:taskdir]
|
686
686
|
puts sprintf("Directory %s doesn't exist!", global[:taskdir]).color(:red)
|
687
687
|
print sprintf("%s", "Create it (Y/n)? ").color(:red)
|
688
688
|
proceed = STDIN.gets.chomp == 'Y'
|
@@ -710,37 +710,6 @@ on_error do |exception|
|
|
710
710
|
end
|
711
711
|
end
|
712
712
|
|
713
|
-
# Extracts the time out of a time string. Accepts 'today', 'tomorrow',
|
714
|
-
# 'yesterday' or a date in the form 'YYYY-MM-DD'. Returns the date contained in
|
715
|
-
# the time_string or if time = true in a Time object
|
716
|
-
def extract_time(time_string,time=false)
|
717
|
-
time_string = 'today' if time_string.nil?
|
718
|
-
|
719
|
-
if time_string.match(/\d{4}-\d{2}-\d{2}/)
|
720
|
-
date = time_string
|
721
|
-
date = Time.xmlschema("#{time_string}T00:00:00") if time
|
722
|
-
else
|
723
|
-
timeleap = SycTimeleap::TimeLeap.new
|
724
|
-
begin
|
725
|
-
date = timeleap.send(time_string)
|
726
|
-
date = date.to_s unless time
|
727
|
-
rescue NoMethodError
|
728
|
-
help_now! "Arguments may be 'time distances', YYYY-MM-DD or <RETURN>\n\n"+
|
729
|
-
"time distances are:\n"+
|
730
|
-
"* yesterday|today|tomorrow\n"+
|
731
|
-
"* next|previous_monday|tuesday|...|sunday\n"+
|
732
|
-
"* in|back_10_days|weeks|months|years\n"+
|
733
|
-
"* monday|tuesday|...|sunday_in|back_1_day|week|month|year\n"+
|
734
|
-
"Short forms are also possible:\n"+
|
735
|
-
"* y|tod|tom\n"+
|
736
|
-
"* n|pmo|tu|we|th|fr|sa|su\n"+
|
737
|
-
"* i|b10d|w|m|y\n"+
|
738
|
-
"* mo|tu|we|th|fr|sa|sui|b1d|w|m|y"
|
739
|
-
end
|
740
|
-
end
|
741
|
-
date
|
742
|
-
end
|
743
|
-
|
744
713
|
# Add task to task plan
|
745
714
|
def add_task_to_plan(task)
|
746
715
|
if task.options[:follow_up]
|