timr 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.ackrc +9 -0
  3. data/.editorconfig +1 -0
  4. data/.env.example +7 -0
  5. data/.github/CONTRIBUTING.md +32 -0
  6. data/.github/ISSUE_TEMPLATE.md +13 -0
  7. data/.gitignore +8 -2
  8. data/.rdoc_options +21 -0
  9. data/.travis.yml +10 -7
  10. data/Gemfile +8 -0
  11. data/README.md +216 -3
  12. data/bin/.gitignore +2 -0
  13. data/bin/README.md +17 -0
  14. data/bin/build.sh +14 -0
  15. data/bin/build_api.sh +14 -0
  16. data/bin/build_coverage.sh +23 -0
  17. data/bin/build_info.sh +27 -0
  18. data/bin/build_man.sh +41 -0
  19. data/bin/clean.sh +14 -0
  20. data/bin/dev_setup.sh +19 -0
  21. data/bin/install.sh +49 -0
  22. data/bin/publish +38 -0
  23. data/bin/release.sh +35 -0
  24. data/bin/test.sh +19 -0
  25. data/bin/timr +20 -40
  26. data/bin/timr_bash_completion.sh +337 -0
  27. data/bin/uninstall.sh +24 -0
  28. data/lib/timr.rb +36 -8
  29. data/lib/timr/command/basic_command.rb +170 -0
  30. data/lib/timr/command/continue_command.rb +86 -0
  31. data/lib/timr/command/help_command.rb +137 -0
  32. data/lib/timr/command/log_command.rb +297 -0
  33. data/lib/timr/command/pause_command.rb +89 -0
  34. data/lib/timr/command/pop_command.rb +176 -0
  35. data/lib/timr/command/push_command.rb +141 -0
  36. data/lib/timr/command/report_command.rb +689 -0
  37. data/lib/timr/command/start_command.rb +172 -0
  38. data/lib/timr/command/status_command.rb +198 -0
  39. data/lib/timr/command/stop_command.rb +127 -0
  40. data/lib/timr/command/task_command.rb +318 -0
  41. data/lib/timr/command/track_command.rb +381 -0
  42. data/lib/timr/command/version_command.rb +18 -0
  43. data/lib/timr/duration.rb +159 -0
  44. data/lib/timr/exception/timr_error.rb +113 -0
  45. data/lib/timr/ext/time.rb +12 -0
  46. data/lib/timr/helper/datetime_helper.rb +128 -0
  47. data/lib/timr/helper/terminal_helper.rb +58 -0
  48. data/lib/timr/helper/translation_helper.rb +45 -0
  49. data/lib/timr/model/basic_model.rb +287 -0
  50. data/lib/timr/model/config.rb +48 -0
  51. data/lib/timr/model/foreign_id_db.rb +84 -0
  52. data/lib/timr/model/stack.rb +161 -0
  53. data/lib/timr/model/task.rb +1039 -0
  54. data/lib/timr/model/track.rb +589 -0
  55. data/lib/timr/progressbar.rb +41 -0
  56. data/lib/timr/simple_opt_parser.rb +230 -0
  57. data/lib/timr/status.rb +70 -0
  58. data/lib/timr/table.rb +88 -0
  59. data/lib/timr/timr.rb +500 -558
  60. data/lib/timr/version.rb +4 -15
  61. data/man/.gitignore +2 -0
  62. data/man/_footer +3 -0
  63. data/man/timr-continue.1 +48 -0
  64. data/man/timr-continue.1.ronn +39 -0
  65. data/man/timr-ftime.7 +77 -0
  66. data/man/timr-ftime.7.ronn +57 -0
  67. data/man/timr-log.1 +109 -0
  68. data/man/timr-log.1.ronn +87 -0
  69. data/man/timr-pause.1 +56 -0
  70. data/man/timr-pause.1.ronn +45 -0
  71. data/man/timr-pop.1 +66 -0
  72. data/man/timr-pop.1.ronn +53 -0
  73. data/man/timr-push.1 +25 -0
  74. data/man/timr-push.1.ronn +20 -0
  75. data/man/timr-report.1 +228 -0
  76. data/man/timr-report.1.ronn +193 -0
  77. data/man/timr-start.1 +100 -0
  78. data/man/timr-start.1.ronn +82 -0
  79. data/man/timr-status.1 +53 -0
  80. data/man/timr-status.1.ronn +42 -0
  81. data/man/timr-stop.1 +75 -0
  82. data/man/timr-stop.1.ronn +60 -0
  83. data/man/timr-task.1 +147 -0
  84. data/man/timr-task.1.ronn +115 -0
  85. data/man/timr-track.1 +109 -0
  86. data/man/timr-track.1.ronn +89 -0
  87. data/man/timr.1 +119 -0
  88. data/man/timr.1.ronn +68 -0
  89. data/timr.gemspec +18 -3
  90. data/timr.sublime-project +20 -1
  91. metadata +142 -23
  92. data/Makefile +0 -12
  93. data/Makefile.common +0 -56
  94. data/lib/timr/stack.rb +0 -81
  95. data/lib/timr/task.rb +0 -258
  96. data/lib/timr/track.rb +0 -167
  97. data/lib/timr/window.rb +0 -259
  98. data/lib/timr/window_help.rb +0 -41
  99. data/lib/timr/window_tasks.rb +0 -30
  100. data/lib/timr/window_test.rb +0 -20
  101. data/lib/timr/window_timeline.rb +0 -33
  102. data/tests/tc_stack.rb +0 -121
  103. data/tests/tc_task.rb +0 -190
  104. data/tests/tc_track.rb +0 -144
  105. data/tests/tc_window.rb +0 -428
  106. data/tests/ts_all.rb +0 -6
