standup_md 0.2.0 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +7 -1
- data/README.md +149 -119
- data/bin/standup +1 -1
- data/doc/README_md.html +158 -101
- data/doc/StandupMD.html +96 -1326
- data/doc/StandupMD/Cli.html +124 -479
- data/doc/StandupMD/Cli/Helpers.html +167 -0
- data/doc/StandupMD/Config.html +230 -0
- data/doc/StandupMD/Config/Cli.html +364 -0
- data/doc/StandupMD/Config/Entry.html +296 -0
- data/doc/StandupMD/Config/EntryList.html +212 -0
- data/doc/StandupMD/Config/File.html +613 -0
- data/doc/StandupMD/Entry.html +478 -0
- data/doc/StandupMD/EntryList.html +759 -0
- data/doc/StandupMD/File.html +614 -0
- data/doc/created.rid +15 -5
- data/doc/index.html +168 -99
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/table_of_contents.html +226 -72
- data/lib/standup_md.rb +28 -546
- data/lib/standup_md/cli.rb +63 -246
- data/lib/standup_md/cli/helpers.rb +165 -0
- data/lib/standup_md/config.rb +47 -0
- data/lib/standup_md/config/cli.rb +109 -0
- data/lib/standup_md/config/entry.rb +68 -0
- data/lib/standup_md/config/entry_list.rb +31 -0
- data/lib/standup_md/config/file.rb +209 -0
- data/lib/standup_md/entry.rb +122 -0
- data/lib/standup_md/entry_list.rb +166 -0
- data/lib/standup_md/file.rb +183 -0
- data/lib/standup_md/file/helpers.rb +62 -0
- data/lib/standup_md/version.rb +5 -5
- data/standup_md.gemspec +1 -0
- metadata +35 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49f9ad4ada41c9372b1d3ffebb4f44fff6cb96249224c9b62c5063e1836a4c8f
|
4
|
+
data.tar.gz: da5aa3a5e2cfc882372ef5899694941d32702049323d615acc36644733dabe12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35587b73b6ec5d9d2388ce4d4b95185b982486414f3c5a5874fd7c73ee84dfcab6ba4b0109fcac33bf89576517a48f3a9730e85238ee53557f3b0047e6548c19
|
7
|
+
data.tar.gz: d772849128665813f3326fa41a684607e1231cd7065828f933dc5b50e51b0f909ef24862020d08af39f2bb2cd07e749c02c0347c00d923fb9ee38f14c69808c3
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
standup_md (0.
|
4
|
+
standup_md (0.3.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
docile (1.3.2)
|
9
10
|
power_assert (1.2.0)
|
10
11
|
rake (13.0.1)
|
12
|
+
simplecov (0.18.5)
|
13
|
+
docile (~> 1.1)
|
14
|
+
simplecov-html (~> 0.11)
|
15
|
+
simplecov-html (0.12.2)
|
11
16
|
test-unit (3.3.5)
|
12
17
|
power_assert
|
13
18
|
|
@@ -16,6 +21,7 @@ PLATFORMS
|
|
16
21
|
|
17
22
|
DEPENDENCIES
|
18
23
|
rake (~> 13.0, >= 13.0.1)
|
24
|
+
simplecov
|
19
25
|
standup_md!
|
20
26
|
test-unit (~> 3.3, >= 3.3.5)
|
21
27
|
|
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
# The Standup Doctor
|
2
|
+
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fevanthegrayt%2Fstandup_md%2Fbadge%3Fref%3Dmaster&style=flat)](https://actions-badge.atrox.dev/evanthegrayt/standup_md/goto?ref=master)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/standup_md.svg)](https://badge.fury.io/rb/standup_md)
|
4
|
+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
5
|
+
|
2
6
|
> The cure for all your standup woes.
|
3
7
|
|
4
8
|
A highly customizable and automated way to keep track of daily standups in
|
@@ -14,11 +18,17 @@ View on: [Github](https://github.com/evanthegrayt/standup_md) |
|
|
14
18
|
- [Via RubyGems](#via-rubygems)
|
15
19
|
- [Manual Installation](#manual-installation)
|
16
20
|
- [Usage](#usage)
|
17
|
-
- [
|
18
|
-
|
19
|
-
|
20
|
-
- [
|
21
|
-
|
21
|
+
- [Command Line](#command-line)
|
22
|
+
- [CLI Examples](#cli-examples)
|
23
|
+
- [Adding an entry for today via editor](#adding-an-entry-for-today-via-editor)
|
24
|
+
- [Copy the entry for today to clipboard](#copy-the-entry-for-today-to-clipboard)
|
25
|
+
- [Add entry to file without opening it](#add-entry-to-file-without-opening-it)
|
26
|
+
- [Find an entry by date and print it](#find-an-entry-by-date-and-print-it)
|
27
|
+
- [Customization and Runtime Options](#customization-and-runtime-options)
|
28
|
+
- [Using existing standup files](#using-existing-standup-files)
|
29
|
+
- [API](#api)
|
30
|
+
- [API Examples](#api-examples)
|
31
|
+
- [Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html)
|
22
32
|
- [Reporting Bugs and Requesting Features](#reporting-bugs-and-requesting-features)
|
23
33
|
- [Self-Promotion](#self-promotion)
|
24
34
|
|
@@ -28,17 +38,15 @@ chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day
|
|
28
38
|
became tedious, as I'd have to look up what I did the day before, copy and paste
|
29
39
|
yesterday's work into a new entry, and add today's tasks. This gem automates
|
30
40
|
most of this process, along with providing means of opening the file in your
|
31
|
-
editor, and displaying entries from the command line.
|
32
|
-
|
33
|
-
I wasn't sure that others would find this useful, but then the pandemic
|
34
|
-
happened, which I assume made doing standups via chat much more common.
|
41
|
+
editor, and finding and displaying entries from the command line.
|
35
42
|
|
36
43
|
In a nutshell, calling `standup` from the command line will open a standup file
|
37
44
|
for the current month in your preferred editor. If an entry for today is already
|
38
45
|
present, no text will be generated. If an entry for today doesn't exist, one
|
39
|
-
will be generated
|
40
|
-
entry as your previous day's work. See
|
41
|
-
if you'd like to use this
|
46
|
+
will be generated with your preferred values. When generating, if a previous
|
47
|
+
entry exists, it will be added to today's entry as your previous day's work. See
|
48
|
+
[example](#example). There's also a very robust API if you'd like to use this
|
49
|
+
in your own code somehow.
|
42
50
|
|
43
51
|
## Installation
|
44
52
|
### Via RubyGems
|
@@ -48,15 +56,15 @@ Just install the gem!
|
|
48
56
|
gem install standup_md
|
49
57
|
```
|
50
58
|
|
51
|
-
|
52
|
-
using
|
53
|
-
[rbenv](http://www.rubyinside.com/rbenv-a-simple-new-ruby-version-management-tool-5302.html),
|
54
|
-
or you can try the manual methods below.
|
59
|
+
To include in your project, add the following to your `Gemfile`.
|
55
60
|
|
61
|
+
```ruby
|
62
|
+
gem 'standup_md'
|
63
|
+
```
|
56
64
|
|
57
65
|
### Manual Installation
|
58
|
-
From your terminal, clone the repository where you want it
|
59
|
-
|
66
|
+
From your terminal, clone the repository where you want it, and use `rake` to
|
67
|
+
install the gem.
|
60
68
|
|
61
69
|
```sh
|
62
70
|
git clone https://github.com/evanthegrayt/standup_md.git
|
@@ -64,14 +72,11 @@ cd standup_md
|
|
64
72
|
|
65
73
|
# Use rake to build and install the gem.
|
66
74
|
rake install
|
67
|
-
|
68
|
-
# OR manually link the executable somewhere. If you use this method, you cannot
|
69
|
-
# move the repository after you link it!
|
70
|
-
ln -s $PWD/bin/standup /usr/local/bin/standup
|
71
75
|
```
|
72
76
|
|
73
77
|
## Usage
|
74
|
-
|
78
|
+
### Command Line
|
79
|
+
For the most basic usage, simply call the executable.
|
75
80
|
|
76
81
|
```sh
|
77
82
|
standup
|
@@ -79,10 +84,13 @@ standup
|
|
79
84
|
|
80
85
|
This opens the current month's standup file. If an entry already exists for
|
81
86
|
today, nothing is added. If no entry exists for today, the previous "Current" is
|
82
|
-
placed in the "Previous" section of a new entry.
|
83
|
-
|
87
|
+
placed in the "Previous" section of a new entry. The format of this file is very
|
88
|
+
important; you may add new entries, but don't change any of the headers. Doing
|
89
|
+
so will cause the parser to break. If you want to customize the headers, you can
|
90
|
+
do so in the [configuration file](#available-config-file-options-and-defaults).
|
84
91
|
|
85
|
-
###
|
92
|
+
### CLI Examples
|
93
|
+
#### Adding an entry for today via editor
|
86
94
|
For example, if the standup entry from yesterday reads as follows:
|
87
95
|
|
88
96
|
```markdown
|
@@ -98,6 +106,7 @@ For example, if the standup entry from yesterday reads as follows:
|
|
98
106
|
|
99
107
|
The following scaffolding will be added for current entry at the top of the
|
100
108
|
file:
|
109
|
+
|
101
110
|
```markdown
|
102
111
|
# 2020-04-14
|
103
112
|
## Previous
|
@@ -109,19 +118,36 @@ file:
|
|
109
118
|
- None
|
110
119
|
```
|
111
120
|
|
121
|
+
#### Copy the entry for today to clipboard
|
112
122
|
There are also flags that will print entries to the command line. There's a full
|
113
123
|
list of features below, but as a quick example, you can copy today's entry to
|
114
124
|
your clipboard without even opening your editor.
|
115
125
|
|
116
126
|
```sh
|
117
|
-
standup -
|
127
|
+
standup -p | pbcopy
|
128
|
+
```
|
129
|
+
|
130
|
+
If you wanted to add today's entry without opening your editor, and print the
|
131
|
+
result to the command line, you could use the following.
|
132
|
+
|
133
|
+
#### Add entry to file without opening it
|
134
|
+
```sh
|
135
|
+
standup --no-edit --current "Work on this thing","And another thing"
|
136
|
+
```
|
137
|
+
|
138
|
+
#### Find an entry by date and print it.
|
139
|
+
If you wanted to find and print the entry for March 2nd, 2020, you could use the
|
140
|
+
following.
|
141
|
+
|
142
|
+
```sh
|
143
|
+
standup -p 2020-03-02
|
118
144
|
```
|
119
145
|
|
120
|
-
|
121
|
-
You can create a file in your home directory called `~/.
|
122
|
-
|
123
|
-
|
124
|
-
file](https://github.com/evanthegrayt/dotfiles/blob/master/dotfiles/
|
146
|
+
### Customization and Runtime Options
|
147
|
+
You can create a file in your home directory called `~/.standuprc`. Settings
|
148
|
+
located in this file will override default behavior. This file can also have
|
149
|
+
settings overwritten at runtime by the use of options. You can view [my config
|
150
|
+
file](https://github.com/evanthegrayt/dotfiles/blob/master/dotfiles/standuprc)
|
125
151
|
as an example. Any setting in this file can still be overridden at runtime by
|
126
152
|
passing flags to the executable.
|
127
153
|
|
@@ -140,51 +166,62 @@ them in your configuration file after installation, and then try to not change
|
|
140
166
|
them again.
|
141
167
|
|
142
168
|
|
143
|
-
|
144
|
-
|
145
|
-
```
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
169
|
+
#### Available Config File Options and Defaults
|
170
|
+
|
171
|
+
```ruby
|
172
|
+
StandupMD.configure do |c|
|
173
|
+
# Defaults for how the file is formatted.
|
174
|
+
# See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html
|
175
|
+
c.file.header_date_format = '%Y-%m-%d'
|
176
|
+
c.file.header_depth = 1
|
177
|
+
c.file.sub_header_depth = 2
|
178
|
+
c.file.current_header = 'Current'
|
179
|
+
c.file.previous_header = 'Previous'
|
180
|
+
c.file.impediments_header = 'Impediments'
|
181
|
+
c.file.notes_header = 'Notes'
|
182
|
+
c.file.sub_header_order = %w[previous current impediments notes]
|
183
|
+
c.file.directory = ::File.join(ENV['HOME'], '.cache', 'standup_md')
|
184
|
+
c.file.bullet_character = '-'
|
185
|
+
c.file.name_format = '%Y_%m.md'
|
186
|
+
c.file.create = true
|
187
|
+
|
188
|
+
# Defaults for entries
|
189
|
+
# See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Entry.html
|
190
|
+
c.entry.current = ["<!-- ADD TODAY'S WORK HERE -->"]
|
191
|
+
c.entry.previous = []
|
192
|
+
c.entry.impediments = ['None']
|
193
|
+
c.entry.notes = []
|
194
|
+
|
195
|
+
# Defaults for executable runtime behavior.
|
196
|
+
# See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html
|
197
|
+
c.cli.date = Date.today
|
198
|
+
c.cli.editor = 'vim' # Checks $VISUAL and $EDITOR first, in that order
|
199
|
+
c.cli.verbose = false
|
200
|
+
c.cli.edit = true
|
201
|
+
c.cli.write = true
|
202
|
+
c.cli.print = false
|
203
|
+
c.cli.auto_fill_previous = true
|
204
|
+
c.cli.preference_file = ::File.expand_path(::File.join(ENV['HOME'], '.standuprc'))
|
205
|
+
end
|
168
206
|
```
|
169
207
|
|
170
|
-
|
208
|
+
#### Executable Flags
|
171
209
|
```
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
-a, --all Print all previous entries. Disables editing
|
210
|
+
--current ARRAY List of current entry's tasks
|
211
|
+
--previous ARRAY List of precious entry's tasks
|
212
|
+
--impediments ARRAY List of impediments for current entry
|
213
|
+
--notes ARRAY List of notes for current entry
|
214
|
+
--sub-header-order ARRAY The order of the sub-headers when writing the file
|
215
|
+
-f, --file-name-format STRING Date-formattable string to use for standup file name
|
216
|
+
-E, --editor EDITOR Editor to use for opening standup files
|
217
|
+
-d, --directory DIRECTORY The directories where standup files are located
|
218
|
+
-w --[no-]write Write current entry if it doesn't exist. Default is true
|
219
|
+
-a --[no-]auto-fill-previous Auto-generate 'previous' tasks for new entries
|
220
|
+
-e --[no-]edit Open the file in the editor. Default is true
|
221
|
+
-v, --[no-]verbose Verbose output. Default is false.
|
222
|
+
-p, --print [DATE] Print current entry.
|
223
|
+
If DATE is passed, will print entry for DATE, if it exists.
|
224
|
+
DATE must be in the same format as file-name-format
|
188
225
|
```
|
189
226
|
|
190
227
|
Any options not set in this file will retain their default values. Note that if
|
@@ -192,14 +229,7 @@ you change `file_name_format`, and don't use a month or year, there will only
|
|
192
229
|
ever be one standup file. This could cause issues long-term, as the files will
|
193
230
|
get large over time and possibly cause performance issues.
|
194
231
|
|
195
|
-
|
196
|
-
editor, you could use the following:
|
197
|
-
|
198
|
-
```bash
|
199
|
-
standup --no-edit --current-entry-tasks="Work on this thing","And another thing!"
|
200
|
-
```
|
201
|
-
|
202
|
-
### Using Existing Standup Files
|
232
|
+
#### Using Existing Standup Files
|
203
233
|
If you already have a directory of existing standup files, you can use them, but
|
204
234
|
they must be in a format that the parser can understand. The default is:
|
205
235
|
|
@@ -217,72 +247,72 @@ they must be in a format that the parser can understand. The default is:
|
|
217
247
|
|
218
248
|
The order, words, date format, and header level are all customizable, but the
|
219
249
|
overall format must be the same. If customization is necessary, this must be
|
220
|
-
done in `~/.
|
250
|
+
done in `~/.standuprc` before execution, or else the parser will error.
|
221
251
|
|
222
252
|
For example, if you wanted the format to be as follows:
|
223
253
|
|
224
254
|
```markdown
|
225
255
|
## 05/01/2020
|
226
256
|
### Today
|
227
|
-
|
257
|
+
* task
|
228
258
|
### Yesterday
|
229
|
-
|
259
|
+
* task
|
230
260
|
### Hold-ups
|
231
|
-
|
261
|
+
* impediment
|
232
262
|
### Notes
|
233
|
-
|
263
|
+
* notes, if any are present
|
234
264
|
```
|
235
265
|
|
236
|
-
Your `~/.
|
237
|
-
|
238
|
-
```yaml
|
239
|
-
sub_header_depth: 3
|
240
|
-
header_depth: 2
|
241
|
-
current_header: Today
|
242
|
-
previous_header: Yesterday
|
243
|
-
impediments_header: Hold-ups
|
244
|
-
header_date_format: '%m/%d/%Y'
|
245
|
-
sub_header_order:
|
246
|
-
- current
|
247
|
-
- previous
|
248
|
-
- impediments
|
249
|
-
- notes
|
266
|
+
Your `~/.standuprc` should contain:
|
250
267
|
|
268
|
+
```ruby
|
269
|
+
StandupMD.configure do |c|
|
270
|
+
c.file.header_depth = 2
|
271
|
+
c.file.sub_header_depth = 3
|
272
|
+
c.file.current_header = 'Today'
|
273
|
+
c.file.previous_header = 'Yesterday'
|
274
|
+
c.file.impediments_header = 'Hold-ups'
|
275
|
+
c.file.bullet_character = '*'
|
276
|
+
c.file.header_date_format = '%m/%d/%Y'
|
277
|
+
c.file.sub_header_order = %w[current previous impediments notes]
|
278
|
+
end
|
251
279
|
```
|
252
280
|
|
253
281
|
## API
|
254
|
-
|
255
|
-
[
|
282
|
+
The API is fully documented in the
|
283
|
+
[RDoc Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html).
|
284
|
+
|
285
|
+
This was mainly written as a command line utility, but the API is ridiculously
|
286
|
+
robust, and is available for use in your own projects. A quick example of how
|
287
|
+
to write a new entry via code could look like the following:
|
256
288
|
|
257
|
-
|
258
|
-
for scripting. There are attribute accessors for most of the settings in the
|
259
|
-
[customization table](#customization-and-runtime-options) above. A
|
260
|
-
quick example of how to write a new entry via code could look like the
|
261
|
-
following:
|
289
|
+
### API Examples
|
262
290
|
|
263
291
|
```ruby
|
264
292
|
require 'standup_md'
|
265
293
|
|
266
|
-
|
267
|
-
|
268
|
-
s.current_entry_tasks = ['Thing to do today', 'Another thing to do today'],
|
269
|
-
s.impediments = ['Not enough time in the day']
|
294
|
+
StandupMD.configure do |c|
|
295
|
+
c.file.current_header = 'Today',
|
270
296
|
end
|
271
297
|
|
272
|
-
|
298
|
+
file = StandupMD::File.find_by_date(Date.today)
|
299
|
+
entry = StandupMD::Entry.create { |e| e.current = ['Stuff I will do today'] }
|
300
|
+
file.entries << entry
|
301
|
+
file.write
|
273
302
|
```
|
274
|
-
Note: `StandupMD::load() { ... }` just is a quick way to call `StandupMD::new
|
275
|
-
{ ... }.load`.
|
276
303
|
|
277
|
-
|
304
|
+
The above example was written as such to show how the different pieces of the
|
305
|
+
API fit together. The code can actually be simplified to the following.
|
278
306
|
|
279
307
|
```ruby
|
280
308
|
require 'standup_md'
|
281
|
-
require 'json'
|
282
309
|
|
283
|
-
|
310
|
+
StandupMD.configure do |c|
|
311
|
+
c.file.current_header = 'Today',
|
312
|
+
c.entry.current = ['Stuff I will do today']
|
313
|
+
end
|
284
314
|
|
285
|
-
|
315
|
+
StandupMD::File.find_by_date(Date.today).load.write
|
286
316
|
```
|
287
317
|
|
288
318
|
## Reporting Bugs and Requesting Features
|
data/bin/standup
CHANGED
data/doc/README_md.html
CHANGED
@@ -67,12 +67,18 @@
|
|
67
67
|
<li><a href="#label-Via+RubyGems">Via RubyGems</a>
|
68
68
|
<li><a href="#label-Manual+Installation">Manual Installation</a>
|
69
69
|
<li><a href="#label-Usage">Usage</a>
|
70
|
-
<li><a href="#label-
|
70
|
+
<li><a href="#label-Command+Line">Command Line</a>
|
71
|
+
<li><a href="#label-CLI+Examples">CLI Examples</a>
|
72
|
+
<li><a href="#label-Adding+an+entry+for+today+via+editor">Adding an entry for today via editor</a>
|
73
|
+
<li><a href="#label-Copy+the+entry+for+today+to+clipboard">Copy the entry for today to clipboard</a>
|
74
|
+
<li><a href="#label-Add+entry+to+file+without+opening+it">Add entry to file without opening it</a>
|
75
|
+
<li><a href="#label-Find+an+entry+by+date+and+print+it.">Find an entry by date and print it.</a>
|
71
76
|
<li><a href="#label-Customization+and+Runtime+Options">Customization and Runtime Options</a>
|
72
|
-
<li><a href="#label-Available+Config+File+
|
77
|
+
<li><a href="#label-Available+Config+File+Options+and+Defaults">Available Config File Options and Defaults</a>
|
73
78
|
<li><a href="#label-Executable+Flags">Executable Flags</a>
|
74
79
|
<li><a href="#label-Using+Existing+Standup+Files">Using Existing Standup Files</a>
|
75
80
|
<li><a href="#label-API">API</a>
|
81
|
+
<li><a href="#label-API+Examples">API Examples</a>
|
76
82
|
<li><a href="#label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features</a>
|
77
83
|
<li><a href="#label-Self-Promotion">Self-Promotion</a>
|
78
84
|
</ul>
|
@@ -97,6 +103,8 @@
|
|
97
103
|
|
98
104
|
<h1 id="label-The+Standup+Doctor">The Standup Doctor<span><a href="#label-The+Standup+Doctor">¶</a> <a href="#top">↑</a></span></h1>
|
99
105
|
|
106
|
+
<p><a href="https://actions-badge.atrox.dev/evanthegrayt/standup_md/goto?ref=master"><img src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fevanthegrayt%2Fstandup_md%2Fbadge%3Fref%3Dmaster&style=flat"></a> <a href="https://badge.fury.io/rb/standup_md"><img src="https://badge.fury.io/rb/standup_md.svg"></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg"></a></p>
|
107
|
+
|
100
108
|
<blockquote>
|
101
109
|
<p>The cure for all your standup woes.</p>
|
102
110
|
</blockquote>
|
@@ -117,15 +125,29 @@
|
|
117
125
|
</li><li>
|
118
126
|
<p><a href="#usage">Usage</a></p>
|
119
127
|
</li><li>
|
120
|
-
<p><a href="#
|
128
|
+
<p><a href="#command-line">Command Line</a></p>
|
129
|
+
<ul><li>
|
130
|
+
<p><a href="#cli-examples">CLI Examples</a></p>
|
131
|
+
</li><li>
|
132
|
+
<p><a href="#adding-an-entry-for-today-via-editor">Adding an entry for today via editor</a></p>
|
133
|
+
</li><li>
|
134
|
+
<p><a href="#copy-the-entry-for-today-to-clipboard">Copy the entry for today to clipboard</a></p>
|
135
|
+
</li><li>
|
136
|
+
<p><a href="#add-entry-to-file-without-opening-it">Add entry to file without opening it</a></p>
|
137
|
+
</li><li>
|
138
|
+
<p><a href="#find-an-entry-by-date-and-print-it">Find an entry by date and print it</a></p>
|
121
139
|
</li><li>
|
122
140
|
<p><a href="#customization-and-runtime-options">Customization and Runtime Options</a></p>
|
123
141
|
</li><li>
|
124
142
|
<p><a href="#using-existing-standup-files">Using existing standup files</a></p>
|
143
|
+
</li></ul>
|
125
144
|
</li><li>
|
126
145
|
<p><a href="#api">API</a></p>
|
146
|
+
<ul><li>
|
147
|
+
<p><a href="#api-examples">API Examples</a></p>
|
127
148
|
</li><li>
|
128
149
|
<p><a href="https://evanthegrayt.github.io/standup_md/doc/index.html">Documentation</a></p>
|
150
|
+
</li></ul>
|
129
151
|
</li><li>
|
130
152
|
<p><a href="#reporting-bugs-and-requesting-features">Reporting Bugs and Requesting Features</a></p>
|
131
153
|
</li><li>
|
@@ -134,11 +156,9 @@
|
|
134
156
|
|
135
157
|
<h2 id="label-About">About<span><a href="#label-About">¶</a> <a href="#top">↑</a></span></h2>
|
136
158
|
|
137
|
-
<p>I've now been at two separate companies where we post our daily standups in a chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day became tedious, as I'd have to look up what I did the day before, copy and paste yesterday's work into a new entry, and add today's tasks. This gem automates most of this process, along with providing means of opening the file in your editor, and displaying entries from the command line.</p>
|
159
|
+
<p>I've now been at two separate companies where we post our daily standups in a chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day became tedious, as I'd have to look up what I did the day before, copy and paste yesterday's work into a new entry, and add today's tasks. This gem automates most of this process, along with providing means of opening the file in your editor, and finding and displaying entries from the command line.</p>
|
138
160
|
|
139
|
-
<p>
|
140
|
-
|
141
|
-
<p>In a nutshell, calling <code>standup</code> from the command line will open a standup file for the current month in your preferred editor. If an entry for today is already present, no text will be generated. If an entry for today doesn't exist, one will be generated, and if a previous entry exists, it will be added to today's entry as your previous day's work. See <a href="#example">example</a>. There's also an API if you'd like to use this in your own code somehow.</p>
|
161
|
+
<p>In a nutshell, calling <code>standup</code> from the command line will open a standup file for the current month in your preferred editor. If an entry for today is already present, no text will be generated. If an entry for today doesn't exist, one will be generated with your preferred values. When generating, if a previous entry exists, it will be added to today's entry as your previous day's work. See <a href="#example">example</a>. There's also a very robust API if you'd like to use this in your own code somehow.</p>
|
142
162
|
|
143
163
|
<h2 id="label-Installation">Installation<span><a href="#label-Installation">¶</a> <a href="#top">↑</a></span></h2>
|
144
164
|
|
@@ -149,32 +169,35 @@
|
|
149
169
|
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-identifier">install</span> <span class="ruby-identifier">standup_md</span>
|
150
170
|
</pre>
|
151
171
|
|
152
|
-
<p>
|
172
|
+
<p>To include in your project, add the following to your <code>Gemfile</code>.</p>
|
173
|
+
|
174
|
+
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">'standup_md'</span>
|
175
|
+
</pre>
|
153
176
|
|
154
177
|
<h3 id="label-Manual+Installation">Manual Installation<span><a href="#label-Manual+Installation">¶</a> <a href="#top">↑</a></span></h3>
|
155
178
|
|
156
|
-
<p>From your terminal, clone the repository where you want it
|
179
|
+
<p>From your terminal, clone the repository where you want it, and use <code>rake</code> to install the gem.</p>
|
157
180
|
|
158
181
|
<pre>git clone https://github.com/evanthegrayt/standup_md.git
|
159
182
|
cd standup_md
|
160
183
|
|
161
184
|
# Use rake to build and install the gem.
|
162
|
-
rake install
|
163
|
-
|
164
|
-
# OR manually link the executable somewhere. If you use this method, you cannot
|
165
|
-
# move the repository after you link it!
|
166
|
-
ln -s $PWD/bin/standup /usr/local/bin/standup</pre>
|
185
|
+
rake install</pre>
|
167
186
|
|
168
187
|
<h2 id="label-Usage">Usage<span><a href="#label-Usage">¶</a> <a href="#top">↑</a></span></h2>
|
169
188
|
|
170
|
-
<
|
189
|
+
<h3 id="label-Command+Line">Command Line<span><a href="#label-Command+Line">¶</a> <a href="#top">↑</a></span></h3>
|
190
|
+
|
191
|
+
<p>For the most basic usage, simply call the executable.</p>
|
171
192
|
|
172
193
|
<pre class="ruby"><span class="ruby-identifier">standup</span>
|
173
194
|
</pre>
|
174
195
|
|
175
|
-
<p>This opens the current month's standup file. If an entry already exists for today, nothing is added. If no entry exists for today, the previous “Current” is placed in the “Previous” section of a new entry. The format of this file is very important;
|
196
|
+
<p>This opens the current month's standup file. If an entry already exists for today, nothing is added. If no entry exists for today, the previous “Current” is placed in the “Previous” section of a new entry. The format of this file is very important; you may add new entries, but don't change any of the headers. Doing so will cause the parser to break. If you want to customize the headers, you can do so in the <a href="#available-config-file-options-and-defaults">configuration file</a>.</p>
|
197
|
+
|
198
|
+
<h3 id="label-CLI+Examples">CLI Examples<span><a href="#label-CLI+Examples">¶</a> <a href="#top">↑</a></span></h3>
|
176
199
|
|
177
|
-
<
|
200
|
+
<h4 id="label-Adding+an+entry+for+today+via+editor">Adding an entry for today via editor<span><a href="#label-Adding+an+entry+for+today+via+editor">¶</a> <a href="#top">↑</a></span></h4>
|
178
201
|
|
179
202
|
<p>For example, if the standup entry from yesterday reads as follows:</p>
|
180
203
|
|
@@ -187,72 +210,103 @@ ln -s $PWD/bin/standup /usr/local/bin/standup
|
|
187
210
|
## Impediments
|
188
211
|
- None</pre>
|
189
212
|
|
190
|
-
<p>The following scaffolding will be added for current entry at the top of the file
|
213
|
+
<p>The following scaffolding will be added for current entry at the top of the file:</p>
|
214
|
+
|
215
|
+
<pre># 2020-04-14
|
216
|
+
## Previous
|
217
|
+
- Write new feature for `standup_md`
|
218
|
+
- Fix bug in `standup_md`
|
219
|
+
## Current
|
220
|
+
- <!-- ADD TODAY'S WORK HERE -->
|
221
|
+
## Impediments
|
222
|
+
- None</pre>
|
223
|
+
|
224
|
+
<h4 id="label-Copy+the+entry+for+today+to+clipboard">Copy the entry for today to clipboard<span><a href="#label-Copy+the+entry+for+today+to+clipboard">¶</a> <a href="#top">↑</a></span></h4>
|
191
225
|
|
192
226
|
<p>There are also flags that will print entries to the command line. There's a full list of features below, but as a quick example, you can copy today's entry to your clipboard without even opening your editor.</p>
|
193
227
|
|
194
|
-
<pre class="ruby"><span class="ruby-identifier">standup</span> <span class="ruby-operator">-</span><span class="ruby-identifier">
|
228
|
+
<pre class="ruby"><span class="ruby-identifier">standup</span> <span class="ruby-operator">-</span><span class="ruby-identifier">p</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">pbcopy</span>
|
195
229
|
</pre>
|
196
230
|
|
197
|
-
<
|
231
|
+
<p>If you wanted to add today's entry without opening your editor, and print the result to the command line, you could use the following.</p>
|
198
232
|
|
199
|
-
<
|
233
|
+
<h4 id="label-Add+entry+to+file+without+opening+it">Add entry to file without opening it<span><a href="#label-Add+entry+to+file+without+opening+it">¶</a> <a href="#top">↑</a></span></h4>
|
234
|
+
|
235
|
+
<pre>standup --no-edit --current "Work on this thing","And another thing"</pre>
|
236
|
+
|
237
|
+
<h4 id="label-Find+an+entry+by+date+and+print+it.">Find an entry by date and print it.<span><a href="#label-Find+an+entry+by+date+and+print+it.">¶</a> <a href="#top">↑</a></span></h4>
|
238
|
+
|
239
|
+
<p>If you wanted to find and print the entry for March 2nd, 2020, you could use the following.</p>
|
240
|
+
|
241
|
+
<pre>standup -p 2020-03-02</pre>
|
242
|
+
|
243
|
+
<h3 id="label-Customization+and+Runtime+Options">Customization and Runtime Options<span><a href="#label-Customization+and+Runtime+Options">¶</a> <a href="#top">↑</a></span></h3>
|
244
|
+
|
245
|
+
<p>You can create a file in your home directory called <code>~/.standuprc</code>. Settings located in this file will override default behavior. This file can also have settings overwritten at runtime by the use of options. You can view <a href="https://github.com/evanthegrayt/dotfiles/blob/master/dotfiles/standuprc">my config file</a> as an example. Any setting in this file can still be overridden at runtime by passing flags to the executable.</p>
|
200
246
|
|
201
247
|
<p>You'll notice, a lot of settings don't have the ability to be changed at runtime when calling the executable. This is because the file structure is very important, and changing values that affect formatting will cause problems with the file parser. If you don't want to use a default, make the change in your config file before you start editing standups. There is an <a href="https://github.com/evanthegrayt/standup_md/issues/16">open issue</a> for handling this for the user, but they're not available yet.</p>
|
202
248
|
|
203
249
|
<p>There are no options to change the headers at runtime because it uses the headers to detect tasks from previous entries. If changed at runtime, this would cause errors. For this reason, if you don't like the default headers, change them in your configuration file after installation, and then try to not change them again.</p>
|
204
250
|
|
205
|
-
<
|
206
|
-
|
207
|
-
<pre
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
- '
|
226
|
-
-
|
227
|
-
-
|
228
|
-
-
|
229
|
-
|
230
|
-
<
|
231
|
-
|
232
|
-
<
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
-
|
240
|
-
|
241
|
-
|
242
|
-
--[no-]write Write current entry if it doesn't exist. Default is true
|
243
|
-
--[no-]edit Open the file in the editor. Default is true
|
244
|
-
-j, --[no-]json Print output as formatted json. Default is false.
|
245
|
-
-v, --[no-]verbose Verbose output. Default is false.
|
246
|
-
-c, --current Print current entry. Disables editing
|
247
|
-
-a, --all Print all previous entries. Disables editing</pre>
|
248
|
-
|
249
|
-
<p>Any options not set in this file will retain their default values. Note that if you change <code>file_name_format</code>, and don't use a month or year, there will only ever be one standup file. This could cause issues long-term, as the files will get large over time and possibly cause performance issues.</p>
|
251
|
+
<h4 id="label-Available+Config+File+Options+and+Defaults">Available Config File Options and Defaults<span><a href="#label-Available+Config+File+Options+and+Defaults">¶</a> <a href="#top">↑</a></span></h4>
|
252
|
+
|
253
|
+
<pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
254
|
+
<span class="ruby-comment"># Defaults for how the file is formatted.</span>
|
255
|
+
<span class="ruby-comment"># See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html</span>
|
256
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_date_format</span> = <span class="ruby-string">'%Y-%m-%d'</span>
|
257
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_depth</span> = <span class="ruby-value">1</span>
|
258
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_depth</span> = <span class="ruby-value">2</span>
|
259
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Current'</span>
|
260
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">previous_header</span> = <span class="ruby-string">'Previous'</span>
|
261
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">impediments_header</span> = <span class="ruby-string">'Impediments'</span>
|
262
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">notes_header</span> = <span class="ruby-string">'Notes'</span>
|
263
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_order</span> = <span class="ruby-node">%w[previous current impediments notes]</span>
|
264
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">directory</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">'HOME'</span>], <span class="ruby-string">'.cache'</span>, <span class="ruby-string">'standup_md'</span>)
|
265
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">'-'</span>
|
266
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">name_format</span> = <span class="ruby-string">'%Y_%m.md'</span>
|
267
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">create</span> = <span class="ruby-keyword">true</span>
|
268
|
+
|
269
|
+
<span class="ruby-comment"># Defaults for entries</span>
|
270
|
+
<span class="ruby-comment"># See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Entry.html</span>
|
271
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">current</span> = [<span class="ruby-string">"<!-- ADD TODAY'S WORK HERE -->"</span>]
|
272
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">previous</span> = []
|
273
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">impediments</span> = [<span class="ruby-string">'None'</span>]
|
274
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">notes</span> = []
|
275
|
+
|
276
|
+
<span class="ruby-comment"># Defaults for executable runtime behavior.</span>
|
277
|
+
<span class="ruby-comment"># See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html</span>
|
278
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">date</span> = <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>
|
279
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">editor</span> = <span class="ruby-string">'vim'</span> <span class="ruby-comment"># Checks $VISUAL and $EDITOR first, in that order</span>
|
280
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">verbose</span> = <span class="ruby-keyword">false</span>
|
281
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">edit</span> = <span class="ruby-keyword">true</span>
|
282
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">write</span> = <span class="ruby-keyword">true</span>
|
283
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">print</span> = <span class="ruby-keyword">false</span>
|
284
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">auto_fill_previous</span> = <span class="ruby-keyword">true</span>
|
285
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">preference_file</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">'HOME'</span>], <span class="ruby-string">'.standuprc'</span>))
|
286
|
+
<span class="ruby-keyword">end</span>
|
287
|
+
</pre>
|
250
288
|
|
251
|
-
<
|
289
|
+
<h4 id="label-Executable+Flags">Executable Flags<span><a href="#label-Executable+Flags">¶</a> <a href="#top">↑</a></span></h4>
|
290
|
+
|
291
|
+
<pre>--current ARRAY List of current entry's tasks
|
292
|
+
--previous ARRAY List of precious entry's tasks
|
293
|
+
--impediments ARRAY List of impediments for current entry
|
294
|
+
--notes ARRAY List of notes for current entry
|
295
|
+
--sub-header-order ARRAY The order of the sub-headers when writing the file
|
296
|
+
-f, --file-name-format STRING Date-formattable string to use for standup file name
|
297
|
+
-E, --editor EDITOR Editor to use for opening standup files
|
298
|
+
-d, --directory DIRECTORY The directories where standup files are located
|
299
|
+
-w --[no-]write Write current entry if it doesn't exist. Default is true
|
300
|
+
-a --[no-]auto-fill-previous Auto-generate 'previous' tasks for new entries
|
301
|
+
-e --[no-]edit Open the file in the editor. Default is true
|
302
|
+
-v, --[no-]verbose Verbose output. Default is false.
|
303
|
+
-p, --print [DATE] Print current entry.
|
304
|
+
If DATE is passed, will print entry for DATE, if it exists.
|
305
|
+
DATE must be in the same format as file-name-format</pre>
|
252
306
|
|
253
|
-
<
|
307
|
+
<p>Any options not set in this file will retain their default values. Note that if you change <code>file_name_format</code>, and don't use a month or year, there will only ever be one standup file. This could cause issues long-term, as the files will get large over time and possibly cause performance issues.</p>
|
254
308
|
|
255
|
-
<
|
309
|
+
<h4 id="label-Using+Existing+Standup+Files">Using Existing Standup Files<span><a href="#label-Using+Existing+Standup+Files">¶</a> <a href="#top">↑</a></span></h4>
|
256
310
|
|
257
311
|
<p>If you already have a directory of existing standup files, you can use them, but they must be in a format that the parser can understand. The default is:</p>
|
258
312
|
|
@@ -266,61 +320,64 @@ sub_header_order:
|
|
266
320
|
## Notes
|
267
321
|
- notes, if any are present</pre>
|
268
322
|
|
269
|
-
<p>The order, words, date format, and header level are all customizable, but the overall format must be the same. If customization is necessary, this must be done in <code>~/.
|
323
|
+
<p>The order, words, date format, and header level are all customizable, but the overall format must be the same. If customization is necessary, this must be done in <code>~/.standuprc</code> before execution, or else the parser will error.</p>
|
270
324
|
|
271
325
|
<p>For example, if you wanted the format to be as follows:</p>
|
272
326
|
|
273
327
|
<pre>## 05/01/2020
|
274
328
|
### Today
|
275
|
-
|
329
|
+
* task
|
276
330
|
### Yesterday
|
277
|
-
|
331
|
+
* task
|
278
332
|
### Hold-ups
|
279
|
-
|
333
|
+
* impediment
|
280
334
|
### Notes
|
281
|
-
|
282
|
-
|
283
|
-
<p>Your <code>~/.
|
284
|
-
|
285
|
-
<pre>
|
286
|
-
header_depth
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
-
|
293
|
-
- previous
|
294
|
-
|
295
|
-
|
335
|
+
* notes, if any are present</pre>
|
336
|
+
|
337
|
+
<p>Your <code>~/.standuprc</code> should contain:</p>
|
338
|
+
|
339
|
+
<pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
340
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_depth</span> = <span class="ruby-value">2</span>
|
341
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_depth</span> = <span class="ruby-value">3</span>
|
342
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span>
|
343
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">previous_header</span> = <span class="ruby-string">'Yesterday'</span>
|
344
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">impediments_header</span> = <span class="ruby-string">'Hold-ups'</span>
|
345
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">'*'</span>
|
346
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_date_format</span> = <span class="ruby-string">'%m/%d/%Y'</span>
|
347
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_order</span> = <span class="ruby-node">%w[current previous impediments notes]</span>
|
348
|
+
<span class="ruby-keyword">end</span>
|
349
|
+
</pre>
|
296
350
|
|
297
351
|
<h2 id="label-API">API<span><a href="#label-API">¶</a> <a href="#top">↑</a></span></h2>
|
298
352
|
|
299
|
-
<p>
|
353
|
+
<p>The API is fully documented in the <a href="https://evanthegrayt.github.io/standup_md/doc/index.html">RDoc Documentation</a>.</p>
|
354
|
+
|
355
|
+
<p>This was mainly written as a command line utility, but the API is ridiculously robust, and is available for use in your own projects. A quick example of how to write a new entry via code could look like the following:</p>
|
300
356
|
|
301
|
-
<
|
357
|
+
<h3 id="label-API+Examples">API Examples<span><a href="#label-API+Examples">¶</a> <a href="#top">↑</a></span></h3>
|
302
358
|
|
303
359
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
304
360
|
|
305
|
-
<span class="ruby-
|
306
|
-
<span class="ruby-identifier">
|
307
|
-
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">current_entry_tasks</span> = [<span class="ruby-string">'Thing to do today'</span>, <span class="ruby-string">'Another thing to do today'</span>],
|
308
|
-
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">impediments</span> = [<span class="ruby-string">'Not enough time in the day'</span>]
|
361
|
+
<span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
362
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span>,
|
309
363
|
<span class="ruby-keyword">end</span>
|
310
364
|
|
311
|
-
<span class="ruby-identifier">
|
365
|
+
<span class="ruby-identifier">file</span> = <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">find_by_date</span>(<span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>)
|
366
|
+
<span class="ruby-identifier">entry</span> = <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">Entry</span>.<span class="ruby-identifier">create</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">current</span> = [<span class="ruby-string">'Stuff I will do today'</span>] }
|
367
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">entries</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">entry</span>
|
368
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>
|
312
369
|
</pre>
|
313
370
|
|
314
|
-
<p>
|
315
|
-
|
316
|
-
<p>Entries are just hashes, so you can easily transform them to <code>json</code> objects.</p>
|
371
|
+
<p>The above example was written as such to show how the different pieces of the API fit together. The code can actually be simplified to the following.</p>
|
317
372
|
|
318
373
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
319
|
-
<span class="ruby-identifier">require</span> <span class="ruby-string">'json'</span>
|
320
374
|
|
321
|
-
<span class="ruby-identifier">
|
375
|
+
<span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
376
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span>,
|
377
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">current</span> = [<span class="ruby-string">'Stuff I will do today'</span>]
|
378
|
+
<span class="ruby-keyword">end</span>
|
322
379
|
|
323
|
-
<span class="ruby-
|
380
|
+
<span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">find_by_date</span>(<span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>).<span class="ruby-identifier">load</span>.<span class="ruby-identifier">write</span>
|
324
381
|
</pre>
|
325
382
|
|
326
383
|
<h2 id="label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features<span><a href="#label-Reporting+Bugs+and+Requesting+Features">¶</a> <a href="#top">↑</a></span></h2>
|