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
@@ -0,0 +1,193 @@
1
+ timr-report(1) -- Export Tasks and Tracks.
2
+ ===
3
+
4
+ ## SYNOPSIS
5
+
6
+ timr report [<options>]
7
+
8
+ ## DESCRIPTION
9
+
10
+ This command is designed to print a list of Tasks or Tracks to STDOUT and to export Tasks and Tracks as CSV files. While this command is similar to timr-log(1), the main focus is exporting Tasks/Tracks as CSV file for further processing.
11
+
12
+ ## OPTIONS
13
+
14
+ * -d, --day <date>:
15
+ A single day from 00:00 to 23:59. See timr-ftime(7).
16
+
17
+ * -m, --month <[YYYY-]MM>:
18
+ A single month from 01 to 31.
19
+
20
+ * -y, --year [<YYYY>]:
21
+ A single year from 01-01 to 12-31.
22
+
23
+ * -a, --all:
24
+ Export all.
25
+
26
+ * --tasks :
27
+ Export Tasks (default)
28
+
29
+ * --tracks:
30
+ Export Tracks
31
+
32
+ * --csv <path>:
33
+ Export as CSV file. Use `--csv -` to use STDOUT.
34
+
35
+ * --force :
36
+ Force overwrite file.
37
+
38
+ * -h, --help:
39
+ Displays the help page.
40
+
41
+ ## EXAMPLES
42
+
43
+ ```
44
+ timr report
45
+ timr report --day 2017-01-02
46
+ timr report --day 2017-01-02 --csv timr_report_20170102.csv
47
+ timr report --day 2017-01-02 --csv timr_report_20170102.csv --tracks
48
+ timr report --month 2017-01 --csv timr_report_201701.csv
49
+ timr report --year 2017 --csv timr_report_2017.csv
50
+ timr report --all --csv timr_report_all.csv
51
+ ```
52
+
53
+ ## TASK TABLE COLUMNS
54
+
55
+ * START:
56
+ Task Start Date
57
+
58
+ * END:
59
+ Task End Date
60
+
61
+ * DUR:
62
+ Total Task Duration
63
+
64
+ * UNB:
65
+ Unbilled Task Duration
66
+
67
+ * TASK:
68
+ Task ID and Name.
69
+
70
+ ## TRACK TABLE COLUMNS
71
+
72
+ * START:
73
+ Task Start Date
74
+
75
+ * END:
76
+ Task End Date
77
+
78
+ * DUR:
79
+ Task Duration
80
+
81
+ * TASK:
82
+ Task ID
83
+
84
+ * TRACK:
85
+ Track ID and Name.
86
+
87
+ ## TASK CSV COLUMNS
88
+
89
+ * ROW_NO:
90
+ Sequential CSV file row number.
91
+
92
+ * TASK_ID:
93
+ Task ID
94
+
95
+ * TASK_FOREIGN_ID:
96
+ Foreign Task ID
97
+
98
+ * TASK_NAME:
99
+ Task Name
100
+
101
+ * TASK_BEGIN_DATETIME:
102
+ Begin DateTime of the first Track.
103
+
104
+ * TASK_END_DATETIME:
105
+ End DateTime of the last Track.
106
+
107
+ * TASK_DURATION_HUMAN:
108
+ Task Duration in human format. See timr-ftime(7).
109
+
110
+ * TASK_DURATION_SECONDS:
111
+ Task Duration in seconds.
112
+
113
+ * TASK_ESTIMATION_HUMAN
114
+
115
+ * TASK_ESTIMATION_SECONDS
116
+
117
+ * TASK_REMAINING_TIME_HUMAN
118
+
119
+ * TASK_REMAINING_TIME_SECONDS
120
+
121
+ * TASK_BILLED_DURATION_HUMAN:
122
+ Billed Task Duration in human format. See timr-ftime(7).
123
+
124
+ * TASK_BILLED_DURATION_SECONDS:
125
+ Billed Task Duration in seconds.
126
+
127
+ * TASK_UNBILLED_DURATION_HUMAN:
128
+ Unbilled Task Duration in human format. See timr-ftime(7).
129
+
130
+ * TASK_UNBILLED_DURATION_SECONDS:
131
+ Unbilled Task Duration in seconds.
132
+
133
+ * TASK_TRACK_COUNT:
134
+ Task Track count.
135
+
136
+ * TASK_BILLED_TRACK_COUNT:
137
+ Task Billed Track count.
138
+
139
+ * TASK_UNBILLED_TRACK_COUNT:
140
+ Task Unbilled Track count.
141
+
142
+ ## TRACK CSV COLUMNS
143
+
144
+ * ROW_NO:
145
+ Sequential CSV file row number.
146
+
147
+ * TASK_ID:
148
+ Task ID
149
+
150
+ * TASK_NAME:
151
+ Task Name
152
+
153
+ * TRACK_ID:
154
+ Track ID
155
+
156
+ * TRACK_TITLE:
157
+ Track Title
158
+
159
+ * TRACK_BEGIN_DATETIME:
160
+ Begin DateTime
161
+
162
+ * TRACK_END_DATETIME:
163
+ End DateTime
164
+
165
+ * TRACK_DURATION_HUMAN:
166
+ Track Duration in human format. See timr-ftime(7).
167
+
168
+ * TRACK_DURATION_SECONDS:
169
+ Track Duration in seconds.
170
+
171
+ * TRACK_BILLED_DURATION_HUMAN:
172
+ Billed Track Duration in human format. See timr-ftime(7).
173
+
174
+ * TRACK_BILLED_DURATION_SECONDS:
175
+ Billed Track Duration in seconds.
176
+
177
+ * TRACK_UNBILLED_DURATION_HUMAN:
178
+ Unbilled Track Duration in human format. See timr-ftime(7).
179
+
180
+ * TRACK_UNBILLED_DURATION_SECONDS:
181
+ Unbilled Track Duration in seconds.
182
+
183
+ * TRACK_IS_BILLED
184
+
185
+ The last row in CSV files is always the total sum.
186
+
187
+ ## API REFERENCE
188
+
189
+ <https://timr.fox21.at/api/TheFox/Timr/Command/ReportCommand.html>
190
+
191
+ ## SEE ALSO
192
+
193
+ timr-log(1), timr-ftime(7)
data/man/timr-start.1 ADDED
@@ -0,0 +1,100 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "TIMR\-START" "1" "April 2017" "FOX21.at" "Timr Manual"
5
+ .
6
+ .SH "NAME"
7
+ \fBtimr\-start\fR \- Start a new Task/Track\.
8
+ .
9
+ .SH "SYNOPSIS"
10
+ timr start [\fIoptions\fR] [\fIid\fR|\fItask_id\fR [\fItrack_id\fR]]
11
+ .
12
+ .SH "DESCRIPTION"
13
+ Always removes all Tracks from the Stack and creates a new Track\. If there is another current running Task this Task will be stopped and removed from the Stack\.
14
+ .
15
+ .P
16
+ Without any options this command always creates a new Task and starts a new Track for this Task\. When providing a Task ID (SHA1 hex) of an existing Task, this Task will be continued\. When also providing a Track ID (SHA1 hex) the same Track message will be taken to create a new Track for the Task\.
17
+ .
18
+ .SH "TASK OPTIONS"
19
+ .
20
+ .TP
21
+ \-\-id \fIstr\fR
22
+ Your ID to identify the Task\. Not just to use the internal Task ID as \fItask_id\fR but also if you like to use your own ID\. For example, when you want to sync Timr with JIRA and use the JIRA IDs to identify Timr Tasks instead of the Timr internal IDs\. This can be any string, but MUST NOT include spaces\. Use this String for \fItask_id\fR\. This ID is also called \'Foreign ID\' by Timr (internal)\.
23
+ .
24
+ .TP
25
+ \-n, \-\-name \fIstr\fR
26
+ The name of the new Task\. When providing a \fItask_id\fR this option will be ignored\.
27
+ .
28
+ .TP
29
+ \-\-description \fIstr\fR
30
+ Longer description of the new Task\. This should descibe the Task in general\. Provide details by using \fB\-\-message\fR option\. When providing a \fItask_id\fR this option will be ignored\.
31
+ .
32
+ .TP
33
+ \-e, \-\-est, \-\-estimation \fItime\fR
34
+ Task Estimation\. See timr\-ftime(7)\.
35
+ .
36
+ .TP
37
+ \-r, \-\-hourly\-rate \fIfloat\fR
38
+ Set the Hourly Rate\.
39
+ .
40
+ .TP
41
+ \-\-fr, \-\-flat\-rate, \-\-flat
42
+ Has Task a Flat Rate?
43
+ .
44
+ .SH "TRACK OPTIONS"
45
+ .
46
+ .TP
47
+ \-m, \-\-message \fImessage\fR
48
+ Details about what you have done\. This overwrites the \fItrack_id\fR argument\.
49
+ .
50
+ .TP
51
+ \-\-edit
52
+ Edit Track Message when providing a \fItrack_id\fR\. The EDITOR environment variable must be set\.
53
+ .
54
+ .TP
55
+ \-d, \-\-date \fIdate\fR
56
+ Track Start Date\. Default: today\. See timr\-ftime(7)\.
57
+ .
58
+ .TP
59
+ \-t, \-\-time \fItime\fR
60
+ Track Start Time\. This is useful when you forgot to run the Start command\. Default: now\. See timr\-ftime(7)\.
61
+ .
62
+ .SH "GENERAL OPTIONS"
63
+ .
64
+ .TP
65
+ \-h, \-\-help
66
+ Displays the help page\.
67
+ .
68
+ .SH "ARGUMENTS"
69
+ \fItask_id\fR \- Task ID as SHA1 hex string\. It can be the full 40 characters or only the first 6\. If not specified a new Task will be created\.
70
+ .
71
+ .P
72
+ \fItrack_id\fR \- Track ID as SHA1 hex string\. It can be the full 40 characters or only the first 6\. If specified a new Track with the same message will be created\.
73
+ .
74
+ .SH "EXAMPLES"
75
+ .
76
+ .nf
77
+
78
+ timr start
79
+ timr start \-\-name my_task1
80
+ timr start \-\-name \'Model 101\' \e
81
+ \-\-description \'Construct series 101\.\'
82
+ timr start \-\-name my_task3 \e
83
+ \-\-date 2017\-01\-02 \-\-time 15:30 \e
84
+ \-\-message \'Hello World\'
85
+ timr start \-\-name my_task4 \-\-message \'Hello World\'
86
+ timr start \-\-name my_task5 \-\-estimation 2h
87
+ timr start \-\-message \'Hello World\' abcd12
88
+ timr start \-\-time 10:30 \-\-message \'Hello World\' abcd12
89
+ timr start \-\-id T800
90
+ .
91
+ .fi
92
+ .
93
+ .SH "API REFERENCE"
94
+ \fIhttps://timr\.fox21\.at/api/TheFox/Timr/Command/StartCommand\.html\fR
95
+ .
96
+ .SH "SEE ALSO"
97
+ timr\-stop(1), timr\-push(1), timr\-ftime(7)
98
+ .
99
+ .SH "TIMR"
100
+ This is part of timr(1)\.
@@ -0,0 +1,82 @@
1
+ timr-start(1) -- Start a new Task/Track.
2
+ ===
3
+
4
+ ## SYNOPSIS
5
+
6
+ timr start [<options>] [<id>|<task_id> [<track_id>]]
7
+
8
+ ## DESCRIPTION
9
+
10
+ Always removes all Tracks from the Stack and creates a new Track. If there is another current running Task this Task will be stopped and removed from the Stack.
11
+
12
+ Without any options this command always creates a new Task and starts a new Track for this Task. When providing a Task ID (SHA1 hex) of an existing Task, this Task will be continued. When also providing a Track ID (SHA1 hex) the same Track message will be taken to create a new Track for the Task.
13
+
14
+ ## TASK OPTIONS
15
+
16
+ * --id <str>:
17
+ Your ID to identify the Task. Not just to use the internal Task ID as <task_id> but also if you like to use your own ID. For example, when you want to sync Timr with JIRA and use the JIRA IDs to identify Timr Tasks instead of the Timr internal IDs. This can be any string, but MUST NOT include spaces. Use this String for <task_id>. This ID is also called 'Foreign ID' by Timr (internal).
18
+
19
+ * -n, --name <str>:
20
+ The name of the new Task. When providing a <task_id> this option will be ignored.
21
+
22
+ * --description <str>:
23
+ Longer description of the new Task. This should descibe the Task in general. Provide details by using `--message` option. When providing a <task_id> this option will be ignored.
24
+
25
+ * -e, --est, --estimation <time>:
26
+ Task Estimation. See timr-ftime(7).
27
+
28
+ * -r, --hourly-rate <float>:
29
+ Set the Hourly Rate.
30
+
31
+ * --fr, --flat-rate, --flat:
32
+ Has Task a Flat Rate?
33
+
34
+ ## TRACK OPTIONS
35
+
36
+ * -m, --message <message>:
37
+ Details about what you have done. This overwrites the <track_id> argument.
38
+
39
+ * --edit:
40
+ Edit Track Message when providing a <track_id>. The EDITOR environment variable must be set.
41
+
42
+ * -d, --date <date>:
43
+ Track Start Date. Default: today. See timr-ftime(7).
44
+
45
+ * -t, --time <time>:
46
+ Track Start Time. This is useful when you forgot to run the Start command. Default: now. See timr-ftime(7).
47
+
48
+ ## GENERAL OPTIONS
49
+
50
+ * -h, --help:
51
+ Displays the help page.
52
+
53
+ ## ARGUMENTS
54
+
55
+ <task_id> - Task ID as SHA1 hex string. It can be the full 40 characters or only the first 6. If not specified a new Task will be created.
56
+
57
+ <track_id> - Track ID as SHA1 hex string. It can be the full 40 characters or only the first 6. If specified a new Track with the same message will be created.
58
+
59
+ ## EXAMPLES
60
+
61
+ ```
62
+ timr start
63
+ timr start --name my_task1
64
+ timr start --name 'Model 101' \
65
+ --description 'Construct series 101.'
66
+ timr start --name my_task3 \
67
+ --date 2017-01-02 --time 15:30 \
68
+ --message 'Hello World'
69
+ timr start --name my_task4 --message 'Hello World'
70
+ timr start --name my_task5 --estimation 2h
71
+ timr start --message 'Hello World' abcd12
72
+ timr start --time 10:30 --message 'Hello World' abcd12
73
+ timr start --id T800
74
+ ```
75
+
76
+ ## API REFERENCE
77
+
78
+ <https://timr.fox21.at/api/TheFox/Timr/Command/StartCommand.html>
79
+
80
+ ## SEE ALSO
81
+
82
+ timr-stop(1), timr-push(1), timr-ftime(7)
data/man/timr-status.1 ADDED
@@ -0,0 +1,53 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "TIMR\-STATUS" "1" "April 2017" "FOX21.at" "Timr Manual"
5
+ .
6
+ .SH "NAME"
7
+ \fBtimr\-status\fR \- Show the current Stack\.
8
+ .
9
+ .SH "SYNOPSIS"
10
+ timr status [\fIoptions\fR]
11
+ .
12
+ .SH "DESCRIPTION"
13
+ Displays the Stack as a list and the status of each Track\.
14
+ .
15
+ .P
16
+ To see more details about a specific Task see timr\-task(1), or a specific Track timr\-track(1)\.
17
+ .
18
+ .SH "OPTIONS"
19
+ .
20
+ .TP
21
+ \-v, \-\-verbose
22
+ Show more columns in table view\.
23
+ .
24
+ .TP
25
+ \-f, \-\-full
26
+ Show full status\.
27
+ .
28
+ .TP
29
+ \-r, \-\-reverse
30
+ Reverse the list\.
31
+ .
32
+ .TP
33
+ \-h, \-\-help
34
+ Displays the help page\.
35
+ .
36
+ .SH "EXAMPLES"
37
+ .
38
+ .nf
39
+
40
+ timr status
41
+ timr status \-\-full
42
+ timr status \-\-full \-\-reverse
43
+ .
44
+ .fi
45
+ .
46
+ .SH "API REFERENCE"
47
+ \fIhttps://timr\.fox21\.at/api/TheFox/Timr/Command/StatusCommand\.html\fR
48
+ .
49
+ .SH "SEE ALSO"
50
+ timr\-task(1), timr\-track(1)
51
+ .
52
+ .SH "TIMR"
53
+ This is part of timr(1)\.
@@ -0,0 +1,42 @@
1
+ timr-status(1) -- Show the current Stack.
2
+ ===
3
+
4
+ ## SYNOPSIS
5
+
6
+ timr status [<options>]
7
+
8
+ ## DESCRIPTION
9
+
10
+ Displays the Stack as a list and the status of each Track.
11
+
12
+ To see more details about a specific Task see timr-task(1), or a specific Track timr-track(1).
13
+
14
+ ## OPTIONS
15
+
16
+ * -v, --verbose:
17
+ Show more columns in table view.
18
+
19
+ * -f, --full:
20
+ Show full status.
21
+
22
+ * -r, --reverse:
23
+ Reverse the list.
24
+
25
+ * -h, --help:
26
+ Displays the help page.
27
+
28
+ ## EXAMPLES
29
+
30
+ ```
31
+ timr status
32
+ timr status --full
33
+ timr status --full --reverse
34
+ ```
35
+
36
+ ## API REFERENCE
37
+
38
+ <https://timr.fox21.at/api/TheFox/Timr/Command/StatusCommand.html>
39
+
40
+ ## SEE ALSO
41
+
42
+ timr-task(1), timr-track(1)