data/lib/timr/version.rb CHANGED
@@ -2,22 +2,11 @@
2
2
  module TheFox
3
3
  module Timr
4
4
  NAME = 'Timr'
5
- VERSION = '0.3.0'
6
- DATE = '2016-06-01'
5
+ VERSION = '0.4.0'
6
+ DATE = '2017-04-13'
7
7
  HOMEPAGE = 'https://github.com/TheFox/timr'
8
8
 
9
- COL = 1
10
- MIN_COLS = 20
11
- TIMEOUT = 250
12
-
13
- # Reserved Lines
14
- # - Title
15
- # - Status Time Line
16
- # - Status Text Line
17
- RESERVED_LINES = 3
18
-
19
- TIME_FORMAT_FILE = '%FT%T%z'
20
-
21
- TASK_NO_TASK_LOADED_CHAR = ?-
9
+ MODEL_DATETIME_FORMAT = '%FT%T%z'
10
+ HUMAN_DATETIME_FOMRAT = '%F %T %z'
22
11
  end
23
12
  end
data/man/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ *.html
2
+ *.tmp
data/man/_footer ADDED
@@ -0,0 +1,3 @@
1
+ ## TIMR
2
+
3
+ This is part of timr(1).
@@ -0,0 +1,48 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "TIMR\-CONTINUE" "1" "April 2017" "FOX21.at" "Timr Manual"
5
+ .
6
+ .SH "NAME"
7
+ \fBtimr\-continue\fR \- Continue the previous paused Track\.
8
+ .
9
+ .SH "SYNOPSIS"
10
+ timr continue [\fIoptions\fR]
11
+ .
12
+ .SH "DESCRIPTION"
13
+ When a Track will be continued (or \fIrestarted\fR) it\'s actual a copy using the same message\.
14
+ .
15
+ .SH "TRACK OPTIONS"
16
+ .
17
+ .TP
18
+ \-d, \-\-date \fIdate\fR
19
+ Start Date for the new Track\. See timr\-ftime(7)\.
20
+ .
21
+ .TP
22
+ \-t, \-\-time \fItime\fR
23
+ Start Time for the new Track\. See timr\-ftime(7)\.
24
+ .
25
+ .SH "GENERAL OPTIONS"
26
+ .
27
+ .TP
28
+ \-h, \-\-help
29
+ Displays the help page\.
30
+ .
31
+ .SH "EXAMPLES"
32
+ .
33
+ .nf
34
+
35
+ timr continue
36
+ timr continue \-\-time 11:00
37
+ timr continue \-\-date 2017\-01\-02 \-\-time 11:00
38
+ .
39
+ .fi
40
+ .
41
+ .SH "API REFERENCE"
42
+ \fIhttps://timr\.fox21\.at/api/TheFox/Timr/Command/ContinueCommand\.html\fR
43
+ .
44
+ .SH "SEE ALSO"
45
+ timr\-pause(1), timr\-ftime(7)
46
+ .
47
+ .SH "TIMR"
48
+ This is part of timr(1)\.
@@ -0,0 +1,39 @@
1
+ timr-continue(1) -- Continue the previous paused Track.
2
+ ===
3
+
4
+ ## SYNOPSIS
5
+
6
+ timr continue [<options>]
7
+
8
+ ## DESCRIPTION
9
+
10
+ When a Track will be continued (or *restarted*) it's actual a copy using the same message.
11
+
12
+ ## TRACK OPTIONS
13
+
14
+ * -d, --date <date>:
15
+ Start Date for the new Track. See timr-ftime(7).
16
+
17
+ * -t, --time <time>:
18
+ Start Time for the new Track. See timr-ftime(7).
19
+
20
+ ## GENERAL OPTIONS
21
+
22
+ * -h, --help:
23
+ Displays the help page.
24
+
25
+ ## EXAMPLES
26
+
27
+ ```
28
+ timr continue
29
+ timr continue --time 11:00
30
+ timr continue --date 2017-01-02 --time 11:00
31
+ ```
32
+
33
+ ## API REFERENCE
34
+
35
+ <https://timr.fox21.at/api/TheFox/Timr/Command/ContinueCommand.html>
36
+
37
+ ## SEE ALSO
38
+
39
+ timr-pause(1), timr-ftime(7)
data/man/timr-ftime.7 ADDED
@@ -0,0 +1,77 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "TIMR\-FTIME" "7" "April 2017" "FOX21.at" "Timr Manual"
5
+ .
6
+ .SH "NAME"
7
+ \fBtimr\-ftime\fR \- Date/Time Format
8
+ .
9
+ .SH "SYNOPSIS"
10
+ timr *
11
+ .
12
+ .SH "DESCRIPTION"
13
+ This document is about date, time and estimation Strings\.
14
+ .
15
+ .SH "DATETIME FORMATS"
16
+ .
17
+ .TP
18
+ \fIdate_time\fR
19
+ A DateTime is one single string representing \fB\'<date> <time>\'\fR\. Must be in quotes\.
20
+ .
21
+ .TP
22
+ \fIdate\fR
23
+ Formats: \fBYYYYMMDD\fR, \fBYYYY\-MM\-DD\fR, \fBMM/DD/YYYY\fR, \fBDD\.MM\.YYYY\fR
24
+ .
25
+ .TP
26
+ \fItime\fR
27
+ Formats: \fBHH:MM\fR, \fBHH:MM:SS\fR
28
+ .
29
+ .P
30
+ All dates and times are handled by Ruby Time \fIhttps://ruby\-doc\.org/stdlib\-2\.4\.0/libdoc/time/rdoc/Time\.html\fR class\.
31
+ .
32
+ .SH "DURATION"
33
+ Most used by Estimation (command\-line option \fB\-e\fR)\.
34
+ .
35
+ .SS "Examples"
36
+ Sets Estimation to 2h 10m 5s:
37
+ .
38
+ .IP "\(bu" 4
39
+ \fB\-e 2:10:5\fR
40
+ .
41
+ .IP "\(bu" 4
42
+ \fB\-e \'2h 10m 5s\'\fR
43
+ .
44
+ .IP "" 0
45
+ .
46
+ .P
47
+ Use \'+\' or \'\-\' to calculate with Estimation times\.
48
+ .
49
+ .P
50
+ Subtracts 45 minutes from the original Estimation:
51
+ .
52
+ .P
53
+ \fB\-e \'\-45m\'\fR
54
+ .
55
+ .P
56
+ Adds 1 hour 30 minutes to the original Estimation:
57
+ .
58
+ .P
59
+ \fB\-e \'+1h 30m\'\fR
60
+ .
61
+ .P
62
+ This format is also called \fIHuman Format\fR\.
63
+ .
64
+ .SS "chronic_duration"
65
+ Duration is parsed by chronic_duration\.
66
+ .
67
+ .P
68
+ See chronic_duration for more examples:
69
+ .
70
+ .br
71
+ \fIhttps://github\.com/henrypoydar/chronic_duration\fR
72
+ .
73
+ .SH "SEE ALSO"
74
+ timr\-continue(1), timr\-log(1), timr\-pause(1), timr\-pop(1), timr\-report(1), timr\-start(1), timr\-stop(1), timr\-task(1), timr\-track(1)
75
+ .
76
+ .SH "TIMR"
77
+ This is part of timr(1)\.
@@ -0,0 +1,57 @@
1
+ timr-ftime(7) -- Date/Time Format
2
+ ===
3
+
4
+ ## SYNOPSIS
5
+
6
+ timr *
7
+
8
+ ## DESCRIPTION
9
+
10
+ This document is about date, time and estimation Strings.
11
+
12
+ ## DATETIME FORMATS
13
+
14
+ * <date_time>:
15
+ A DateTime is one single string representing `'<date> <time>'`. Must be in quotes.
16
+
17
+ * <date>:
18
+ Formats: `YYYYMMDD`, `YYYY-MM-DD`, `MM/DD/YYYY`, `DD.MM.YYYY`
19
+
20
+ * <time>:
21
+ Formats: `HH:MM`, `HH:MM:SS`
22
+
23
+ All dates and times are handled by [Ruby Time](https://ruby-doc.org/stdlib-2.4.0/libdoc/time/rdoc/Time.html) class.
24
+
25
+ ## DURATION
26
+
27
+ Most used by Estimation (command-line option `-e`).
28
+
29
+ ### Examples
30
+
31
+ Sets Estimation to 2h 10m 5s:
32
+
33
+ - `-e 2:10:5`
34
+ - `-e '2h 10m 5s'`
35
+
36
+ Use '+' or '-' to calculate with Estimation times.
37
+
38
+ Subtracts 45 minutes from the original Estimation:
39
+
40
+ `-e '-45m'`
41
+
42
+ Adds 1 hour 30 minutes to the original Estimation:
43
+
44
+ `-e '+1h 30m'`
45
+
46
+ This format is also called *Human Format*.
47
+
48
+ ### chronic_duration
49
+
50
+ Duration is parsed by chronic_duration.
51
+
52
+ See chronic_duration for more examples:
53
+ <https://github.com/henrypoydar/chronic_duration>
54
+
55
+ ## SEE ALSO
56
+
57
+ timr-continue(1), timr-log(1), timr-pause(1), timr-pop(1), timr-report(1), timr-start(1), timr-stop(1), timr-task(1), timr-track(1)
data/man/timr-log.1 ADDED
@@ -0,0 +1,109 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "TIMR\-LOG" "1" "April 2017" "FOX21.at" "Timr Manual"
5
+ .
6
+ .SH "NAME"
7
+ \fBtimr\-log\fR \- Show recent Tracks\.
8
+ .
9
+ .SH "SYNOPSIS"
10
+ timr log [\fIoptions\fR]
11
+ .
12
+ .SH "DESCRIPTION"
13
+ By default this command prints all todays Tracks\.
14
+ .
15
+ .SH "TOTAL FILTER OPTIONS"
16
+ .
17
+ .TP
18
+ \-s, \-\-from \'\fIdate_time\fR\'
19
+ From Date/Time\. Must be in quotes to be one single string\. Default: today 00:00:00\. See timr\-ftime(7)\.
20
+ .
21
+ .TP
22
+ \-e, \-\-to \'\fIdate_time\fR\'
23
+ To Date/Time\. Must be in quotes to be one single string\. Default: today 23:59:59\. See timr\-ftime(7)\.
24
+ .
25
+ .TP
26
+ \-d, \-\-day \fIdate\fR
27
+ A single day from 00:00 to 23:59\. See timr\-ftime(7)\.
28
+ .
29
+ .TP
30
+ \-m, \-\-month \fI[YYYY\-]MM\fR
31
+ A single month from 01 to 31\.
32
+ .
33
+ .TP
34
+ \-y, \-\-year [\fIYYYY\fR]
35
+ A single year from 01\-01 to 12\-31\.
36
+ .
37
+ .TP
38
+ \-a, \-\-all
39
+ Show all Tracks\.
40
+ .
41
+ .SH "DAY TIME FILTER OPTIONS"
42
+ .
43
+ .TP
44
+ \-\-sd, \-\-start\-date \fIdate\fR
45
+ Start Date\. See timr\-ftime(7)\.
46
+ .
47
+ .TP
48
+ \-\-ed, \-\-end\-date \fIdate\fR
49
+ End Date\. See timr\-ftime(7)\.
50
+ .
51
+ .TP
52
+ \-\-st, \-\-start\-time \fItime\fR
53
+ Start Time\. See timr\-ftime(7)\.
54
+ .
55
+ .TP
56
+ \-\-et, \-\-end\-time \fItime\fR
57
+ End Time\. See timr\-ftime(7)\.
58
+ .
59
+ .SH "GENERAL OPTIONS"
60
+ .
61
+ .TP
62
+ \-h, \-\-help
63
+ Displays the help page\.
64
+ .
65
+ .SH "EXAMPLES"
66
+ .
67
+ .nf
68
+
69
+ timr log
70
+ timr log \-\-from \'2017\-01\-02 10:00\' \-\-to \'2017\-01\-09 17:00\'
71
+ timr log \-\-day 2017\-01\-03
72
+ timr log \-\-month 2017\-01
73
+ timr log \-\-year 2017
74
+ timr log \-\-all
75
+ timr log \-\-start\-date 2017\-01\-01 \-\-end\-date 2017\-01\-05 \e
76
+ \-\-start\-time 08:00 \-\-end\-time 17:00
77
+ .
78
+ .fi
79
+ .
80
+ .SH "COLUMNS"
81
+ .
82
+ .TP
83
+ START
84
+ Track Start Date
85
+ .
86
+ .TP
87
+ END
88
+ Track End Date
89
+ .
90
+ .TP
91
+ DUR
92
+ Track Duration
93
+ .
94
+ .TP
95
+ TASK
96
+ Task ID
97
+ .
98
+ .TP
99
+ TRACK
100
+ Track ID and Title\.
101
+ .
102
+ .SH "API REFERENCE"
103
+ \fIhttps://timr\.fox21\.at/api/TheFox/Timr/Command/LogCommand\.html\fR
104
+ .
105
+ .SH "SEE ALSO"
106
+ timr\-report(1), timr\-ftime(7)
107
+ .
108
+ .SH "TIMR"
109
+ This is part of timr(1)\.
@@ -0,0 +1,87 @@
1
+ timr-log(1) -- Show recent Tracks.
2
+ ===
3
+
4
+ ## SYNOPSIS
5
+
6
+ timr log [<options>]
7
+
8
+ ## DESCRIPTION
9
+
10
+ By default this command prints all todays Tracks.
11
+
12
+ ## TOTAL FILTER OPTIONS
13
+
14
+ * -s, --from '<date_time>':
15
+ From Date/Time. Must be in quotes to be one single string. Default: today 00:00:00. See timr-ftime(7).
16
+
17
+ * -e, --to '<date_time>':
18
+ To Date/Time. Must be in quotes to be one single string. Default: today 23:59:59. See timr-ftime(7).
19
+
20
+ * -d, --day <date>:
21
+ A single day from 00:00 to 23:59. See timr-ftime(7).
22
+
23
+ * -m, --month <[YYYY-]MM>:
24
+ A single month from 01 to 31.
25
+
26
+ * -y, --year [<YYYY>]:
27
+ A single year from 01-01 to 12-31.
28
+
29
+ * -a, --all:
30
+ Show all Tracks.
31
+
32
+ ## DAY TIME FILTER OPTIONS
33
+
34
+ * --sd, --start-date <date>:
35
+ Start Date. See timr-ftime(7).
36
+
37
+ * --ed, --end-date <date>:
38
+ End Date. See timr-ftime(7).
39
+
40
+ * --st, --start-time <time>:
41
+ Start Time. See timr-ftime(7).
42
+
43
+ * --et, --end-time <time>:
44
+ End Time. See timr-ftime(7).
45
+
46
+ ## GENERAL OPTIONS
47
+
48
+ * -h, --help:
49
+ Displays the help page.
50
+
51
+ ## EXAMPLES
52
+
53
+ ```
54
+ timr log
55
+ timr log --from '2017-01-02 10:00' --to '2017-01-09 17:00'
56
+ timr log --day 2017-01-03
57
+ timr log --month 2017-01
58
+ timr log --year 2017
59
+ timr log --all
60
+ timr log --start-date 2017-01-01 --end-date 2017-01-05 \
61
+ --start-time 08:00 --end-time 17:00
62
+ ```
63
+
64
+ ## COLUMNS
65
+
66
+ * START:
67
+ Track Start Date
68
+
69
+ * END:
70
+ Track End Date
71
+
72
+ * DUR:
73
+ Track Duration
74
+
75
+ * TASK:
76
+ Task ID
77
+
78
+ * TRACK:
79
+ Track ID and Title.
80
+
81
+ ## API REFERENCE
82
+
83
+ <https://timr.fox21.at/api/TheFox/Timr/Command/LogCommand.html>
84
+
85
+ ## SEE ALSO
86
+
87
+ timr-report(1), timr-ftime(7)