syc-task 0.4.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 +9 -2
- data/bin/console_timer +1 -1
- data/bin/syctask +5 -5
- data/lib/syctask/environment.rb +157 -151
- data/lib/syctask/scanner.rb +1 -1
- data/lib/syctask/schedule.rb +126 -118
- data/lib/syctask/settings.rb +6 -4
- data/lib/syctask/statistics.rb +1 -1
- data/lib/syctask/task.rb +91 -82
- data/lib/syctask/task_planner.rb +4 -4
- data/lib/syctask/task_scheduler.rb +3 -3
- data/lib/syctask/task_service.rb +10 -9
- data/lib/syctask/task_tracker.rb +10 -6
- data/lib/syctask/version.rb +2 -2
- data/lib/syctime/time_util.rb +32 -33
- data/lib/sycutil/console_timer.rb +5 -9
- metadata +112 -83
@@ -14,7 +14,6 @@ require 'rainbow'
|
|
14
14
|
# To stop the timer the semaphore has to be deleted
|
15
15
|
# FileUtils.rm semaphore
|
16
16
|
class ConsoleTimer
|
17
|
-
|
18
17
|
# Create a new ConsoleTimer with the time to count down, the task's ID and a
|
19
18
|
# semaphore. The semaphore is a file named id.track where id is equal to the
|
20
19
|
# provided id. The semaphore is checked for existence. If the semaphore is
|
@@ -32,7 +31,7 @@ class ConsoleTimer
|
|
32
31
|
while track
|
33
32
|
sleep 1
|
34
33
|
output
|
35
|
-
track = File.
|
34
|
+
track = File.exist? @semaphore
|
36
35
|
end
|
37
36
|
exit 0
|
38
37
|
end
|
@@ -49,16 +48,15 @@ class ConsoleTimer
|
|
49
48
|
end
|
50
49
|
seconds = difference % 60
|
51
50
|
minutes = difference / 60 % 60
|
52
|
-
hours = difference / 60 / 60 % 60
|
53
|
-
count_down =
|
51
|
+
hours = difference / 60 / 60 % 60
|
52
|
+
count_down = format('%d: %02d:%02d:%02d', @id, hours, minutes, seconds)
|
54
53
|
size = count_down.size
|
55
54
|
count_down = count_down.color(color)
|
56
|
-
command =
|
57
|
-
"tput cup 0 $(($(tput cols) - #{size}));"+
|
55
|
+
command = 'tput sc;' +
|
56
|
+
"tput cup 0 $(($(tput cols) - #{size}));" +
|
58
57
|
"echo #{count_down};tput rc"
|
59
58
|
system command
|
60
59
|
end
|
61
|
-
|
62
60
|
end
|
63
61
|
|
64
62
|
# Expects to receive parameters duration, id and semaphore
|
@@ -71,5 +69,3 @@ if ARGV.size == 3
|
|
71
69
|
else
|
72
70
|
exit -1
|
73
71
|
end
|
74
|
-
|
75
|
-
|
metadata
CHANGED
@@ -1,85 +1,113 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syc-task
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Sugar
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: aruba
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.2.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: byebug
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 11.1.3
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 11.1.3
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: rake
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
16
44
|
requirements:
|
17
|
-
- -
|
45
|
+
- - "~>"
|
18
46
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
47
|
+
version: 13.2.1
|
20
48
|
type: :development
|
21
49
|
prerelease: false
|
22
50
|
version_requirements: !ruby/object:Gem::Requirement
|
23
51
|
requirements:
|
24
|
-
- -
|
52
|
+
- - "~>"
|
25
53
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
54
|
+
version: 13.2.1
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: rdoc
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
|
-
- -
|
59
|
+
- - "~>"
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
61
|
+
version: 6.9.0
|
34
62
|
type: :development
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
|
-
- -
|
66
|
+
- - "~>"
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
68
|
+
version: 6.9.0
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
70
|
+
name: ruby-lsp
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
|
-
- -
|
73
|
+
- - "~>"
|
46
74
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
75
|
+
version: 0.22.1
|
48
76
|
type: :development
|
49
77
|
prerelease: false
|
50
78
|
version_requirements: !ruby/object:Gem::Requirement
|
51
79
|
requirements:
|
52
|
-
- -
|
80
|
+
- - "~>"
|
53
81
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
82
|
+
version: 0.22.1
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: shoulda
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
58
86
|
requirements:
|
59
|
-
- -
|
87
|
+
- - "~>"
|
60
88
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
89
|
+
version: 4.0.0
|
62
90
|
type: :development
|
63
91
|
prerelease: false
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
|
-
- -
|
94
|
+
- - "~>"
|
67
95
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
96
|
+
version: 4.0.0
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: gli
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
101
|
- - '='
|
74
102
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.
|
103
|
+
version: '2.22'
|
76
104
|
type: :runtime
|
77
105
|
prerelease: false
|
78
106
|
version_requirements: !ruby/object:Gem::Requirement
|
79
107
|
requirements:
|
80
108
|
- - '='
|
81
109
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.
|
110
|
+
version: '2.22'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: rainbow
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,17 +126,17 @@ dependencies:
|
|
98
126
|
name: timeleap
|
99
127
|
requirement: !ruby/object:Gem::Requirement
|
100
128
|
requirements:
|
101
|
-
- -
|
129
|
+
- - "~>"
|
102
130
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
131
|
+
version: 0.0.1
|
104
132
|
type: :runtime
|
105
133
|
prerelease: false
|
106
134
|
version_requirements: !ruby/object:Gem::Requirement
|
107
135
|
requirements:
|
108
|
-
- -
|
136
|
+
- - "~>"
|
109
137
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
111
|
-
description:
|
138
|
+
version: 0.0.1
|
139
|
+
description: "= Simple task organizer\nsyctask can be used to create, plan, prioritize
|
112
140
|
and schedule tasks.\n\n==Install\nThe application can be installed with\n $ gem
|
113
141
|
install syc-task\n\n== Usage\nsyctask provides basic task organizer functions as
|
114
142
|
create, update, list and \ncomplete a task. Additional functions are to plan tasks
|
@@ -194,16 +222,16 @@ description: ! "= Simple task organizer\nsyctask can be used to create, plan, pr
|
|
194
222
|
schedule command is invoked the planned tasks are \nadded at or after the current
|
195
223
|
time within the time schedule. Tasks that are done\nand scheduled in the future
|
196
224
|
are not shown. Tasks done and in the past are shown\nwith the actual processing
|
197
|
-
time.\n\
|
198
|
-
|
199
|
-
\"9:00-9:30,13:00-14:45\"\n\nAdd
|
200
|
-
-m \"Project status,Management meeting\"\n\nThe
|
201
|
-
\
|
202
|
-
\
|
203
|
-
\
|
204
|
-
a task to a meeting\n $ syctask schedule -a \"A:0\"\n\nwill
|
205
|
-
\
|
206
|
-
meeting\n\n A B\n ----///-|---|---|---///////-|---|---|---|\n
|
225
|
+
time.\n\nThe day starts at 00:00 and ends at 23:59. So 24:00 should be 00:00.\n\nCreate
|
226
|
+
a schedule with working time from 8a.m. to 6p.m. and meetings between\n9a.m. and
|
227
|
+
9.30a.m. and 1p.m. and 2.45p.m.\n $ syctask schedule -w \"8:00-18:00\" -b \"9:00-9:30,13:00-14:45\"\n\nAdd
|
228
|
+
titles to the meetings\n $ syctask schedule -m \"Project status,Management meeting\"\n\nThe
|
229
|
+
output will be\n Meetings\n --------\n A - Project status\n B - Management
|
230
|
+
meeting\n\n A B\n xxx-///-|---|---|---///////-|---|---|---|\n
|
231
|
+
\ 8 9 10 11 12 13 14 15 16 17 18\n 1\n\n Tasks\n -----\n 0
|
232
|
+
- 1: My first task\n\nAdding a task to a meeting\n $ syctask schedule -a \"A:0\"\n\nwill
|
233
|
+
print\n Meetings\n --------\n A - Project status\n 1 - My first
|
234
|
+
task\n B - Management meeting\n\n A B\n ----///-|---|---|---///////-|---|---|---|\n
|
207
235
|
\ 8 9 10 11 12 13 14 15 16 17 18\n \n\n Tasks\n -----\n 0:
|
208
236
|
1 - My first task\n\nA task that is re-scheduled with\n $ syctask update 1 -f
|
209
237
|
tomorrow\n\nwill be shown as done (green) in the schedule and instead of separator
|
@@ -283,8 +311,8 @@ description: ! "= Simple task organizer\nsyctask can be used to create, plan, pr
|
|
283
311
|
(optionally)\nIf I want to process the tasks in a specific sequence I prioritize
|
284
312
|
the tasks\nwith \n $ syctask prio\n\n==== Create schedule\nI create a schedule
|
285
313
|
with my working hours and meetings that have been scheduled \nwith \n $ syctask
|
286
|
-
-w \"8:00-18:00\" -b \"9:00-10:00,14:30-16:00\" -m \"Team,Status\"\n\n====
|
287
|
-
an agenda\nI assign the topics I want to discuss in the meetings to the meetings
|
314
|
+
schedule -w \"8:00-18:00\" -b \"9:00-10:00,14:30-16:00\" -m \"Team,Status\"\n\n====
|
315
|
+
Create an agenda\nI assign the topics I want to discuss in the meetings to the meetings
|
288
316
|
with\n syctask schedule -a \"A:1,3,6;B:3,5\"\n \n==== Start a task\nTo begin
|
289
317
|
I start the first task in the schedule with syctask start -p ID \n(where ID is the
|
290
318
|
ID of the planned (-p) tasks)\n $ syctask start -p 10\n\n==== End a task\nTo
|
@@ -297,29 +325,31 @@ description: ! "= Simple task organizer\nsyctask can be used to create, plan, pr
|
|
297
325
|
prepend with the ID and move the e-mail to a\n<b>open topics</b> directory.\n\n*
|
298
326
|
Files\nIf I create files in the course of a task I create a folder in the task\ndirectory
|
299
327
|
with the ID and save the files in this directory. If there is an\nexisting directory
|
300
|
-
I link to the file from the ID directory\n\n==Supported platform\nsyc-task
|
301
|
-
tested with 1.9.3.
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
schedule\n
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
and
|
328
|
+
I link to the file from the ID directory\n\n==Supported platform\nsyc-task up to
|
329
|
+
version 0.4.2 has been tested with Ruby 1.9.3. Version 0.4.2 also runs\nwith Ruby
|
330
|
+
2.7. It also works in Windows using Cygwin. Version 1.0.0 has been upgraded\nto
|
331
|
+
Ruby 3.2.\n\n==Add TAB-completion to syctask\nTo activate bash's TAB-completion
|
332
|
+
following lines have to be added to ~/.bashrc\n\n complete -F get_syctask_commands
|
333
|
+
syctask\n\n function get_syctask_commands\n {\n if [ -z $2 ] ; then\n
|
334
|
+
\ COMPREPLY=(`syctask help -c`)\n else\n COMPREPLY=(`syctask help
|
335
|
+
-c $2`)\n fi\n }\n\nAfter ~/.bashrc has been updated the shell session has
|
336
|
+
to be restarted with\n $ source ~/.bashrc\n\nNow syctask followed by TAB TAB
|
337
|
+
will print\n\n $ syctask <TAB><TAB>\n delete done list plan scan stop _doc
|
338
|
+
help new prio schedule start update\n \nTo complete a command we can type\n\n $
|
339
|
+
syctask sch<TAB>\n\nwhich will complete to\n\n $ syctask schedule\n\n==Output
|
340
|
+
to Printer\nTo print syctask's output to a printer pipe the command to lpr\n\n $
|
341
|
+
syctask schedule | lpr\n\nThis will print the schedule to the default printer. \n\nTo
|
342
|
+
determine all available printer lpstat can be used with the lpstat -a command\n\n
|
343
|
+
\ $ lpstat -a\n Canon-LBP6650-3470 accepting requests since Sat 16 Mar 2013
|
344
|
+
04:26:15 PM CET\n Dell-B1160w-Mono accepting requests since Sat 16 Mar 2013 04:27:45
|
345
|
+
PM CET\n \nTo print to Dell-B1160w-Mono the following command can be used\n\n
|
346
|
+
\ $ syctask schedule | lpr -P Dell-B1160w-Mono\n\n==Release Notes\n===Version
|
347
|
+
0.0.1 \nImplementation of new, update, list and done commands.\n\n===Version 0.0.4\n*
|
348
|
+
delete: deleting tasks or remove tasks from a task plan\n* plan: plan tasks and
|
349
|
+
add them to the task plan\n* schedule: create a schedule with work and busy time
|
350
|
+
and assign the tasks from\n the task plan to the free times\n\n===Version 0.0.6\n*
|
351
|
+
start: start a task and track the lead time\n* stop: stop the tracking and print
|
352
|
+
the lead time of the task\n* start, stop: the task is logged in the ~/.tasks/task.log
|
323
353
|
file when added and\n when stopped\n* prio: prioritize tasks in the task plan,
|
324
354
|
that is specifying the sequence in\n that the tasks should be conducted\n* plan:
|
325
355
|
--move flag added to move tasks from the specified plan to another days\n task
|
@@ -380,17 +410,17 @@ description: ! "= Simple task organizer\nsyctask can be used to create, plan, pr
|
|
380
410
|
'Follow-up' as well as 'follow_up' now. That is an underscore\n can be replaced
|
381
411
|
with '-'\n* Fix bug when scanning tables that have spaces between separator and
|
382
412
|
column\n* When tasks.log file is missing `syctask inspect` prints warning with reason\n
|
383
|
-
\ why statistics cannot be printed\n\n
|
384
|
-
\n\n $ bundle install \n \nNew classes have to be
|
385
|
-
the interface can be done with GLI_DEBUG:
|
386
|
-
|
387
|
-
\
|
388
|
-
test and start with test_.\n\nThere is a rake file
|
389
|
-
\
|
390
|
-
in verbose mode\n\n $ cucumber\n\nor if you prefer
|
391
|
-
rake features\n\n==License\nsyc-task is released under
|
392
|
-
[http://
|
393
|
-
- RubyGems\n"
|
413
|
+
\ why statistics cannot be printed\n\n====Version 1.0.0\n* Upgrade to Ruby 3.2.2\n\n==Development\nPull
|
414
|
+
from Github and then run \n\n $ bundle install \n \nNew classes have to be
|
415
|
+
added to 'lib/syctask.rb'\n\nDebugging the interface can be done with GLI_DEBUG:
|
416
|
+
\n\n $ bundle exec env GLI_DEBUG=true bin/syctask\n\nBuilding and pushing the
|
417
|
+
gemfile to Rubygems\n\n $ gem build syctask.gemspec\n $ gem push syc-task-0.2.1.gem\n\n==Tests\nThe
|
418
|
+
test files live in the folder test and start with test_.\n\nThere is a rake file
|
419
|
+
available to run all tests\n\n $ rake test\n \nThe CLI is tested with Cucumber.
|
420
|
+
To run the Cucumber features in verbose mode\n\n $ cucumber\n\nor if you prefer
|
421
|
+
cleaner output run\n\n $ rake features\n\n==License\nsyc-task is released under
|
422
|
+
the {MIT License}[http://opensource.org/licenses/MIT]\n\n==Links\n* [http://www.github.com/sugaryourcoffee/syc-task]
|
423
|
+
- Source code on GitHub\n* [https://rubygems.org/gems/syc-task] - RubyGems\n"
|
394
424
|
email: pierre@sugaryourcoffee.de
|
395
425
|
executables:
|
396
426
|
- syctask
|
@@ -427,30 +457,29 @@ homepage: https://github.com/sugaryourcoffee/syc-task
|
|
427
457
|
licenses:
|
428
458
|
- MIT
|
429
459
|
metadata: {}
|
430
|
-
post_install_message:
|
460
|
+
post_install_message:
|
431
461
|
rdoc_options:
|
432
|
-
- --title
|
462
|
+
- "--title"
|
433
463
|
- syctask
|
434
|
-
- --main
|
464
|
+
- "--main"
|
435
465
|
- README.rdoc
|
436
|
-
- -ri
|
466
|
+
- "-ri"
|
437
467
|
require_paths:
|
438
468
|
- lib
|
439
469
|
- lib
|
440
470
|
required_ruby_version: !ruby/object:Gem::Requirement
|
441
471
|
requirements:
|
442
|
-
- -
|
472
|
+
- - ">="
|
443
473
|
- !ruby/object:Gem::Version
|
444
|
-
version: '
|
474
|
+
version: '3.2'
|
445
475
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
446
476
|
requirements:
|
447
|
-
- -
|
477
|
+
- - ">="
|
448
478
|
- !ruby/object:Gem::Version
|
449
479
|
version: '0'
|
450
480
|
requirements: []
|
451
|
-
|
452
|
-
|
453
|
-
signing_key:
|
481
|
+
rubygems_version: 3.5.23
|
482
|
+
signing_key:
|
454
483
|
specification_version: 4
|
455
484
|
summary: Simple task organizer
|
456
485
|
test_files: []
|