standup_md 0.2.1 → 0.3.0
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 +142 -116
- data/bin/standup +1 -1
- data/doc/README_md.html +143 -96
- data/doc/StandupMD.html +96 -1322
- 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 +355 -0
- data/doc/StandupMD/Config/Entry.html +284 -0
- data/doc/StandupMD/Config/EntryList.html +197 -0
- data/doc/StandupMD/Config/File.html +609 -0
- data/doc/StandupMD/Entry.html +478 -0
- data/doc/StandupMD/EntryList.html +759 -0
- data/doc/StandupMD/File.html +574 -0
- data/doc/created.rid +15 -5
- data/doc/index.html +153 -94
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/table_of_contents.html +221 -72
- data/lib/standup_md.rb +27 -544
- data/lib/standup_md/cli.rb +63 -246
- data/lib/standup_md/cli/helpers.rb +165 -0
- data/lib/standup_md/config.rb +45 -0
- data/lib/standup_md/config/cli.rb +106 -0
- data/lib/standup_md/config/entry.rb +61 -0
- data/lib/standup_md/config/entry_list.rb +26 -0
- data/lib/standup_md/config/file.rb +199 -0
- data/lib/standup_md/entry.rb +121 -0
- data/lib/standup_md/entry_list.rb +166 -0
- data/lib/standup_md/file.rb +172 -0
- data/lib/standup_md/file/helpers.rb +62 -0
- data/lib/standup_md/version.rb +5 -3
- 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: 242a29dbf1c80aad455f52db138b1a8bae0f04d3d2fa7274800ec69d8b5b9b74
|
4
|
+
data.tar.gz: dbe432dfa8b42deb98d03bd3131bfdd8a79df77fd162a6a04af4f0c99837524b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d3014ead364eea9aa5584207fd1a3cf8ae099b18b0f7b0afef3642adb20565c4741d010b92d104d191405fc7b05a929f05d0af089d0a9544325f490b0f74277
|
7
|
+
data.tar.gz: 63f257db8bd154170580ee1379dbe2942c412438fce6879b685cd3d236b9fee3edb6df985499284dd2000bc712ae81305712d20f9ec50dc1b8d1567e1698a2b6
|
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
@@ -18,11 +18,17 @@ View on: [Github](https://github.com/evanthegrayt/standup_md) |
|
|
18
18
|
- [Via RubyGems](#via-rubygems)
|
19
19
|
- [Manual Installation](#manual-installation)
|
20
20
|
- [Usage](#usage)
|
21
|
-
- [
|
22
|
-
|
23
|
-
|
24
|
-
- [
|
25
|
-
|
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)
|
26
32
|
- [Reporting Bugs and Requesting Features](#reporting-bugs-and-requesting-features)
|
27
33
|
- [Self-Promotion](#self-promotion)
|
28
34
|
|
@@ -32,17 +38,15 @@ chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day
|
|
32
38
|
became tedious, as I'd have to look up what I did the day before, copy and paste
|
33
39
|
yesterday's work into a new entry, and add today's tasks. This gem automates
|
34
40
|
most of this process, along with providing means of opening the file in your
|
35
|
-
editor, and displaying entries from the command line.
|
36
|
-
|
37
|
-
I wasn't sure that others would find this useful, but then the pandemic
|
38
|
-
happened, which I assume made doing standups via chat much more common.
|
41
|
+
editor, and finding and displaying entries from the command line.
|
39
42
|
|
40
43
|
In a nutshell, calling `standup` from the command line will open a standup file
|
41
44
|
for the current month in your preferred editor. If an entry for today is already
|
42
45
|
present, no text will be generated. If an entry for today doesn't exist, one
|
43
|
-
will be generated
|
44
|
-
entry as your previous day's work. See
|
45
|
-
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.
|
46
50
|
|
47
51
|
## Installation
|
48
52
|
### Via RubyGems
|
@@ -52,15 +56,15 @@ Just install the gem!
|
|
52
56
|
gem install standup_md
|
53
57
|
```
|
54
58
|
|
55
|
-
|
56
|
-
using
|
57
|
-
[rbenv](http://www.rubyinside.com/rbenv-a-simple-new-ruby-version-management-tool-5302.html),
|
58
|
-
or you can try the manual methods below.
|
59
|
+
To include in your project, add the following to your `Gemfile`.
|
59
60
|
|
61
|
+
```ruby
|
62
|
+
gem 'standup_md'
|
63
|
+
```
|
60
64
|
|
61
65
|
### Manual Installation
|
62
|
-
From your terminal, clone the repository where you want it
|
63
|
-
|
66
|
+
From your terminal, clone the repository where you want it, and use `rake` to
|
67
|
+
install the gem.
|
64
68
|
|
65
69
|
```sh
|
66
70
|
git clone https://github.com/evanthegrayt/standup_md.git
|
@@ -68,14 +72,11 @@ cd standup_md
|
|
68
72
|
|
69
73
|
# Use rake to build and install the gem.
|
70
74
|
rake install
|
71
|
-
|
72
|
-
# OR manually link the executable somewhere. If you use this method, you cannot
|
73
|
-
# move the repository after you link it!
|
74
|
-
ln -s $PWD/bin/standup /usr/local/bin/standup
|
75
75
|
```
|
76
76
|
|
77
77
|
## Usage
|
78
|
-
|
78
|
+
### Command Line
|
79
|
+
For the most basic usage, simplyt call the executable.
|
79
80
|
|
80
81
|
```sh
|
81
82
|
standup
|
@@ -83,10 +84,13 @@ standup
|
|
83
84
|
|
84
85
|
This opens the current month's standup file. If an entry already exists for
|
85
86
|
today, nothing is added. If no entry exists for today, the previous "Current" is
|
86
|
-
placed in the "Previous" section of a new entry.
|
87
|
-
|
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).
|
88
91
|
|
89
|
-
###
|
92
|
+
### CLI Examples
|
93
|
+
#### Adding an entry for today via editor
|
90
94
|
For example, if the standup entry from yesterday reads as follows:
|
91
95
|
|
92
96
|
```markdown
|
@@ -114,19 +118,36 @@ file:
|
|
114
118
|
- None
|
115
119
|
```
|
116
120
|
|
121
|
+
#### Copy the entry for today to clipboard
|
117
122
|
There are also flags that will print entries to the command line. There's a full
|
118
123
|
list of features below, but as a quick example, you can copy today's entry to
|
119
124
|
your clipboard without even opening your editor.
|
120
125
|
|
121
126
|
```sh
|
122
|
-
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" -p
|
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
|
123
144
|
```
|
124
145
|
|
125
|
-
|
126
|
-
You can create a file in your home directory called `~/.
|
127
|
-
|
128
|
-
|
129
|
-
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)
|
130
151
|
as an example. Any setting in this file can still be overridden at runtime by
|
131
152
|
passing flags to the executable.
|
132
153
|
|
@@ -145,51 +166,62 @@ them in your configuration file after installation, and then try to not change
|
|
145
166
|
them again.
|
146
167
|
|
147
168
|
|
148
|
-
|
149
|
-
|
150
|
-
```
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
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
|
173
206
|
```
|
174
207
|
|
175
|
-
|
208
|
+
#### Executable Flags
|
176
209
|
```
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
-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
|
193
225
|
```
|
194
226
|
|
195
227
|
Any options not set in this file will retain their default values. Note that if
|
@@ -197,14 +229,7 @@ you change `file_name_format`, and don't use a month or year, there will only
|
|
197
229
|
ever be one standup file. This could cause issues long-term, as the files will
|
198
230
|
get large over time and possibly cause performance issues.
|
199
231
|
|
200
|
-
|
201
|
-
editor, you could use the following:
|
202
|
-
|
203
|
-
```bash
|
204
|
-
standup --no-edit --current-entry-tasks="Work on this thing","And another thing!"
|
205
|
-
```
|
206
|
-
|
207
|
-
### Using Existing Standup Files
|
232
|
+
#### Using Existing Standup Files
|
208
233
|
If you already have a directory of existing standup files, you can use them, but
|
209
234
|
they must be in a format that the parser can understand. The default is:
|
210
235
|
|
@@ -222,7 +247,7 @@ they must be in a format that the parser can understand. The default is:
|
|
222
247
|
|
223
248
|
The order, words, date format, and header level are all customizable, but the
|
224
249
|
overall format must be the same. If customization is necessary, this must be
|
225
|
-
done in `~/.
|
250
|
+
done in `~/.standuprc` before execution, or else the parser will error.
|
226
251
|
|
227
252
|
For example, if you wanted the format to be as follows:
|
228
253
|
|
@@ -238,57 +263,58 @@ For example, if you wanted the format to be as follows:
|
|
238
263
|
* notes, if any are present
|
239
264
|
```
|
240
265
|
|
241
|
-
Your `~/.
|
242
|
-
|
243
|
-
```
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
- impediments
|
255
|
-
- notes
|
266
|
+
Your `~/.standuprc` should contain:
|
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
|
256
279
|
```
|
257
280
|
|
258
281
|
## API
|
259
|
-
|
282
|
+
The API is fully documented in the
|
260
283
|
[documentation](https://evanthegrayt.github.io/standup_md/doc/index.html).
|
261
284
|
|
262
|
-
This was mainly written as a command line utility, but
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
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:
|
288
|
+
|
289
|
+
### API Examples
|
267
290
|
|
268
291
|
```ruby
|
269
292
|
require 'standup_md'
|
293
|
+
require 'date'
|
270
294
|
|
271
|
-
|
272
|
-
|
273
|
-
s.current_entry_tasks = ['Thing to do today', 'Another thing to do today'],
|
274
|
-
s.impediments = ['Not enough time in the day']
|
295
|
+
StandupMD.configure do |c|
|
296
|
+
c.file.current_header = 'Today',
|
275
297
|
end
|
276
298
|
|
277
|
-
|
299
|
+
file = StandupMD::File.find_by_date(Date.today)
|
300
|
+
entry = StandupMD::Entry.create { |e| e.current = ['Stuff I will do today'] }
|
301
|
+
file.entries << entry
|
302
|
+
file.write
|
278
303
|
```
|
279
304
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
Entries are just hashes, so you can easily transform them to `json` objects.
|
305
|
+
The above example was written as such to show how the different pieces of the
|
306
|
+
API fit together. The code can actually be simplified to the following.
|
284
307
|
|
285
308
|
```ruby
|
286
309
|
require 'standup_md'
|
287
|
-
require '
|
310
|
+
require 'date'
|
288
311
|
|
289
|
-
|
312
|
+
StandupMD.configure do |c|
|
313
|
+
c.file.current_header = 'Today',
|
314
|
+
c.entry.current = ['Stuff I will do today']
|
315
|
+
end
|
290
316
|
|
291
|
-
|
317
|
+
StandupMD::File.find_by_date(Date.today).load.write
|
292
318
|
```
|
293
319
|
|
294
320
|
## 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>
|
@@ -119,15 +125,29 @@
|
|
119
125
|
</li><li>
|
120
126
|
<p><a href="#usage">Usage</a></p>
|
121
127
|
</li><li>
|
122
|
-
<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>
|
123
139
|
</li><li>
|
124
140
|
<p><a href="#customization-and-runtime-options">Customization and Runtime Options</a></p>
|
125
141
|
</li><li>
|
126
142
|
<p><a href="#using-existing-standup-files">Using existing standup files</a></p>
|
143
|
+
</li></ul>
|
127
144
|
</li><li>
|
128
145
|
<p><a href="#api">API</a></p>
|
146
|
+
<ul><li>
|
147
|
+
<p><a href="#api-examples">API Examples</a></p>
|
129
148
|
</li><li>
|
130
149
|
<p><a href="https://evanthegrayt.github.io/standup_md/doc/index.html">Documentation</a></p>
|
150
|
+
</li></ul>
|
131
151
|
</li><li>
|
132
152
|
<p><a href="#reporting-bugs-and-requesting-features">Reporting Bugs and Requesting Features</a></p>
|
133
153
|
</li><li>
|
@@ -136,11 +156,9 @@
|
|
136
156
|
|
137
157
|
<h2 id="label-About">About<span><a href="#label-About">¶</a> <a href="#top">↑</a></span></h2>
|
138
158
|
|
139
|
-
<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>
|
140
160
|
|
141
|
-
<p>
|
142
|
-
|
143
|
-
<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>
|
144
162
|
|
145
163
|
<h2 id="label-Installation">Installation<span><a href="#label-Installation">¶</a> <a href="#top">↑</a></span></h2>
|
146
164
|
|
@@ -151,32 +169,35 @@
|
|
151
169
|
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-identifier">install</span> <span class="ruby-identifier">standup_md</span>
|
152
170
|
</pre>
|
153
171
|
|
154
|
-
<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>
|
155
176
|
|
156
177
|
<h3 id="label-Manual+Installation">Manual Installation<span><a href="#label-Manual+Installation">¶</a> <a href="#top">↑</a></span></h3>
|
157
178
|
|
158
|
-
<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>
|
159
180
|
|
160
181
|
<pre>git clone https://github.com/evanthegrayt/standup_md.git
|
161
182
|
cd standup_md
|
162
183
|
|
163
184
|
# Use rake to build and install the gem.
|
164
|
-
rake install
|
165
|
-
|
166
|
-
# OR manually link the executable somewhere. If you use this method, you cannot
|
167
|
-
# move the repository after you link it!
|
168
|
-
ln -s $PWD/bin/standup /usr/local/bin/standup</pre>
|
185
|
+
rake install</pre>
|
169
186
|
|
170
187
|
<h2 id="label-Usage">Usage<span><a href="#label-Usage">¶</a> <a href="#top">↑</a></span></h2>
|
171
188
|
|
172
|
-
<
|
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, simplyt call the executable.</p>
|
173
192
|
|
174
193
|
<pre class="ruby"><span class="ruby-identifier">standup</span>
|
175
194
|
</pre>
|
176
195
|
|
177
|
-
<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>
|
178
199
|
|
179
|
-
<
|
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>
|
180
201
|
|
181
202
|
<p>For example, if the standup entry from yesterday reads as follows:</p>
|
182
203
|
|
@@ -200,70 +221,92 @@ ln -s $PWD/bin/standup /usr/local/bin/standup
|
|
200
221
|
## Impediments
|
201
222
|
- None</pre>
|
202
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>
|
225
|
+
|
203
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>
|
204
227
|
|
205
|
-
<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>
|
206
229
|
</pre>
|
207
230
|
|
208
|
-
<
|
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>
|
232
|
+
|
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>
|
209
234
|
|
210
|
-
<
|
235
|
+
<pre>standup --no-edit --current "Work on this thing","And another thing" -p</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>
|
211
246
|
|
212
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>
|
213
248
|
|
214
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>
|
215
250
|
|
216
|
-
<
|
217
|
-
|
218
|
-
<pre
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
- '
|
237
|
-
-
|
238
|
-
-
|
239
|
-
-
|
240
|
-
|
241
|
-
<
|
242
|
-
|
243
|
-
<
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
-
|
251
|
-
|
252
|
-
|
253
|
-
--[no-]write Write current entry if it doesn't exist. Default is true
|
254
|
-
--[no-]edit Open the file in the editor. Default is true
|
255
|
-
-j, --[no-]json Print output as formatted json. Default is false.
|
256
|
-
-v, --[no-]verbose Verbose output. Default is false.
|
257
|
-
-c, --current Print current entry. Disables editing
|
258
|
-
-a, --all Print all previous entries. Disables editing</pre>
|
259
|
-
|
260
|
-
<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>
|
261
288
|
|
262
|
-
<
|
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>
|
263
306
|
|
264
|
-
<
|
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>
|
265
308
|
|
266
|
-
<
|
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>
|
267
310
|
|
268
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>
|
269
312
|
|
@@ -277,7 +320,7 @@ sub_header_order:
|
|
277
320
|
## Notes
|
278
321
|
- notes, if any are present</pre>
|
279
322
|
|
280
|
-
<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>
|
281
324
|
|
282
325
|
<p>For example, if you wanted the format to be as follows:</p>
|
283
326
|
|
@@ -291,48 +334,52 @@ sub_header_order:
|
|
291
334
|
### Notes
|
292
335
|
* notes, if any are present</pre>
|
293
336
|
|
294
|
-
<p>Your <code>~/.
|
295
|
-
|
296
|
-
<pre>
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
- current
|
305
|
-
|
306
|
-
|
307
|
-
- notes</pre>
|
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-constant">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-constant">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-constant">Hold</span><span class="ruby-operator">-</span><span class="ruby-identifier">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>
|
308
350
|
|
309
351
|
<h2 id="label-API">API<span><a href="#label-API">¶</a> <a href="#top">↑</a></span></h2>
|
310
352
|
|
311
|
-
<p>
|
353
|
+
<p>The API is fully documented in the <a href="https://evanthegrayt.github.io/standup_md/doc/index.html">documentation</a>.</p>
|
312
354
|
|
313
|
-
<p>This was mainly written as a command line utility, but
|
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>
|
356
|
+
|
357
|
+
<h3 id="label-API+Examples">API Examples<span><a href="#label-API+Examples">¶</a> <a href="#top">↑</a></span></h3>
|
314
358
|
|
315
359
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
360
|
+
<span class="ruby-identifier">require</span> <span class="ruby-string">'date'</span>
|
316
361
|
|
317
|
-
<span class="ruby-
|
318
|
-
<span class="ruby-identifier">
|
319
|
-
<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>],
|
320
|
-
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">impediments</span> = [<span class="ruby-string">'Not enough time in the day'</span>]
|
362
|
+
<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>
|
363
|
+
<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>,
|
321
364
|
<span class="ruby-keyword">end</span>
|
322
365
|
|
323
|
-
<span class="ruby-identifier">
|
366
|
+
<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>)
|
367
|
+
<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>] }
|
368
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">entries</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">entry</span>
|
369
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>
|
324
370
|
</pre>
|
325
371
|
|
326
|
-
<p>
|
327
|
-
|
328
|
-
<p>Entries are just hashes, so you can easily transform them to <code>json</code> objects.</p>
|
372
|
+
<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>
|
329
373
|
|
330
374
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
331
|
-
<span class="ruby-identifier">require</span> <span class="ruby-string">'
|
375
|
+
<span class="ruby-identifier">require</span> <span class="ruby-string">'date'</span>
|
332
376
|
|
333
|
-
<span class="ruby-identifier">
|
377
|
+
<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>
|
378
|
+
<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>,
|
379
|
+
<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>]
|
380
|
+
<span class="ruby-keyword">end</span>
|
334
381
|
|
335
|
-
<span class="ruby-
|
382
|
+
<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>
|
336
383
|
</pre>
|
337
384
|
|
338
385
|
<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>
|