standup_md 0.2.1 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47e0efce596a788d69ac8f7faeadc54532bb1ff1995b52c56ad2e0dc707c5472
4
- data.tar.gz: b3cdb0c4cef322a5b1020ce073bd325a046abee1a7926b73200f0b302ffe8703
3
+ metadata.gz: 71a7fb49df17324d09d35de586a54edb308f684cad586fefc5a0da8feeb1f6c1
4
+ data.tar.gz: 592f369262e459631dacae459836e804c9fe9777932f9b9e1f6ee9201a6d8e99
5
5
  SHA512:
6
- metadata.gz: dab3f3fa03a6c1635274dd7545bfb959ea961d9c8868f6062af0a4a7d2d00d760c0ccec4cc65d30bb8ca24702ed2773741da91254f3a0bdc6a57717d63ccfa05
7
- data.tar.gz: a00498bcc03da2e7867c7c0bcdf1b53791f37f5f8d5707624ebd433ae3e30e8e4bc600f3593a32d9814b9e9f47229a3322aac6f854cf40abe46f969060137a57
6
+ metadata.gz: e02396bf9be1f7087122f2f52d5cd7b038716be203ff7303ff99c4335eae2e82a1114d13a782523df4647477865d9972ba257eed2d31ae253992ea98a985d675
7
+ data.tar.gz: ef19c102c52fe69cc767ced8523a841cbea1714e6a9d4cd05f2c45e4c07d4721e33b0abf7fbc84354498bfc02e2cb09168b1ee667c4022b0edb9805a202a6dd6
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  standup_md-*.gem
2
+ coverage/*
@@ -1,14 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standup_md (0.1.3)
4
+ standup_md (0.3.3)
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)
11
- test-unit (3.3.5)
12
+ simplecov (0.18.5)
13
+ docile (~> 1.1)
14
+ simplecov-html (~> 0.11)
15
+ simplecov-html (0.12.2)
16
+ test-unit (3.3.6)
12
17
  power_assert
13
18
 
14
19
  PLATFORMS
@@ -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,18 @@ 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
- - [Example](#example)
22
- - [Customization and Runtime Options](#customization-and-runtime-options)
23
- - [Using existing standup files](#using-existing-standup-files)
24
- - [API](#api)
25
- - [Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html)
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
+ - [Adding an entry for today](#adding-an-entry-for-today)
32
+ - [Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html)
26
33
  - [Reporting Bugs and Requesting Features](#reporting-bugs-and-requesting-features)
27
34
  - [Self-Promotion](#self-promotion)
28
35
 
@@ -32,19 +39,22 @@ chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day
32
39
  became tedious, as I'd have to look up what I did the day before, copy and paste
33
40
  yesterday's work into a new entry, and add today's tasks. This gem automates
34
41
  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.
42
+ editor, and finding and displaying entries from the command line.
39
43
 
40
44
  In a nutshell, calling `standup` from the command line will open a standup file
41
45
  for the current month in your preferred editor. If an entry for today is already
42
46
  present, no text will be generated. If an entry for today doesn't exist, one
43
- will be generated, and if a previous entry exists, it will be added to today's
44
- entry as your previous day's work. See [example](#example). There's also an API
45
- if you'd like to use this in your own code somehow.
47
+ will be generated with your preferred values. When generating, if a previous
48
+ entry exists, it will be added to today's entry as your previous day's work. See
49
+ [example](#example). There's also a very robust API if you'd like to use this
50
+ in your own code somehow.
46
51
 
47
52
  ## Installation
53
+ If you don't have the permissions to install system-wide gems, you're probabaly
54
+ also running an older version of ruby. I recommend installing
55
+ [rbenv](https://github.com/rbenv/rbenv#installation), and then installing an
56
+ up-to-date version of ruby.
57
+
48
58
  ### Via RubyGems
49
59
  Just install the gem!
50
60
 
@@ -52,15 +62,15 @@ Just install the gem!
52
62
  gem install standup_md
53
63
  ```
54
64
 
55
- If you don't have permission on your system to install ruby or gems, I recommend
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.
65
+ To include in your project, add the following to your `Gemfile`.
59
66
 
67
+ ```ruby
68
+ gem 'standup_md'
69
+ ```
60
70
 
61
71
  ### Manual Installation
62
- From your terminal, clone the repository where you want it. From there, you have
63
- a couple of installation options.
72
+ From your terminal, clone the repository where you want it, and use `rake` to
73
+ install the gem.
64
74
 
65
75
  ```sh
66
76
  git clone https://github.com/evanthegrayt/standup_md.git
@@ -68,14 +78,11 @@ cd standup_md
68
78
 
69
79
  # Use rake to build and install the gem.
70
80
  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
81
  ```
76
82
 
77
83
  ## Usage
78
- Call the executable.
84
+ ### Command Line
85
+ For the most basic usage, simply call the executable.
79
86
 
80
87
  ```sh
81
88
  standup
@@ -83,10 +90,13 @@ standup
83
90
 
84
91
  This opens the current month's standup file. If an entry already exists for
85
92
  today, nothing is added. If no entry exists for today, the previous "Current" is
86
- placed in the "Previous" section of a new entry. The format of this file is
87
- very important; do not change anything, except for adding entries for today.
93
+ placed in the "Previous" section of a new entry. The format of this file is very
94
+ important; you may add new entries, but don't change any of the headers. Doing
95
+ so will cause the parser to break. If you want to customize the headers, you can
96
+ do so in the [configuration file](#available-config-file-options-and-defaults).
88
97
 
89
- ### Example
98
+ ### CLI Examples
99
+ #### Adding an entry for today via editor
90
100
  For example, if the standup entry from yesterday reads as follows:
91
101
 
92
102
  ```markdown
@@ -114,19 +124,36 @@ file:
114
124
  - None
115
125
  ```
116
126
 
127
+ #### Copy the entry for today to clipboard
117
128
  There are also flags that will print entries to the command line. There's a full
118
129
  list of features below, but as a quick example, you can copy today's entry to
119
130
  your clipboard without even opening your editor.
120
131
 
121
132
  ```sh
122
- standup -c | pbcopy
133
+ standup -p | pbcopy
134
+ ```
135
+
136
+ If you wanted to add today's entry without opening your editor, and print the
137
+ result to the command line, you could use the following.
138
+
139
+ #### Add entry to file without opening it
140
+ ```sh
141
+ standup --no-edit --current "Work on this thing","And another thing"
142
+ ```
143
+
144
+ #### Find an entry by date and print it.
145
+ If you wanted to find and print the entry for March 2nd, 2020, you could use the
146
+ following.
147
+
148
+ ```sh
149
+ standup -p 2020-03-02
123
150
  ```
124
151
 
125
- ## Customization and Runtime Options
126
- You can create a file in your home directory called `~/.standup_md.yml`.
127
- Settings located in this file will override default behavior. This file can also
128
- have settings overwritten at runtime by the use of options. You can view [my config
129
- file](https://github.com/evanthegrayt/dotfiles/blob/master/dotfiles/standup_md.yml)
152
+ ### Customization and Runtime Options
153
+ You can create a file in your home directory called `~/.standuprc`. Settings
154
+ located in this file will override default behavior. This file can also have
155
+ settings overwritten at runtime by the use of options. You can view [my config
156
+ file](https://github.com/evanthegrayt/dotfiles/blob/master/dotfiles/standuprc)
130
157
  as an example. Any setting in this file can still be overridden at runtime by
131
158
  passing flags to the executable.
132
159
 
@@ -145,51 +172,64 @@ them in your configuration file after installation, and then try to not change
145
172
  them again.
146
173
 
147
174
 
148
- ### Available Config File Keys and Defaults
149
-
150
- ```yaml
151
- # Key: Default
152
- header_depth: 1
153
- header_date_format: '%Y-%m-%d'
154
- sub_header_depth: 2
155
- current_header: 'Current'
156
- previous_header: 'Previous'
157
- impediments_header: 'Impediments'
158
- file_name_format: '%Y_%m.md'
159
- bullet_character: '-' # (dash)
160
- directory: '~/.cache/standup_md'
161
- editor: # $VISUAL, $EDITOR or vim, in that order
162
- current_entry_tasks:
163
- - "<!-- ADD TODAY'S WORK HERE -->"
164
- previous_entry_tasks: # An array of the tasks from the previous entry
165
- impediments:
166
- - 'None'
167
- notes: null # If not null, must be array
168
- sub_header_order:
169
- - 'previous'
170
- - 'current'
171
- - 'impediments'
172
- - 'notes'
175
+ #### Available Config File Options and Defaults
176
+ For command-line usage, this file needs to be named `~/.standuprc`. To use in a
177
+ rails project, create an initializer (`config/initializers/standup_md.rb`).
178
+
179
+ ```ruby
180
+ StandupMD.configure do |c|
181
+ # Defaults for how the file is formatted.
182
+ # See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html
183
+ c.file.header_date_format = '%Y-%m-%d'
184
+ c.file.header_depth = 1
185
+ c.file.sub_header_depth = 2
186
+ c.file.current_header = 'Current'
187
+ c.file.previous_header = 'Previous'
188
+ c.file.impediments_header = 'Impediments'
189
+ c.file.notes_header = 'Notes'
190
+ c.file.sub_header_order = %w[previous current impediments notes]
191
+ c.file.directory = ::File.join(ENV['HOME'], '.cache', 'standup_md')
192
+ c.file.bullet_character = '-'
193
+ c.file.name_format = '%Y_%m.md'
194
+ c.file.create = true
195
+
196
+ # Defaults for entries
197
+ # See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Entry.html
198
+ c.entry.current = ["<!-- ADD TODAY'S WORK HERE -->"]
199
+ c.entry.previous = []
200
+ c.entry.impediments = ['None']
201
+ c.entry.notes = []
202
+
203
+ # Defaults for executable runtime behavior.
204
+ # See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html
205
+ c.cli.date = Date.today
206
+ c.cli.editor = 'vim' # Checks $VISUAL and $EDITOR first, in that order
207
+ c.cli.verbose = false
208
+ c.cli.edit = true
209
+ c.cli.write = true
210
+ c.cli.print = false
211
+ c.cli.auto_fill_previous = true
212
+ c.cli.preference_file = ::File.expand_path(::File.join(ENV['HOME'], '.standuprc'))
213
+ end
173
214
  ```
174
215
 
175
- ### Executable Flags
216
+ #### Executable Flags
176
217
  ```
177
- The Standup Doctor
178
- --current-entry-tasks=ARRAY List of current entry's tasks
179
- --previous-entry-tasks=ARRAY List of yesterday's tasks
180
- --impediments=ARRAY List of impediments for current entry
181
- --notes=ARRAY List of notes for current entry
182
- --sub-header-order=ARRAY The order of the sub-headers when writing the file
183
- --[no-]append-previous Append previous tasks? Default is true
184
- -f, --file-name-format=STRING Date-formattable string to use for standup file name
185
- -e, --editor=EDITOR Editor to use for opening standup files
186
- -d, --directory=DIRECTORY The directories where standup files are located
187
- --[no-]write Write current entry if it doesn't exist. Default is true
188
- --[no-]edit Open the file in the editor. Default is true
189
- -j, --[no-]json Print output as formatted json. Default is false.
190
- -v, --[no-]verbose Verbose output. Default is false.
191
- -c, --current Print current entry. Disables editing
192
- -a, --all Print all previous entries. Disables editing
218
+ --current ARRAY List of current entry's tasks
219
+ --previous ARRAY List of precious entry's tasks
220
+ --impediments ARRAY List of impediments for current entry
221
+ --notes ARRAY List of notes for current entry
222
+ --sub-header-order ARRAY The order of the sub-headers when writing the file
223
+ -f, --file-name-format STRING Date-formattable string to use for standup file name
224
+ -E, --editor EDITOR Editor to use for opening standup files
225
+ -d, --directory DIRECTORY The directories where standup files are located
226
+ -w --[no-]write Write current entry if it doesn't exist. Default is true
227
+ -a --[no-]auto-fill-previous Auto-generate 'previous' tasks for new entries
228
+ -e --[no-]edit Open the file in the editor. Default is true
229
+ -v, --[no-]verbose Verbose output. Default is false.
230
+ -p, --print [DATE] Print current entry.
231
+ If DATE is passed, will print entry for DATE, if it exists.
232
+ DATE must be in the same format as file-name-format
193
233
  ```
194
234
 
195
235
  Any options not set in this file will retain their default values. Note that if
@@ -197,14 +237,7 @@ you change `file_name_format`, and don't use a month or year, there will only
197
237
  ever be one standup file. This could cause issues long-term, as the files will
198
238
  get large over time and possibly cause performance issues.
199
239
 
200
- If you wanted to add some tasks at runtime, and without opening the file in an
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
240
+ #### Using Existing Standup Files
208
241
  If you already have a directory of existing standup files, you can use them, but
209
242
  they must be in a format that the parser can understand. The default is:
210
243
 
@@ -222,7 +255,7 @@ they must be in a format that the parser can understand. The default is:
222
255
 
223
256
  The order, words, date format, and header level are all customizable, but the
224
257
  overall format must be the same. If customization is necessary, this must be
225
- done in `~/.standup_md.yml` before execution, or else the parser will error.
258
+ done in `~/.standuprc` before execution, or else the parser will error.
226
259
 
227
260
  For example, if you wanted the format to be as follows:
228
261
 
@@ -238,57 +271,56 @@ For example, if you wanted the format to be as follows:
238
271
  * notes, if any are present
239
272
  ```
240
273
 
241
- Your `~/.standup_md.yml` should contain:
242
-
243
- ```yaml
244
- header_depth: 2
245
- sub_header_depth: 3
246
- current_header: Today
247
- previous_header: Yesterday
248
- impediments_header: Hold-ups
249
- bullet_character: '*'
250
- header_date_format: '%m/%d/%Y'
251
- sub_header_order:
252
- - current
253
- - previous
254
- - impediments
255
- - notes
274
+ Your `~/.standuprc` should contain:
275
+
276
+ ```ruby
277
+ StandupMD.configure do |c|
278
+ c.file.header_depth = 2
279
+ c.file.sub_header_depth = 3
280
+ c.file.current_header = 'Today'
281
+ c.file.previous_header = 'Yesterday'
282
+ c.file.impediments_header = 'Hold-ups'
283
+ c.file.bullet_character = '*'
284
+ c.file.header_date_format = '%m/%d/%Y'
285
+ c.file.sub_header_order = %w[current previous impediments notes]
286
+ end
256
287
  ```
257
288
 
258
289
  ## API
259
- Below are some quick examples, but the API is fully documented in the
260
- [documentation](https://evanthegrayt.github.io/standup_md/doc/index.html).
290
+ The API is fully documented in the
291
+ [RDoc Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html).
261
292
 
262
- This was mainly written as a command line utility, but I made the API available
263
- for scripting. There are attribute accessors for most of the settings in the
264
- [customization table](#customization-and-runtime-options) above. A
265
- quick example of how to write a new entry via code could look like the
266
- following:
293
+ This was mainly written as a command line utility, but the API is ridiculously
294
+ robust, and is available for use in your own projects. A quick example of how
295
+ to write a new entry via code could look like the following:
267
296
 
297
+ ### API Examples
298
+ #### Adding an entry for today
268
299
  ```ruby
269
300
  require 'standup_md'
270
301
 
271
- standup = StandupMD.load do |s|
272
- s.current_header = 'Today',
273
- s.current_entry_tasks = ['Thing to do today', 'Another thing to do today'],
274
- s.impediments = ['Not enough time in the day']
302
+ StandupMD.configure do |c|
303
+ c.file.current_header = 'Today',
275
304
  end
276
305
 
277
- standup.write
306
+ file = StandupMD::File.find_by_date(Date.today)
307
+ entry = StandupMD::Entry.create { |e| e.current = ['Stuff I will do today'] }
308
+ file.entries << entry
309
+ file.write
278
310
  ```
279
311
 
280
- Note: `StandupMD.load { ... }` just is a quick way to call `StandupMD.new {
281
- ... }.load`
282
-
283
- Entries are just hashes, so you can easily transform them to `json` objects.
312
+ The above example was written as such to show how the different pieces of the
313
+ API fit together. The code can actually be simplified to the following.
284
314
 
285
315
  ```ruby
286
316
  require 'standup_md'
287
- require 'json'
288
317
 
289
- standup = StandupMD.load
318
+ StandupMD.configure do |c|
319
+ c.file.current_header = 'Today',
320
+ c.entry.current = ['Stuff I will do today']
321
+ end
290
322
 
291
- standup_json = standup.all_entries.to_json
323
+ StandupMD::File.find_by_date(Date.today).load.write
292
324
  ```
293
325
 
294
326
  ## Reporting Bugs and Requesting Features
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require_relative '../lib/standup_md/cli'
3
+ require_relative '../lib/standup_md'
4
4
 
5
5
  StandupMD::Cli.execute(ARGV)
@@ -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-Example">Example</a>
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+Keys+and+Defaults">Available Config File Keys and Defaults</a>
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="#example">Example</a></p>
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">&para;</a> <a href="#top">&uarr;</a></span></h2>
138
158
 
139
- <p>I&#39;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&#39;d have to look up what I did the day before, copy and paste yesterday&#39;s work into a new entry, and add today&#39;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&#39;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&#39;d have to look up what I did the day before, copy and paste yesterday&#39;s work into a new entry, and add today&#39;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>I wasn&#39;t sure that others would find this useful, but then the pandemic happened, which I assume made doing standups via chat much more common.</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&#39;t exist, one will be generated, and if a previous entry exists, it will be added to today&#39;s entry as your previous day&#39;s work. See <a href="#example">example</a>. There&#39;s also an API if you&#39;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&#39;t exist, one will be generated with your preferred values. When generating, if a previous entry exists, it will be added to today&#39;s entry as your previous day&#39;s work. See <a href="#example">example</a>. There&#39;s also a very robust API if you&#39;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">&para;</a> <a href="#top">&uarr;</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>If you don&#39;t have permission on your system to install ruby or gems, I recommend using <a href="http://www.rubyinside.com/rbenv-a-simple-new-ruby-version-management-tool-5302.html">rbenv</a>, or you can try the manual methods below.</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">&#39;standup_md&#39;</span>
175
+ </pre>
155
176
 
156
177
  <h3 id="label-Manual+Installation">Manual Installation<span><a href="#label-Manual+Installation">&para;</a> <a href="#top">&uarr;</a></span></h3>
157
178
 
158
- <p>From your terminal, clone the repository where you want it. From there, you have a couple of installation options.</p>
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">&para;</a> <a href="#top">&uarr;</a></span></h2>
171
188
 
172
- <p>Call the executable.</p>
189
+ <h3 id="label-Command+Line">Command Line<span><a href="#label-Command+Line">&para;</a> <a href="#top">&uarr;</a></span></h3>
190
+
191
+ <p>For the most basic usage, simply 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&#39;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; do not change anything, except for adding entries for today.</p>
196
+ <p>This opens the current month&#39;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&#39;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">&para;</a> <a href="#top">&uarr;</a></span></h3>
178
199
 
179
- <h3 id="label-Example">Example<span><a href="#label-Example">&para;</a> <a href="#top">&uarr;</a></span></h3>
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">&para;</a> <a href="#top">&uarr;</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">&para;</a> <a href="#top">&uarr;</a></span></h4>
225
+
203
226
  <p>There are also flags that will print entries to the command line. There&#39;s a full list of features below, but as a quick example, you can copy today&#39;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">c</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">pbcopy</span>
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
- <h2 id="label-Customization+and+Runtime+Options">Customization and Runtime Options<span><a href="#label-Customization+and+Runtime+Options">&para;</a> <a href="#top">&uarr;</a></span></h2>
231
+ <p>If you wanted to add today&#39;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">&para;</a> <a href="#top">&uarr;</a></span></h4>
209
234
 
210
- <p>You can create a file in your home directory called <code>~/.standup_md.yml</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/standup_md.yml">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>
235
+ <pre>standup --no-edit --current &quot;Work on this thing&quot;,&quot;And another thing&quot;</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.">&para;</a> <a href="#top">&uarr;</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">&para;</a> <a href="#top">&uarr;</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&#39;ll notice, a lot of settings don&#39;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&#39;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&#39;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&#39;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
- <h3 id="label-Available+Config+File+Keys+and+Defaults">Available Config File Keys and Defaults<span><a href="#label-Available+Config+File+Keys+and+Defaults">&para;</a> <a href="#top">&uarr;</a></span></h3>
217
-
218
- <pre># Key: Default
219
- header_depth: 1
220
- header_date_format: &#39;%Y-%m-%d&#39;
221
- sub_header_depth: 2
222
- current_header: &#39;Current&#39;
223
- previous_header: &#39;Previous&#39;
224
- impediments_header: &#39;Impediments&#39;
225
- file_name_format: &#39;%Y_%m.md&#39;
226
- bullet_character: &#39;-&#39; # (dash)
227
- directory: &#39;~/.cache/standup_md&#39;
228
- editor: # $VISUAL, $EDITOR or vim, in that order
229
- current_entry_tasks:
230
- - &quot;&lt;!-- ADD TODAY&#39;S WORK HERE --&gt;&quot;
231
- previous_entry_tasks: # An array of the tasks from the previous entry
232
- impediments:
233
- - &#39;None&#39;
234
- notes: null # If not null, must be array
235
- sub_header_order:
236
- - &#39;previous&#39;
237
- - &#39;current&#39;
238
- - &#39;impediments&#39;
239
- - &#39;notes&#39;</pre>
240
-
241
- <h3 id="label-Executable+Flags">Executable Flags<span><a href="#label-Executable+Flags">&para;</a> <a href="#top">&uarr;</a></span></h3>
242
-
243
- <pre>The Standup Doctor
244
- --current-entry-tasks=ARRAY List of current entry&#39;s tasks
245
- --previous-entry-tasks=ARRAY List of yesterday&#39;s tasks
246
- --impediments=ARRAY List of impediments for current entry
247
- --notes=ARRAY List of notes for current entry
248
- --sub-header-order=ARRAY The order of the sub-headers when writing the file
249
- --[no-]append-previous Append previous tasks? Default is true
250
- -f, --file-name-format=STRING Date-formattable string to use for standup file name
251
- -e, --editor=EDITOR Editor to use for opening standup files
252
- -d, --directory=DIRECTORY The directories where standup files are located
253
- --[no-]write Write current entry if it doesn&#39;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&#39;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">&para;</a> <a href="#top">&uarr;</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">&#39;%Y-%m-%d&#39;</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">&#39;Current&#39;</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">&#39;Previous&#39;</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">&#39;Impediments&#39;</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">&#39;Notes&#39;</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">&#39;HOME&#39;</span>], <span class="ruby-string">&#39;.cache&#39;</span>, <span class="ruby-string">&#39;standup_md&#39;</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">&#39;-&#39;</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">&#39;%Y_%m.md&#39;</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">&quot;&lt;!-- ADD TODAY&#39;S WORK HERE --&gt;&quot;</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">&#39;None&#39;</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">&#39;vim&#39;</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">&#39;HOME&#39;</span>], <span class="ruby-string">&#39;.standuprc&#39;</span>))
286
+ <span class="ruby-keyword">end</span>
287
+ </pre>
261
288
 
262
- <p>If you wanted to add some tasks at runtime, and without opening the file in an editor, you could use the following:</p>
289
+ <h4 id="label-Executable+Flags">Executable Flags<span><a href="#label-Executable+Flags">&para;</a> <a href="#top">&uarr;</a></span></h4>
290
+
291
+ <pre>--current ARRAY List of current entry&#39;s tasks
292
+ --previous ARRAY List of precious entry&#39;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&#39;t exist. Default is true
300
+ -a --[no-]auto-fill-previous Auto-generate &#39;previous&#39; 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
- <pre>standup --no-edit --current-entry-tasks=&quot;Work on this thing&quot;,&quot;And another thing!&quot;</pre>
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&#39;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
- <h3 id="label-Using+Existing+Standup+Files">Using Existing Standup Files<span><a href="#label-Using+Existing+Standup+Files">&para;</a> <a href="#top">&uarr;</a></span></h3>
309
+ <h4 id="label-Using+Existing+Standup+Files">Using Existing Standup Files<span><a href="#label-Using+Existing+Standup+Files">&para;</a> <a href="#top">&uarr;</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>~/.standup_md.yml</code> before execution, or else the parser will error.</p>
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,50 @@ sub_header_order:
291
334
  ### Notes
292
335
  * notes, if any are present</pre>
293
336
 
294
- <p>Your <code>~/.standup_md.yml</code> should contain:</p>
295
-
296
- <pre>header_depth: 2
297
- sub_header_depth: 3
298
- current_header: Today
299
- previous_header: Yesterday
300
- impediments_header: Hold-ups
301
- bullet_character: &#39;*&#39;
302
- header_date_format: &#39;%m/%d/%Y&#39;
303
- sub_header_order:
304
- - current
305
- - previous
306
- - impediments
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-string">&#39;Today&#39;</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">&#39;Yesterday&#39;</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">&#39;Hold-ups&#39;</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">&#39;*&#39;</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">&#39;%m/%d/%Y&#39;</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">&para;</a> <a href="#top">&uarr;</a></span></h2>
310
352
 
311
- <p>Below are some quick examples, but the API is fully documented in the <a href="https://evanthegrayt.github.io/standup_md/doc/index.html">documentation</a>.</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>
312
354
 
313
- <p>This was mainly written as a command line utility, but I made the API available for scripting. There are attribute accessors for most of the settings in the <a href="#customization-and-runtime-options">customization table</a> above. A quick example of how to write a new entry via code could look like the following:</p>
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">&para;</a> <a href="#top">&uarr;</a></span></h3>
314
358
 
315
359
  <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;standup_md&#39;</span>
316
360
 
317
- <span class="ruby-identifier">standup</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
318
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">&#39;Today&#39;</span>,
319
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">current_entry_tasks</span> = [<span class="ruby-string">&#39;Thing to do today&#39;</span>, <span class="ruby-string">&#39;Another thing to do today&#39;</span>],
320
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">impediments</span> = [<span class="ruby-string">&#39;Not enough time in the day&#39;</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">&#39;Today&#39;</span>,
321
363
  <span class="ruby-keyword">end</span>
322
364
 
323
- <span class="ruby-identifier">standup</span>.<span class="ruby-identifier">write</span>
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">&#39;Stuff I will do today&#39;</span>] }
367
+ <span class="ruby-identifier">file</span>.<span class="ruby-identifier">entries</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">entry</span>
368
+ <span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>
324
369
  </pre>
325
370
 
326
- <p>Note: <code>StandupMD.load { ... }</code> just is a quick way to call <code>StandupMD.new { ... }.load</code></p>
327
-
328
- <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>
329
372
 
330
373
  <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;standup_md&#39;</span>
331
- <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;json&#39;</span>
332
374
 
333
- <span class="ruby-identifier">standup</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>
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">&#39;Today&#39;</span>,
377
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">current</span> = [<span class="ruby-string">&#39;Stuff I will do today&#39;</span>]
378
+ <span class="ruby-keyword">end</span>
334
379
 
335
- <span class="ruby-identifier">standup_json</span> = <span class="ruby-identifier">standup</span>.<span class="ruby-identifier">all_entries</span>.<span class="ruby-identifier">to_json</span>
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>
336
381
  </pre>
337
382
 
338
383
  <h2 id="label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features<span><a href="#label-Reporting+Bugs+and+Requesting+Features">&para;</a> <a href="#top">&uarr;</a></span></h2>