standup_md 0.1.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Gemfile.lock +9 -3
  4. data/README.md +183 -97
  5. data/Rakefile +11 -28
  6. data/bin/standup +1 -1
  7. data/doc/README_md.html +185 -78
  8. data/doc/StandupMD.html +102 -1227
  9. data/doc/StandupMD/Cli.html +124 -474
  10. data/doc/StandupMD/Cli/Helpers.html +167 -0
  11. data/doc/StandupMD/Config.html +230 -0
  12. data/doc/StandupMD/Config/Cli.html +355 -0
  13. data/doc/StandupMD/Config/Entry.html +284 -0
  14. data/doc/StandupMD/Config/EntryList.html +197 -0
  15. data/doc/StandupMD/Config/File.html +609 -0
  16. data/doc/StandupMD/Entry.html +478 -0
  17. data/doc/StandupMD/EntryList.html +759 -0
  18. data/doc/StandupMD/File.html +574 -0
  19. data/doc/created.rid +15 -8
  20. data/doc/index.html +192 -78
  21. data/doc/js/navigation.js.gz +0 -0
  22. data/doc/js/search_index.js +1 -1
  23. data/doc/js/search_index.js.gz +0 -0
  24. data/doc/js/searcher.js.gz +0 -0
  25. data/doc/table_of_contents.html +152 -247
  26. data/lib/standup_md.rb +29 -501
  27. data/lib/standup_md/cli.rb +63 -242
  28. data/lib/standup_md/cli/helpers.rb +165 -0
  29. data/lib/standup_md/config.rb +45 -0
  30. data/lib/standup_md/config/cli.rb +106 -0
  31. data/lib/standup_md/config/entry.rb +61 -0
  32. data/lib/standup_md/config/entry_list.rb +26 -0
  33. data/lib/standup_md/config/file.rb +199 -0
  34. data/lib/standup_md/entry.rb +121 -0
  35. data/lib/standup_md/entry_list.rb +166 -0
  36. data/lib/standup_md/file.rb +172 -0
  37. data/lib/standup_md/file/helpers.rb +62 -0
  38. data/lib/standup_md/version.rb +5 -3
  39. data/standup_md.gemspec +1 -0
  40. metadata +35 -4
  41. data/doc/TestHelper.html +0 -282
  42. data/doc/TestStandupMD.html +0 -1938
@@ -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,11 +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>
79
+ <li><a href="#label-Using+Existing+Standup+Files">Using Existing Standup Files</a>
74
80
  <li><a href="#label-API">API</a>
81
+ <li><a href="#label-API+Examples">API Examples</a>
75
82
  <li><a href="#label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features</a>
76
83
  <li><a href="#label-Self-Promotion">Self-Promotion</a>
77
84
  </ul>
@@ -96,6 +103,8 @@
96
103
 
97
104
  <h1 id="label-The+Standup+Doctor">The Standup Doctor<span><a href="#label-The+Standup+Doctor">&para;</a> <a href="#top">&uarr;</a></span></h1>
98
105
 
106
+ <p><a href="https://actions-badge.atrox.dev/evanthegrayt/standup_md/goto?ref=master"><img src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fevanthegrayt%2Fstandup_md%2Fbadge%3Fref%3Dmaster&style=flat"></a> <a href="https://badge.fury.io/rb/standup_md"><img src="https://badge.fury.io/rb/standup_md.svg"></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg"></a></p>
107
+
99
108
  <blockquote>
100
109
  <p>The cure for all your standup woes.</p>
101
110
  </blockquote>
@@ -116,13 +125,29 @@
116
125
  </li><li>
117
126
  <p><a href="#usage">Usage</a></p>
118
127
  </li><li>
119
- <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>
120
139
  </li><li>
121
140
  <p><a href="#customization-and-runtime-options">Customization and Runtime Options</a></p>
122
141
  </li><li>
142
+ <p><a href="#using-existing-standup-files">Using existing standup files</a></p>
143
+ </li></ul>
144
+ </li><li>
123
145
  <p><a href="#api">API</a></p>
146
+ <ul><li>
147
+ <p><a href="#api-examples">API Examples</a></p>
124
148
  </li><li>
125
149
  <p><a href="https://evanthegrayt.github.io/standup_md/doc/index.html">Documentation</a></p>
150
+ </li></ul>
126
151
  </li><li>
127
152
  <p><a href="#reporting-bugs-and-requesting-features">Reporting Bugs and Requesting Features</a></p>
128
153
  </li><li>
@@ -131,11 +156,9 @@
131
156
 
132
157
  <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
133
158
 
134
- <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>
135
160
 
136
- <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>
137
-
138
- <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>
139
162
 
140
163
  <h2 id="label-Installation">Installation<span><a href="#label-Installation">&para;</a> <a href="#top">&uarr;</a></span></h2>
141
164
 
@@ -146,32 +169,35 @@
146
169
  <pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-identifier">install</span> <span class="ruby-identifier">standup_md</span>
147
170
  </pre>
148
171
 
149
- <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>
150
176
 
151
177
  <h3 id="label-Manual+Installation">Manual Installation<span><a href="#label-Manual+Installation">&para;</a> <a href="#top">&uarr;</a></span></h3>
152
178
 
153
- <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>
154
180
 
155
181
  <pre>git clone https://github.com/evanthegrayt/standup_md.git
156
182
  cd standup_md
157
183
 
158
184
  # Use rake to build and install the gem.
159
- rake install
160
-
161
- # OR manually link the executable somewhere. If you use this method, you cannot
162
- # move the repository after you link it!
163
- ln -s $PWD/bin/standup /usr/local/bin/standup</pre>
185
+ rake install</pre>
164
186
 
165
187
  <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>
166
188
 
167
- <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, simplyt call the executable.</p>
168
192
 
169
193
  <pre class="ruby"><span class="ruby-identifier">standup</span>
170
194
  </pre>
171
195
 
172
- <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>
173
197
 
174
- <h3 id="label-Example">Example<span><a href="#label-Example">&para;</a> <a href="#top">&uarr;</a></span></h3>
198
+ <h3 id="label-CLI+Examples">CLI Examples<span><a href="#label-CLI+Examples">&para;</a> <a href="#top">&uarr;</a></span></h3>
199
+
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>
175
201
 
176
202
  <p>For example, if the standup entry from yesterday reads as follows:</p>
177
203
 
@@ -184,95 +210,176 @@ ln -s $PWD/bin/standup /usr/local/bin/standup
184
210
  ## Impediments
185
211
  - None</pre>
186
212
 
187
- <p>The following scaffolding will be added for current entry at the top of the file: <code>markdown # 2020-04-14 ## Previous - Write new feature for `standup_md` - Fix bug in `standup_md` ## Current - &lt;!-- ADD TODAY&#39;S WORK HERE --&gt; ## Impediments - None </code></p>
213
+ <p>The following scaffolding will be added for current entry at the top of the file:</p>
214
+
215
+ <pre># 2020-04-14
216
+ ## Previous
217
+ - Write new feature for `standup_md`
218
+ - Fix bug in `standup_md`
219
+ ## Current
220
+ - &lt;!-- ADD TODAY&#39;S WORK HERE --&gt;
221
+ ## Impediments
222
+ - None</pre>
223
+
224
+ <h4 id="label-Copy+the+entry+for+today+to+clipboard">Copy the entry for today to clipboard<span><a href="#label-Copy+the+entry+for+today+to+clipboard">&para;</a> <a href="#top">&uarr;</a></span></h4>
188
225
 
189
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>
190
227
 
191
- <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>
192
229
  </pre>
193
230
 
194
- <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>
234
+
235
+ <pre>standup --no-edit --current &quot;Work on this thing&quot;,&quot;And another thing&quot; -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.">&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>
195
244
 
196
- <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>
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>
197
246
 
198
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>
199
248
 
200
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>
201
250
 
202
- <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>
203
-
204
- <pre># Key: Default
205
- header_depth: 1
206
- header_date_format: &#39;%Y-%m-%d&#39;
207
- sub_header_depth: 2
208
- current_header: &#39;Current&#39;
209
- previous_header: &#39;Previous&#39;
210
- impediments_header: &#39;Impediments&#39;
211
- file_name_format: &#39;%Y_%m.md&#39;
212
- bullet_character: &#39;-&#39; # (dash)
213
- directory: &#39;~/.cache/standup_md&#39;
214
- editor: # $VISUAL, $EDITOR or vim, in that order
215
- current_entry_tasks:
216
- - &quot;&lt;!-- ADD TODAY&#39;S WORK HERE --&gt;&quot;
217
- previous_entry_tasks: # An array of the tasks from the previous entry
218
- impediments:
219
- - &#39;None&#39;
220
- notes: null # If not null, must be array
221
- sub_header_order:
222
- - &#39;previous&#39;
223
- - &#39;current&#39;
224
- - &#39;impediments&#39;
225
- - &#39;notes&#39;</pre>
226
-
227
- <h3 id="label-Executable+Flags">Executable Flags<span><a href="#label-Executable+Flags">&para;</a> <a href="#top">&uarr;</a></span></h3>
228
-
229
- <pre>The Standup Doctor
230
- --current-entry-tasks=ARRAY List of current entry&#39;s tasks
231
- --previous-entry-tasks=ARRAY List of yesterday&#39;s tasks
232
- --impediments=ARRAY List of impediments for current entry
233
- --notes=ARRAY List of notes for current entry
234
- --sub-header-order=ARRAY The order of the sub-headers when writing the file
235
- --[no-]append-previous Append previous tasks? Default is true
236
- -f, --file-name-format=STRING Date-formattable string to use for standup file name
237
- -e, --editor=EDITOR Editor to use for opening standup files
238
- -d, --directory=DIRECTORY The directories where standup files are located
239
- --[no-]write Write current entry if it doesn&#39;t exist. Default is true
240
- --[no-]edit Open the file in the editor. Default is true
241
- -j, --[no-]json Print output as formatted json. Default is false.
242
- -v, --[no-]verbose Verbose output. Default is false.
243
- -c, --current Print current entry. Disables editing
244
- -a, --all Print all previous entries. Disables editing</pre>
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>
288
+
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>
245
306
 
246
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>
247
308
 
248
- <p>If you wanted to add some tasks at runtime, and without opening the file in an editor, you could use the following:</p>
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>
249
310
 
250
- <pre>standup --no-edit --current-entry-tasks=&quot;Work on this thing&quot;,&quot;And another thing!&quot;</pre>
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>
312
+
313
+ <pre># 2020-05-01
314
+ ## Previous
315
+ - task
316
+ ## Current
317
+ - task
318
+ ## Impediments
319
+ - impediment
320
+ ## Notes
321
+ - notes, if any are present</pre>
322
+
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>
324
+
325
+ <p>For example, if you wanted the format to be as follows:</p>
326
+
327
+ <pre>## 05/01/2020
328
+ ### Today
329
+ * task
330
+ ### Yesterday
331
+ * task
332
+ ### Hold-ups
333
+ * impediment
334
+ ### Notes
335
+ * notes, if any are present</pre>
336
+
337
+ <p>Your <code>~/.standuprc</code> should contain:</p>
338
+
339
+ <pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
340
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_depth</span> <span class="ruby-value">2</span>
341
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_depth</span> <span class="ruby-value">3</span>
342
+ <span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> <span class="ruby-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">&#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>
251
350
 
252
351
  <h2 id="label-API">API<span><a href="#label-API">&para;</a> <a href="#top">&uarr;</a></span></h2>
253
352
 
254
- <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">documentation</a>.</p>
255
354
 
256
- <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. To view all available methods, read the comments in the <a href="lib/standup_md.rb">source</a>. A quick-and-dirty 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>
257
358
 
258
359
  <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;standup_md&#39;</span>
360
+ <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;date&#39;</span>
259
361
 
260
- <span class="ruby-identifier">standup</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>(
261
- <span class="ruby-value">current_header:</span> <span class="ruby-string">&#39;Today&#39;</span>,
262
- <span class="ruby-value">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>],
263
- <span class="ruby-value">impediments:</span> [<span class="ruby-string">&#39;Not enough time in the day&#39;</span>]
264
- )
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">&#39;Today&#39;</span>,
364
+ <span class="ruby-keyword">end</span>
265
365
 
266
- <span class="ruby-identifier">standup</span>.<span class="ruby-identifier">write</span>
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">&#39;Stuff I will do today&#39;</span>] }
368
+ <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>
369
+ <span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>
267
370
  </pre>
268
371
 
269
- <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>
270
373
 
271
374
  <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;standup_md&#39;</span>
272
- <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;json&#39;</span>
375
+ <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;date&#39;</span>
376
+
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">&#39;Today&#39;</span>,
379
+ <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>]
380
+ <span class="ruby-keyword">end</span>
273
381
 
274
- <span class="ruby-identifier">standup</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>
275
- <span class="ruby-identifier">standup_entries_as_json</span> = <span class="ruby-identifier">standup</span>.<span class="ruby-identifier">all_entries</span>.<span class="ruby-identifier">to_json</span>
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>
276
383
  </pre>
277
384
 
278
385
  <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>
@@ -4,7 +4,7 @@
4
4
  <head>
5
5
  <meta charset="UTF-8">
6
6
 
7
- <title>class StandupMD - RDoc Documentation</title>
7
+ <title>module StandupMD - RDoc Documentation</title>
8
8
 
9
9
  <script type="text/javascript">
10
10
  var rdoc_rel_prefix = "./";
@@ -23,7 +23,7 @@
23
23
 
24
24
 
25
25
 
26
- <body id="top" role="document" class="class">
26
+ <body id="top" role="document" class="module">
27
27
  <nav role="navigation">
28
28
  <div id="project-navigation">
29
29
  <div id="home-section" role="region" title="Quick navigation" class="nav-section">
@@ -58,1058 +58,85 @@
58
58
 
59
59
 
60
60
  <div id="class-metadata">
61
- <div id="sections-section" class="nav-section">
62
- <h3>Sections</h3>
63
-
64
- <ul class="link-list" role="directory">
65
-
66
- <li><a href="#5Buntitled-5D"></a></li>
67
-
68
- <li><a href="#Attributes+that+are+settable+by+the+user-2C+but+have+custom+setters.">Attributes that are settable by the user, but have custom setters.</a></li>
69
-
70
- <li><a href="#Attributes+that+aren-27t+settable+by+user-2C+but+are+gettable.">Attributes that aren&#39;t settable by user, but are gettable.</a></li>
71
-
72
- <li><a href="#Attributes+with+default+getters+and+setters.">Attributes with default getters and setters.</a></li>
73
-
74
- <li><a href="#Booleans">Booleans</a></li>
75
-
76
- <li><a href="#Custom+setters">Custom setters</a></li>
77
-
78
- <li><a href="#Misc">Misc</a></li>
79
-
80
- </ul>
81
- </div>
82
-
83
- <div id="parent-class-section" class="nav-section">
84
- <h3>Parent</h3>
85
-
86
-
87
- <p class="link">Object
88
-
89
- </div>
90
-
91
-
92
-
93
- <!-- Method Quickref -->
94
- <div id="method-list-section" class="nav-section">
95
- <h3>Methods</h3>
96
-
97
- <ul class="link-list" role="directory">
98
-
99
- <li ><a href="#method-c-load">::load</a>
100
-
101
- <li ><a href="#method-c-new">::new</a>
102
-
103
- <li ><a href="#method-i-bullet_character-3D">#bullet_character=</a>
104
-
105
- <li ><a href="#method-i-current_entry_tasks-3D">#current_entry_tasks=</a>
106
-
107
- <li ><a href="#method-i-directory-3D">#directory=</a>
108
-
109
- <li ><a href="#method-i-entry_previously_added-3F">#entry_previously_added?</a>
110
-
111
- <li ><a href="#method-i-file_written-3F">#file_written?</a>
112
-
113
- <li ><a href="#method-i-header_depth-3D">#header_depth=</a>
114
-
115
- <li ><a href="#method-i-impediments-3D">#impediments=</a>
116
-
117
- <li ><a href="#method-i-load">#load</a>
118
-
119
- <li ><a href="#method-i-notes-3D">#notes=</a>
120
-
121
- <li ><a href="#method-i-previous_entry_tasks-3D">#previous_entry_tasks=</a>
122
-
123
- <li ><a href="#method-i-reload">#reload</a>
124
-
125
- <li ><a href="#method-i-sub_header_depth-3D">#sub_header_depth=</a>
126
-
127
- <li ><a href="#method-i-sub_header_order">#sub_header_order</a>
128
-
129
- <li ><a href="#method-i-sub_header_order-3D">#sub_header_order=</a>
130
-
131
- <li ><a href="#method-i-write">#write</a>
132
-
133
- </ul>
134
- </div>
135
-
136
- </div>
137
- </nav>
138
-
139
- <main role="main" aria-labelledby="class-StandupMD">
140
- <h1 id="class-StandupMD" class="class">
141
- class StandupMD
142
- </h1>
143
-
144
- <section class="description">
145
-
146
- <p>The class for handing reading/writing of entries.</p>
147
-
148
- <p>@example</p>
149
-
150
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
151
- </pre>
152
-
153
- </section>
154
-
155
-
156
- <section id="5Buntitled-5D" class="documentation-section">
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
- <section id="public-class-5Buntitled-5D-method-details" class="method-section">
167
- <header>
168
- <h3>Public Class Methods</h3>
169
- </header>
170
-
171
-
172
- <div id="method-c-load" class="method-detail ">
173
-
174
- <div class="method-heading">
175
- <span class="method-name">load</span><span
176
- class="method-args">(attributes = {})</span>
177
-
178
- <span class="method-click-advice">click to toggle source</span>
179
-
180
- </div>
181
-
182
-
183
- <div class="method-description">
184
-
185
- <p>Convenience method for calling <code>new</code> + <code>load</code></p>
186
-
187
- <p>@param [Hash] attributes Attributes to set before loading.</p>
188
-
189
- <p>@example</p>
190
-
191
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>(<span class="ruby-value">bullet_character:</span> <span class="ruby-string">&#39;*&#39;</span>)
192
- </pre>
193
-
194
-
195
-
196
-
197
- <div class="method-source-code" id="load-source">
198
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 21</span>
199
- <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load</span>(<span class="ruby-identifier">attributes</span> = {})
200
- <span class="ruby-keyword">self</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
201
- <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
202
- <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">k</span>)
203
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{k}=&quot;</span>, <span class="ruby-identifier">v</span>)
204
- <span class="ruby-keyword">end</span>
205
- <span class="ruby-keyword">end</span>.<span class="ruby-identifier">load</span>
206
- <span class="ruby-keyword">end</span></pre>
207
- </div>
208
-
209
- </div>
210
-
211
-
212
-
213
-
214
- </div>
215
-
216
-
217
- </section>
218
-
219
- </section>
220
-
221
- <section id="Attributes+that+are+settable+by+the+user-2C+but+have+custom+setters." class="documentation-section">
222
-
223
- <header class="documentation-section-title">
224
- <h2>
225
- Attributes that are settable by the user, but have custom setters.
226
- </h2>
227
- <span class="section-click-top">
228
- <a href="#top">&uarr; top</a>
229
- </span>
230
- </header>
231
-
232
-
233
-
234
-
235
-
236
-
237
-
238
- <section class="attribute-method-details" class="method-section">
239
- <header>
240
- <h3>Attributes</h3>
241
- </header>
242
-
243
-
244
- <div id="attribute-i-bullet_character" class="method-detail">
245
- <div class="method-heading attribute-method-heading">
246
- <span class="method-name">bullet_character</span><span
247
- class="attribute-access-type">[R]</span>
248
- </div>
249
-
250
- <div class="method-description">
251
-
252
- <p>Character used as bullets for list entries.</p>
253
-
254
- <p>@return [String] either - (dash) or * (asterisk)</p>
255
-
256
- </div>
257
- </div>
258
-
259
- <div id="attribute-i-current_entry_tasks" class="method-detail">
260
- <div class="method-heading attribute-method-heading">
261
- <span class="method-name">current_entry_tasks</span><span
262
- class="attribute-access-type">[R]</span>
263
- </div>
264
-
265
- <div class="method-description">
266
-
267
- <p>Array of tasks for today. This is the work expected to be performed today. Default is an empty array, but when writing to file, the default is</p>
268
-
269
- <p>@return [Array]</p>
270
-
271
- <p>@default</p>
272
-
273
- <pre class="ruby">[<span class="ruby-string">&quot;&lt;!-- ADD TODAY&#39;S WORK HERE --&gt;&quot;</span>]
274
- </pre>
275
-
276
- </div>
277
- </div>
278
-
279
- <div id="attribute-i-directory" class="method-detail">
280
- <div class="method-heading attribute-method-heading">
281
- <span class="method-name">directory</span><span
282
- class="attribute-access-type">[R]</span>
283
- </div>
284
-
285
- <div class="method-description">
286
-
287
- <p>The directory where the markdown files are kept.</p>
288
-
289
- <p>@return [String]</p>
290
-
291
- <p>@default</p>
292
-
293
- <pre class="ruby"><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>)
294
- </pre>
295
-
296
- </div>
297
- </div>
298
-
299
- <div id="attribute-i-header_depth" class="method-detail">
300
- <div class="method-heading attribute-method-heading">
301
- <span class="method-name">header_depth</span><span
302
- class="attribute-access-type">[R]</span>
303
- </div>
304
-
305
- <div class="method-description">
306
-
307
- <p>Number of octothorps that should preface entry headers.</p>
308
-
309
- <p>@return [Integer] between 1 and 5</p>
310
-
311
- </div>
312
- </div>
313
-
314
- <div id="attribute-i-impediments" class="method-detail">
315
- <div class="method-heading attribute-method-heading">
316
- <span class="method-name">impediments</span><span
317
- class="attribute-access-type">[R]</span>
318
- </div>
319
-
320
- <div class="method-description">
321
-
322
- <p>Array of impediments for today&#39;s entry.</p>
323
-
324
- <p>@return [Array]</p>
325
-
326
- </div>
327
- </div>
328
-
329
- <div id="attribute-i-notes" class="method-detail">
330
- <div class="method-heading attribute-method-heading">
331
- <span class="method-name">notes</span><span
332
- class="attribute-access-type">[R]</span>
333
- </div>
334
-
335
- <div class="method-description">
336
-
337
- <p>Array of notes to add to today&#39;s entry.</p>
338
-
339
- <p>@return [Array]</p>
340
-
341
- </div>
342
- </div>
343
-
344
- <div id="attribute-i-previous_entry_tasks" class="method-detail">
345
- <div class="method-heading attribute-method-heading">
346
- <span class="method-name">previous_entry_tasks</span><span
347
- class="attribute-access-type">[R]</span>
348
- </div>
349
-
350
- <div class="method-description">
351
-
352
- <p>The tasks from the previous task&#39;s “Current” section.</p>
353
-
354
- <p>@return [Array]</p>
355
-
356
- </div>
357
- </div>
358
-
359
- <div id="attribute-i-sub_header_depth" class="method-detail">
360
- <div class="method-heading attribute-method-heading">
361
- <span class="method-name">sub_header_depth</span><span
362
- class="attribute-access-type">[R]</span>
363
- </div>
364
-
365
- <div class="method-description">
366
-
367
- <p>Number of octothorps that should preface sub-headers.</p>
368
-
369
- <p>@return [Integer] between 2 and 6</p>
370
-
371
- </div>
372
- </div>
373
-
374
- </section>
375
-
376
-
377
-
378
- </section>
379
-
380
- <section id="Attributes+that+aren-27t+settable+by+user-2C+but+are+gettable." class="documentation-section">
381
-
382
- <header class="documentation-section-title">
383
- <h2>
384
- Attributes that aren't settable by user, but are gettable.
385
- </h2>
386
- <span class="section-click-top">
387
- <a href="#top">&uarr; top</a>
388
- </span>
389
- </header>
390
-
391
-
392
-
393
-
394
-
395
-
396
-
397
- <section class="attribute-method-details" class="method-section">
398
- <header>
399
- <h3>Attributes</h3>
400
- </header>
401
-
402
-
403
- <div id="attribute-i-all_entries" class="method-detail">
404
- <div class="method-heading attribute-method-heading">
405
- <span class="method-name">all_entries</span><span
406
- class="attribute-access-type">[R]</span>
407
- </div>
408
-
409
- <div class="method-description">
410
-
411
- <p>Current entry plus all previous entries. This will be a hash in the same format at <code>current_entry</code> and <code>all_previous_entries</code>.</p>
412
-
413
- <p>@return [Hash]</p>
414
-
415
- </div>
416
- </div>
417
-
418
- <div id="attribute-i-all_previous_entries" class="method-detail">
419
- <div class="method-heading attribute-method-heading">
420
- <span class="method-name">all_previous_entries</span><span
421
- class="attribute-access-type">[R]</span>
422
- </div>
423
-
424
- <div class="method-description">
425
-
426
- <p>All previous entry for the same month as today. If it&#39;s the first day of the month, <code>all_previous_entries</code> will be all of last month&#39;s entries. They will be a hash in the same format as <code>current_entry</code>.</p>
427
-
428
- <p>@return [Hash]</p>
429
-
430
- </div>
431
- </div>
432
-
433
- <div id="attribute-i-current_entry" class="method-detail">
434
- <div class="method-heading attribute-method-heading">
435
- <span class="method-name">current_entry</span><span
436
- class="attribute-access-type">[R]</span>
437
- </div>
438
-
439
- <div class="method-description">
440
-
441
- <p>The entry for today&#39;s date as a hash. If <code>file</code> already has an entry for today, it will be read and used as <code>current_entry</code>. If there is no entry for today, one should be generated from scaffolding.</p>
442
-
443
- <p>@return [Hash]</p>
444
-
445
- <p>@example</p>
446
-
447
- <pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">current_entry</span>
448
- <span class="ruby-comment"># =&gt; {</span>
449
- <span class="ruby-comment"># &#39;2020-04-02&#39; =&gt; {</span>
450
- <span class="ruby-comment"># &#39;Previous&#39; =&gt; [&#39;Task from yesterday&#39;],</span>
451
- <span class="ruby-comment"># &#39;Current&#39; =&gt; [&quot;&lt;!-- ADD TODAY&#39;S WORK HERE --&gt;&quot;],</span>
452
- <span class="ruby-comment"># &#39;Impediments&#39; =&gt; [&#39;None&#39;],</span>
453
- <span class="ruby-comment"># &#39;Notes&#39; =&gt; [],</span>
454
- <span class="ruby-comment"># }</span>
455
- <span class="ruby-comment"># }</span>
456
- </pre>
457
-
458
- </div>
459
- </div>
460
-
461
- <div id="attribute-i-file" class="method-detail">
462
- <div class="method-heading attribute-method-heading">
463
- <span class="method-name">file</span><span
464
- class="attribute-access-type">[R]</span>
465
- </div>
466
-
467
- <div class="method-description">
468
-
469
- <p>The file name should equal <a href="StandupMD.html#attribute-i-file_name_format"><code>file_name_format</code></a> parsed by Date.strftime. The default is +Date.today.strftime(&#39;%Y_%m.md&#39;)+</p>
470
-
471
- <p>@return [String]</p>
472
-
473
- <p>@example</p>
474
-
475
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">file_name_format</span> = <span class="ruby-string">&#39;%y_%m.markdown&#39;</span> }
476
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file</span>
477
- <span class="ruby-comment"># =&gt; Users/johnsmith/.cache/standup_md/20_04.markdown</span>
478
- </pre>
479
-
480
- </div>
481
- </div>
482
-
483
- <div id="attribute-i-header" class="method-detail">
484
- <div class="method-heading attribute-method-heading">
485
- <span class="method-name">header</span><span
486
- class="attribute-access-type">[R]</span>
487
- </div>
488
-
489
- <div class="method-description">
490
-
491
- <p>The string that will be used for the entry headers.</p>
492
-
493
- <p>@return [String]</p>
494
-
495
- </div>
496
- </div>
497
-
498
- <div id="attribute-i-previous_file" class="method-detail">
499
- <div class="method-heading attribute-method-heading">
500
- <span class="method-name">previous_file</span><span
501
- class="attribute-access-type">[R]</span>
502
- </div>
503
-
504
- <div class="method-description">
505
-
506
- <p>The file that contains previous entries. When last month&#39;s file exists, but this month&#39;s doesn&#39;t or is empty, <a href="StandupMD.html#attribute-i-previous_file"><code>previous_file</code></a> should equal last month&#39;s file.</p>
507
-
508
- <p>@return [String]</p>
509
-
510
- <p>@example</p>
511
-
512
- <pre class="ruby"><span class="ruby-comment"># Assuming the current month is April, 2020</span>
513
-
514
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
515
- <span class="ruby-comment"># =&gt; []</span>
516
- <span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
517
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>
518
- <span class="ruby-comment"># =&gt; &#39;&#39;</span>
519
-
520
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
521
- <span class="ruby-comment"># =&gt; [&#39;2020_03.md&#39;]</span>
522
- <span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
523
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>
524
- <span class="ruby-comment"># =&gt; &#39;2020_03.md&#39;</span>
525
-
526
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
527
- <span class="ruby-comment"># =&gt; [&#39;2020_03.md&#39;, &#39;2020_04.md&#39;]</span>
528
- <span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
529
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>
530
- <span class="ruby-comment"># =&gt; &#39;2020_04.md&#39;</span>
531
- </pre>
532
-
533
- </div>
534
- </div>
535
-
536
- </section>
537
-
538
-
539
-
540
- </section>
541
-
542
- <section id="Attributes+with+default+getters+and+setters." class="documentation-section">
543
-
544
- <header class="documentation-section-title">
545
- <h2>
546
- Attributes with default getters and setters.
547
- </h2>
548
- <span class="section-click-top">
549
- <a href="#top">&uarr; top</a>
550
- </span>
551
- </header>
552
-
553
-
554
-
555
-
556
-
557
-
558
-
559
- <section class="attribute-method-details" class="method-section">
560
- <header>
561
- <h3>Attributes</h3>
562
- </header>
563
-
564
-
565
- <div id="attribute-i-current_header" class="method-detail">
566
- <div class="method-heading attribute-method-heading">
567
- <span class="method-name">current_header</span><span
568
- class="attribute-access-type">[RW]</span>
569
- </div>
570
-
571
- <div class="method-description">
572
-
573
- <p>The header to use for the <code>Current</code> section.</p>
574
-
575
- <p>@param [String] <a href="StandupMD.html#attribute-i-current_header"><code>current_header</code></a></p>
576
-
577
- <p>@return [String]</p>
578
-
579
- </div>
580
- </div>
581
-
582
- <div id="attribute-i-file_name_format" class="method-detail">
583
- <div class="method-heading attribute-method-heading">
584
- <span class="method-name">file_name_format</span><span
585
- class="attribute-access-type">[RW]</span>
586
- </div>
587
-
588
- <div class="method-description">
589
-
590
- <p>The format to use for file names. This should include a month (%m) and year (%y) so the file can rotate every month. This will prevent files from getting too large.</p>
591
-
592
- <p>@param [String] <a href="StandupMD.html#attribute-i-file_name_format"><code>file_name_format</code></a> Parsed by <code>strftime</code></p>
593
-
594
- <p>@return [String]</p>
595
-
596
- </div>
597
- </div>
598
-
599
- <div id="attribute-i-header_date_format" class="method-detail">
600
- <div class="method-heading attribute-method-heading">
601
- <span class="method-name">header_date_format</span><span
602
- class="attribute-access-type">[RW]</span>
603
- </div>
604
-
605
- <div class="method-description">
606
-
607
- <p>The date format to use for entry headers.</p>
608
-
609
- <p>@param [String] <a href="StandupMD.html#attribute-i-header_date_format"><code>header_date_format</code></a> Parsed by <code>strftime</code></p>
610
-
611
- <p>@return [String]</p>
612
-
613
- </div>
614
- </div>
615
-
616
- <div id="attribute-i-impediments_header" class="method-detail">
617
- <div class="method-heading attribute-method-heading">
618
- <span class="method-name">impediments_header</span><span
619
- class="attribute-access-type">[RW]</span>
620
- </div>
621
-
622
- <div class="method-description">
623
-
624
- <p>The header to use for the <code>Impediments</code> section.</p>
625
-
626
- <p>@param [String] <a href="StandupMD.html#attribute-i-impediments_header"><code>impediments_header</code></a></p>
627
-
628
- <p>@return [String]</p>
629
-
630
- </div>
631
- </div>
632
-
633
- <div id="attribute-i-notes_header" class="method-detail">
634
- <div class="method-heading attribute-method-heading">
635
- <span class="method-name">notes_header</span><span
636
- class="attribute-access-type">[RW]</span>
637
- </div>
638
-
639
- <div class="method-description">
640
-
641
- <p>The header to use for the <code>Notes</code> section.</p>
642
-
643
- <p>@param [String] <a href="StandupMD.html#attribute-i-notes_header"><code>notes_header</code></a></p>
644
-
645
- <p>@return [String]</p>
646
-
647
- </div>
648
- </div>
649
-
650
- <div id="attribute-i-previous_header" class="method-detail">
651
- <div class="method-heading attribute-method-heading">
652
- <span class="method-name">previous_header</span><span
653
- class="attribute-access-type">[RW]</span>
654
- </div>
655
-
656
- <div class="method-description">
657
-
658
- <p>The header to use for the <code>Previous</code> section.</p>
659
-
660
- <p>@param [String] <a href="StandupMD.html#attribute-i-previous_header"><code>previous_header</code></a></p>
661
-
662
- <p>@return [String]</p>
663
-
664
- </div>
665
- </div>
666
-
667
- </section>
668
-
669
-
670
-
671
- <section id="public-class-Attributes+with+default+getters+and+setters.-method-details" class="method-section">
672
- <header>
673
- <h3>Public Class Methods</h3>
674
- </header>
675
-
676
-
677
- <div id="method-c-new" class="method-detail ">
678
-
679
- <div class="method-heading">
680
- <span class="method-name">new</span><span
681
- class="method-args">() { |self| ... }</span>
682
-
683
- <span class="method-click-advice">click to toggle source</span>
684
-
685
- </div>
686
-
687
-
688
- <div class="method-description">
689
-
690
- <p>Constructor. Yields the instance so you can pass a block to access setters.</p>
691
-
692
- <p>@return [self]</p>
693
-
694
- <p>@example</p>
695
-
696
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
697
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">directory</span> = <span class="ruby-ivar">@workdir</span>
698
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">file_name_format</span> = <span class="ruby-string">&#39;%y_%m.markdown&#39;</span>
699
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">&#39;*&#39;</span>
700
- <span class="ruby-keyword">end</span>
701
- </pre>
702
-
703
-
704
-
705
-
706
- <div class="method-source-code" id="new-source">
707
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 233</span>
708
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
709
- <span class="ruby-ivar">@notes</span> = []
710
- <span class="ruby-ivar">@header_depth</span> = <span class="ruby-value">1</span>
711
- <span class="ruby-ivar">@sub_header_depth</span> = <span class="ruby-value">2</span>
712
- <span class="ruby-ivar">@bullet_character</span> = <span class="ruby-string">&#39;-&#39;</span>
713
- <span class="ruby-ivar">@current_entry_tasks</span> = [<span class="ruby-string">&quot;&lt;!-- ADD TODAY&#39;S WORK HERE --&gt;&quot;</span>]
714
- <span class="ruby-ivar">@impediments</span> = [<span class="ruby-string">&#39;None&#39;</span>]
715
- <span class="ruby-ivar">@file_name_format</span> = <span class="ruby-string">&#39;%Y_%m.md&#39;</span>
716
- <span class="ruby-ivar">@directory</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>)
717
- <span class="ruby-ivar">@header_date_format</span> = <span class="ruby-string">&#39;%Y-%m-%d&#39;</span>
718
- <span class="ruby-ivar">@current_header</span> = <span class="ruby-string">&#39;Current&#39;</span>
719
- <span class="ruby-ivar">@previous_header</span> = <span class="ruby-string">&#39;Previous&#39;</span>
720
- <span class="ruby-ivar">@impediments_header</span> = <span class="ruby-string">&#39;Impediments&#39;</span>
721
- <span class="ruby-ivar">@notes_header</span> = <span class="ruby-string">&#39;Notes&#39;</span>
722
- <span class="ruby-ivar">@sub_header_order</span> = <span class="ruby-node">%w[previous current impediments notes]</span>
723
-
724
- <span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
725
- <span class="ruby-keyword">end</span></pre>
726
- </div>
727
-
728
- </div>
729
-
730
-
731
-
732
-
733
- </div>
734
-
735
-
736
- </section>
737
-
738
- </section>
739
-
740
- <section id="Booleans" class="documentation-section">
741
-
742
- <header class="documentation-section-title">
743
- <h2>
744
- Booleans
745
- </h2>
746
- <span class="section-click-top">
747
- <a href="#top">&uarr; top</a>
748
- </span>
749
- </header>
750
-
751
-
752
-
753
-
754
-
755
-
756
-
757
-
758
-
759
- <section id="public-instance-Booleans-method-details" class="method-section">
760
- <header>
761
- <h3>Public Instance Methods</h3>
762
- </header>
763
-
764
-
765
- <div id="method-i-entry_previously_added-3F" class="method-detail ">
766
-
767
- <div class="method-heading">
768
- <span class="method-name">entry_previously_added?</span><span
769
- class="method-args">()</span>
770
-
771
- <span class="method-click-advice">click to toggle source</span>
772
-
773
- </div>
774
-
775
-
776
- <div class="method-description">
777
-
778
- <p>Was today&#39;s entry already in the file?</p>
779
-
780
- <p>@return [boolean] true if today&#39;s entry was already in the file</p>
781
-
782
-
783
-
784
-
785
- <div class="method-source-code" id="entry_previously_added-3F-source">
786
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 275</span>
787
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">entry_previously_added?</span>
788
- <span class="ruby-ivar">@entry_previously_added</span>
789
- <span class="ruby-keyword">end</span></pre>
790
- </div>
791
-
792
- </div>
793
-
794
-
795
-
796
-
797
- </div>
798
-
799
-
800
- <div id="method-i-file_written-3F" class="method-detail ">
801
-
802
- <div class="method-heading">
803
- <span class="method-name">file_written?</span><span
804
- class="method-args">()</span>
805
-
806
- <span class="method-click-advice">click to toggle source</span>
807
-
808
- </div>
809
-
810
-
811
- <div class="method-description">
812
-
813
- <p>Has the file been written since instantiated?</p>
814
-
815
- <p>@return [boolean]</p>
816
-
817
- <p>@example</p>
818
-
819
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
820
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_written?</span>
821
- <span class="ruby-comment"># =&gt; false</span>
822
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">write</span>
823
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_written?</span>
824
- <span class="ruby-comment"># =&gt; true</span>
825
- </pre>
826
-
827
-
828
-
829
-
830
- <div class="method-source-code" id="file_written-3F-source">
831
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 267</span>
832
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">file_written?</span>
833
- <span class="ruby-ivar">@file_written</span>
834
- <span class="ruby-keyword">end</span></pre>
835
- </div>
836
-
837
- </div>
838
-
839
-
840
-
841
-
842
- </div>
843
-
844
-
845
- </section>
846
-
847
- </section>
848
-
849
- <section id="Custom+setters" class="documentation-section">
850
-
851
- <header class="documentation-section-title">
852
- <h2>
853
- Custom setters
854
- </h2>
855
- <span class="section-click-top">
856
- <a href="#top">&uarr; top</a>
857
- </span>
858
- </header>
859
-
860
-
861
-
862
-
863
-
864
-
865
-
866
-
867
-
868
- <section id="public-instance-Custom+setters-method-details" class="method-section">
869
- <header>
870
- <h3>Public Instance Methods</h3>
871
- </header>
872
-
873
-
874
- <div id="method-i-bullet_character-3D" class="method-detail ">
875
-
876
- <div class="method-heading">
877
- <span class="method-name">bullet_character=</span><span
878
- class="method-args">(character)</span>
879
-
880
- <span class="method-click-advice">click to toggle source</span>
881
-
882
- </div>
883
-
884
-
885
- <div class="method-description">
886
-
887
- <p>Setter for bullet_character. Must be * (asterisk) or - (dash).</p>
888
-
889
- <p>@param [String] character</p>
890
-
891
- <p>@return [String]</p>
892
-
893
-
894
-
895
-
896
- <div class="method-source-code" id="bullet_character-3D-source">
897
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 332</span>
898
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bullet_character=</span>(<span class="ruby-identifier">character</span>)
899
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be &quot;-&quot; or &quot;*&quot;&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-node">%w[- *]</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">character</span>)
900
- <span class="ruby-ivar">@bullet_character</span> = <span class="ruby-identifier">character</span>
901
- <span class="ruby-keyword">end</span></pre>
902
- </div>
903
-
904
- </div>
905
-
906
-
907
-
908
-
909
- </div>
910
-
911
61
 
912
- <div id="method-i-current_entry_tasks-3D" class="method-detail ">
913
-
914
- <div class="method-heading">
915
- <span class="method-name">current_entry_tasks=</span><span
916
- class="method-args">(tasks)</span>
917
-
918
- <span class="method-click-advice">click to toggle source</span>
919
-
920
- </div>
921
-
922
-
923
- <div class="method-description">
924
-
925
- <p>Setter for current entry tasks.</p>
926
-
927
- <p>@param [Array] tasks</p>
928
-
929
- <p>@return [Array]</p>
930
-
931
-
932
-
933
-
934
- <div class="method-source-code" id="current_entry_tasks-3D-source">
935
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 310</span>
936
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_entry_tasks=</span>(<span class="ruby-identifier">tasks</span>)
937
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be an Array&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
938
- <span class="ruby-ivar">@current_entry_tasks</span> = <span class="ruby-identifier">tasks</span>
939
- <span class="ruby-keyword">end</span></pre>
940
- </div>
941
-
942
- </div>
943
-
944
-
945
-
946
-
947
- </div>
948
-
949
62
 
950
- <div id="method-i-directory-3D" class="method-detail ">
951
-
952
- <div class="method-heading">
953
- <span class="method-name">directory=</span><span
954
- class="method-args">(directory)</span>
955
-
956
- <span class="method-click-advice">click to toggle source</span>
957
-
958
- </div>
959
-
960
-
961
- <div class="method-description">
962
-
963
- <p>Setter for directory. Must be expanded in case the user uses `~` for home. If the directory doesn&#39;t exist, it will be created. To reset instance variables after changing the directory, you&#39;ll need to call load.</p>
964
-
965
- <p>@param [String] directory</p>
966
-
967
- <p>@return [String]</p>
968
-
969
-
970
-
971
-
972
- <div class="method-source-code" id="directory-3D-source">
973
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 345</span>
974
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">directory=</span>(<span class="ruby-identifier">directory</span>)
975
- <span class="ruby-comment"># TODO test this</span>
976
- <span class="ruby-identifier">directory</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">directory</span>)
977
- <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">directory</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">directory</span>)
978
- <span class="ruby-ivar">@directory</span> = <span class="ruby-identifier">directory</span>
979
- <span class="ruby-keyword">end</span></pre>
980
- </div>
981
-
982
- </div>
983
-
984
-
985
-
986
-
987
- </div>
63
+
64
+
65
+ <!-- Method Quickref -->
66
+ <div id="method-list-section" class="nav-section">
67
+ <h3>Methods</h3>
988
68
 
69
+ <ul class="link-list" role="directory">
989
70
 
990
- <div id="method-i-header_depth-3D" class="method-detail ">
991
-
992
- <div class="method-heading">
993
- <span class="method-name">header_depth=</span><span
994
- class="method-args">(depth)</span>
995
-
996
- <span class="method-click-advice">click to toggle source</span>
997
-
998
- </div>
999
-
71
+ <li ><a href="#method-c-config">::config</a>
72
+
73
+ <li ><a href="#method-c-config_file_loaded-3F">::config_file_loaded?</a>
74
+
75
+ <li ><a href="#method-c-configure">::configure</a>
76
+
77
+ <li ><a href="#method-c-load_config_file">::load_config_file</a>
78
+
79
+ <li ><a href="#method-c-reset_config">::reset_config</a>
80
+
81
+ </ul>
82
+ </div>
1000
83
 
1001
- <div class="method-description">
1002
-
1003
- <p>Number of octothorps (#) to use before the main header.</p>
84
+ </div>
85
+ </nav>
1004
86
 
1005
- <p>@param [Integer] depth</p>
87
+ <main role="main" aria-labelledby="module-StandupMD">
88
+ <h1 id="module-StandupMD" class="module">
89
+ module StandupMD
90
+ </h1>
1006
91
 
1007
- <p>@return [Integer]</p>
1008
-
1009
-
92
+ <section class="description">
93
+
94
+ <p>The class for handing reading/writing of entries.</p>
1010
95
 
1011
-
1012
- <div class="method-source-code" id="header_depth-3D-source">
1013
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 358</span>
1014
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">header_depth=</span>(<span class="ruby-identifier">depth</span>)
1015
- <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">depth</span>.<span class="ruby-identifier">between?</span>(<span class="ruby-value">1</span>, <span class="ruby-value">5</span>)
1016
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Header depth out of bounds (1..5)&#39;</span>
1017
- <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">sub_header_depth</span>
1018
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;header_depth must be larger than sub_header_depth&#39;</span>
1019
- <span class="ruby-keyword">end</span>
1020
- <span class="ruby-ivar">@header_depth</span> = <span class="ruby-identifier">depth</span>
1021
- <span class="ruby-keyword">end</span></pre>
1022
- </div>
1023
-
1024
- </div>
96
+ </section>
1025
97
 
1026
-
98
+
99
+ <section id="5Buntitled-5D" class="documentation-section">
100
+
1027
101
 
1028
-
1029
- </div>
102
+
1030
103
 
1031
104
 
1032
- <div id="method-i-impediments-3D" class="method-detail ">
1033
-
1034
- <div class="method-heading">
1035
- <span class="method-name">impediments=</span><span
1036
- class="method-args">(tasks)</span>
1037
-
1038
- <span class="method-click-advice">click to toggle source</span>
1039
-
1040
- </div>
105
+ <section class="constants-list">
106
+ <header>
107
+ <h3>Constants</h3>
108
+ </header>
109
+ <dl>
110
+
111
+ <dt id="VERSION">VERSION
1041
112
 
113
+ <dd><p>The gem verision</p>
1042
114
 
1043
- <div class="method-description">
1044
-
1045
- <p>Setter for impediments.</p>
1046
-
1047
- <p>@param [Array] tasks</p>
1048
-
1049
- <p>@return [Array]</p>
1050
-
1051
-
1052
-
1053
-
1054
- <div class="method-source-code" id="impediments-3D-source">
1055
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 321</span>
1056
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">impediments=</span>(<span class="ruby-identifier">tasks</span>)
1057
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be an Array&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
1058
- <span class="ruby-ivar">@impediments</span> = <span class="ruby-identifier">tasks</span>
1059
- <span class="ruby-keyword">end</span></pre>
1060
- </div>
1061
-
1062
- </div>
1063
-
1064
-
115
+ <p>@example</p>
1065
116
 
117
+ <pre class="ruby"><span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
118
+ <span class="ruby-comment"># =&gt; &#39;0.3.0&#39;</span>
119
+ </pre>
1066
120
 
1067
- </div>
1068
-
121
+
122
+ </dl>
123
+ </section>
1069
124
 
1070
- <div id="method-i-notes-3D" class="method-detail ">
1071
-
1072
- <div class="method-heading">
1073
- <span class="method-name">notes=</span><span
1074
- class="method-args">(tasks)</span>
1075
-
1076
- <span class="method-click-advice">click to toggle source</span>
1077
-
1078
- </div>
1079
-
1080
-
1081
- <div class="method-description">
1082
-
1083
- <p>Setter for notes.</p>
1084
-
1085
- <p>@param [Array] notes</p>
1086
-
1087
- <p>@return [Array]</p>
1088
-
1089
-
1090
125
 
1091
-
1092
- <div class="method-source-code" id="notes-3D-source">
1093
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 299</span>
1094
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">notes=</span>(<span class="ruby-identifier">tasks</span>)
1095
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be an Array&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
1096
- <span class="ruby-ivar">@notes</span> = <span class="ruby-identifier">tasks</span>
1097
- <span class="ruby-keyword">end</span></pre>
1098
- </div>
1099
-
1100
- </div>
1101
-
1102
-
126
+
1103
127
 
1104
-
1105
- </div>
128
+
129
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
130
+ <header>
131
+ <h3>Public Class Methods</h3>
132
+ </header>
1106
133
 
1107
134
 
1108
- <div id="method-i-previous_entry_tasks-3D" class="method-detail ">
135
+ <div id="method-c-config" class="method-detail ">
1109
136
 
1110
137
  <div class="method-heading">
1111
- <span class="method-name">previous_entry_tasks=</span><span
1112
- class="method-args">(tasks)</span>
138
+ <span class="method-name">config</span><span
139
+ class="method-args">()</span>
1113
140
 
1114
141
  <span class="method-click-advice">click to toggle source</span>
1115
142
 
@@ -1118,20 +145,17 @@
1118
145
 
1119
146
  <div class="method-description">
1120
147
 
1121
- <p>Setter for current entry tasks.</p>
148
+ <p>Shorthand for <code>StanupMD::Cli</code></p>
1122
149
 
1123
- <p>@param [Array] tasks</p>
1124
-
1125
- <p>@return [Array]</p>
150
+ <p>@return [StanupMD::Cli]</p>
1126
151
 
1127
152
 
1128
153
 
1129
154
 
1130
- <div class="method-source-code" id="previous_entry_tasks-3D-source">
1131
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 288</span>
1132
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">previous_entry_tasks=</span>(<span class="ruby-identifier">tasks</span>)
1133
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be an Array&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
1134
- <span class="ruby-ivar">@previous_entry_tasks</span> = <span class="ruby-identifier">tasks</span>
155
+ <div class="method-source-code" id="config-source">
156
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 19</span>
157
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">config</span>
158
+ <span class="ruby-ivar">@config</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
1135
159
  <span class="ruby-keyword">end</span></pre>
1136
160
  </div>
1137
161
 
@@ -1143,11 +167,11 @@
1143
167
  </div>
1144
168
 
1145
169
 
1146
- <div id="method-i-sub_header_depth-3D" class="method-detail ">
170
+ <div id="method-c-config_file_loaded-3F" class="method-detail ">
1147
171
 
1148
172
  <div class="method-heading">
1149
- <span class="method-name">sub_header_depth=</span><span
1150
- class="method-args">(depth)</span>
173
+ <span class="method-name">config_file_loaded?</span><span
174
+ class="method-args">()</span>
1151
175
 
1152
176
  <span class="method-click-advice">click to toggle source</span>
1153
177
 
@@ -1156,24 +180,17 @@
1156
180
 
1157
181
  <div class="method-description">
1158
182
 
1159
- <p>Number of octothorps (#) to use before sub headers (Current, Previous, etc).</p>
183
+ <p>Has a config file been loaded?</p>
1160
184
 
1161
- <p>@param [Integer] depth</p>
1162
-
1163
- <p>@return [Integer]</p>
185
+ <p>@return [Boolean]</p>
1164
186
 
1165
187
 
1166
188
 
1167
189
 
1168
- <div class="method-source-code" id="sub_header_depth-3D-source">
1169
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 373</span>
1170
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub_header_depth=</span>(<span class="ruby-identifier">depth</span>)
1171
- <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">depth</span>.<span class="ruby-identifier">between?</span>(<span class="ruby-value">2</span>, <span class="ruby-value">6</span>)
1172
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Sub-header depth out of bounds (2..6)&#39;</span>
1173
- <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">header_depth</span>
1174
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;sub_header_depth must be smaller than header_depth&#39;</span>
1175
- <span class="ruby-keyword">end</span>
1176
- <span class="ruby-ivar">@sub_header_depth</span> = <span class="ruby-identifier">depth</span>
190
+ <div class="method-source-code" id="config_file_loaded-3F-source">
191
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 44</span>
192
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">config_file_loaded?</span>
193
+ <span class="ruby-ivar">@config_file_loaded</span>
1177
194
  <span class="ruby-keyword">end</span></pre>
1178
195
  </div>
1179
196
 
@@ -1185,11 +202,11 @@
1185
202
  </div>
1186
203
 
1187
204
 
1188
- <div id="method-i-sub_header_order-3D" class="method-detail ">
205
+ <div id="method-c-configure" class="method-detail ">
1189
206
 
1190
207
  <div class="method-heading">
1191
- <span class="method-name">sub_header_order=</span><span
1192
- class="method-args">(array)</span>
208
+ <span class="method-name">configure</span><span
209
+ class="method-args">() { |config| ... }</span>
1193
210
 
1194
211
  <span class="method-click-advice">click to toggle source</span>
1195
212
 
@@ -1198,169 +215,36 @@
1198
215
 
1199
216
  <div class="method-description">
1200
217
 
1201
- <p>Preferred order for sub-headers.</p>
1202
-
1203
- <p>@param [Array] Values must be %w[previous current impediment notes]</p>
1204
-
1205
- <p>@return [Array]</p>
1206
-
1207
-
1208
-
1209
-
1210
- <div class="method-source-code" id="sub_header_order-3D-source">
1211
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 388</span>
1212
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub_header_order=</span>(<span class="ruby-identifier">array</span>)
1213
- <span class="ruby-identifier">order</span> = <span class="ruby-node">%w[previous current impediments notes]</span>
1214
- <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Values must be #{order.join{&#39;, &#39;}}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">order</span>.<span class="ruby-identifier">sort</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">array</span>.<span class="ruby-identifier">sort</span>
1215
- <span class="ruby-ivar">@sub_header_order</span> = <span class="ruby-identifier">array</span>
1216
- <span class="ruby-keyword">end</span></pre>
1217
- </div>
1218
-
1219
- </div>
1220
-
1221
-
1222
-
1223
-
1224
- </div>
1225
-
1226
-
1227
- </section>
1228
-
1229
- </section>
1230
-
1231
- <section id="Misc" class="documentation-section">
1232
-
1233
- <header class="documentation-section-title">
1234
- <h2>
1235
- Misc
1236
- </h2>
1237
- <span class="section-click-top">
1238
- <a href="#top">&uarr; top</a>
1239
- </span>
1240
- </header>
1241
-
1242
-
1243
-
1244
-
1245
-
1246
- <section class="constants-list">
1247
- <header>
1248
- <h3>Constants</h3>
1249
- </header>
1250
- <dl>
1251
-
1252
- <dt id="VERSION">VERSION
1253
-
1254
- <dd><p>The gem verision</p>
218
+ <p>Allows for configuration via a block. Useful when making config files.</p>
1255
219
 
1256
220
  <p>@example</p>
1257
221
 
1258
- <pre class="ruby"><span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
1259
- <span class="ruby-comment"># =&gt; &#39;0.1.0&#39;</span>
222
+ <pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">editor</span> = <span class="ruby-string">&#39;mate&#39;</span> }
1260
223
  </pre>
1261
-
1262
-
1263
- </dl>
1264
- </section>
1265
-
1266
-
1267
-
1268
-
1269
-
1270
- <section id="public-instance-Misc-method-details" class="method-section">
1271
- <header>
1272
- <h3>Public Instance Methods</h3>
1273
- </header>
1274
-
1275
-
1276
- <div id="method-i-load" class="method-detail ">
1277
-
1278
- <div class="method-heading">
1279
- <span class="method-name">load</span><span
1280
- class="method-args">()</span>
1281
-
1282
- <span class="method-click-advice">click to toggle source</span>
1283
-
1284
- </div>
1285
-
1286
-
1287
- <div class="method-description">
1288
-
1289
- <p>Sets internal instance variables. Called when first instantiated, or after directory is set.</p>
1290
-
1291
- <p>@return [self]</p>
1292
224
 
1293
225
 
1294
226
 
1295
227
 
1296
- <div class="method-source-code" id="load-source">
1297
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 430</span>
1298
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load</span>
1299
- <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">directory</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">directory</span>)
1300
-
1301
- <span class="ruby-ivar">@today</span> = <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>
1302
- <span class="ruby-ivar">@header</span> = <span class="ruby-identifier">today</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">header_date_format</span>)
1303
- <span class="ruby-ivar">@file_written</span> = <span class="ruby-keyword">false</span>
1304
- <span class="ruby-ivar">@file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">today</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">file_name_format</span>)))
1305
- <span class="ruby-ivar">@previous_file</span> = <span class="ruby-identifier">get_previous_file</span>
1306
- <span class="ruby-ivar">@all_previous_entries</span> = <span class="ruby-identifier">get_all_previous_entries</span>
1307
- <span class="ruby-ivar">@entry_previously_added</span> = <span class="ruby-identifier">all_previous_entries</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">header</span>)
1308
- <span class="ruby-ivar">@previous_entry_tasks</span> = <span class="ruby-identifier">previous_entry</span>[<span class="ruby-identifier">current_header</span>]
1309
- <span class="ruby-ivar">@current_entry</span> = <span class="ruby-ivar">@all_previous_entries</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">header</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">new_entry</span>
1310
- <span class="ruby-ivar">@all_entries</span> = {<span class="ruby-identifier">header</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">current_entry</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">all_previous_entries</span>)
1311
-
1312
- <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">touch</span>(<span class="ruby-identifier">file</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">file</span>)
1313
- <span class="ruby-keyword">self</span>
228
+ <div class="method-source-code" id="configure-source">
229
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 36</span>
230
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">configure</span>
231
+ <span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">config</span>
1314
232
  <span class="ruby-keyword">end</span></pre>
1315
233
  </div>
1316
234
 
1317
235
  </div>
1318
236
 
1319
237
 
1320
- <div class="aliases">
1321
- Also aliased as: <a href="StandupMD.html#method-i-reload">reload</a>
1322
- </div>
1323
-
1324
-
1325
-
1326
- </div>
1327
-
1328
-
1329
- <div id="method-i-reload" class="method-detail method-alias">
1330
-
1331
- <div class="method-heading">
1332
- <span class="method-name">reload</span><span
1333
- class="method-args">()</span>
1334
-
1335
- </div>
1336
-
1337
-
1338
- <div class="method-description">
1339
-
1340
- <p>Alias of <code>load</code></p>
1341
-
1342
- <p>@return [self]</p>
1343
-
1344
-
1345
-
1346
-
1347
- </div>
1348
-
1349
-
1350
238
 
1351
239
 
1352
- <div class="aliases">
1353
- Alias for: <a href="StandupMD.html#method-i-load">load</a>
1354
- </div>
1355
-
1356
240
  </div>
1357
241
 
1358
242
 
1359
- <div id="method-i-sub_header_order" class="method-detail ">
243
+ <div id="method-c-load_config_file" class="method-detail ">
1360
244
 
1361
245
  <div class="method-heading">
1362
- <span class="method-name">sub_header_order</span><span
1363
- class="method-args">()</span>
246
+ <span class="method-name">load_config_file</span><span
247
+ class="method-args">(file)</span>
1364
248
 
1365
249
  <span class="method-click-advice">click to toggle source</span>
1366
250
 
@@ -1369,17 +253,20 @@
1369
253
 
1370
254
  <div class="method-description">
1371
255
 
1372
- <p>Return a copy of the sub-header order so the user can&#39;t modify the array.</p>
256
+ <p>Loads a config file.</p>
1373
257
 
1374
- <p>@return [Array]</p>
258
+ <p>@param [String] file</p>
1375
259
 
1376
260
 
1377
261
 
1378
262
 
1379
- <div class="method-source-code" id="sub_header_order-source">
1380
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 401</span>
1381
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub_header_order</span>
1382
- <span class="ruby-ivar">@sub_header_order</span>.<span class="ruby-identifier">dup</span>
263
+ <div class="method-source-code" id="load_config_file-source">
264
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 52</span>
265
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load_config_file</span>(<span class="ruby-identifier">file</span>)
266
+ <span class="ruby-identifier">file</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">file</span>)
267
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;File #{file} does not exist.&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">file</span>)
268
+ <span class="ruby-ivar">@config_file_loaded</span> = <span class="ruby-keyword">true</span>
269
+ <span class="ruby-identifier">load</span> <span class="ruby-identifier">file</span>
1383
270
  <span class="ruby-keyword">end</span></pre>
1384
271
  </div>
1385
272
 
@@ -1391,10 +278,10 @@
1391
278
  </div>
1392
279
 
1393
280
 
1394
- <div id="method-i-write" class="method-detail ">
281
+ <div id="method-c-reset_config" class="method-detail ">
1395
282
 
1396
283
  <div class="method-heading">
1397
- <span class="method-name">write</span><span
284
+ <span class="method-name">reset_config</span><span
1398
285
  class="method-args">()</span>
1399
286
 
1400
287
  <span class="method-click-advice">click to toggle source</span>
@@ -1404,29 +291,17 @@
1404
291
 
1405
292
  <div class="method-description">
1406
293
 
1407
- <p>Writes a new entry to the file if the first entry in the file isn&#39;t today.</p>
294
+ <p>Reset all configuration values to their defaults.</p>
1408
295
 
1409
- <p>@return [Boolean]</p>
296
+ <p>@return [StandupMD::Config]</p>
1410
297
 
1411
298
 
1412
299
 
1413
300
 
1414
- <div class="method-source-code" id="write-source">
1415
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 409</span>
1416
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write</span>
1417
- <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>, <span class="ruby-string">&#39;w&#39;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
1418
- <span class="ruby-identifier">all_entries</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>, <span class="ruby-identifier">s_heads</span><span class="ruby-operator">|</span>
1419
- <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;#&#39;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">header_depth</span> <span class="ruby-operator">+</span> <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">head</span>
1420
- <span class="ruby-identifier">sub_header_order</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;#{value}_header&quot;</span> }.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sub_head</span><span class="ruby-operator">|</span>
1421
- <span class="ruby-identifier">sh</span> = <span class="ruby-identifier">send</span>(<span class="ruby-identifier">sub_head</span>).<span class="ruby-identifier">capitalize</span>
1422
- <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">s_heads</span>[<span class="ruby-identifier">sh</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">s_heads</span>[<span class="ruby-identifier">sh</span>].<span class="ruby-identifier">empty?</span>
1423
- <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;#&#39;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">sub_header_depth</span> <span class="ruby-operator">+</span> <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sh</span>
1424
- <span class="ruby-identifier">s_heads</span>[<span class="ruby-identifier">sh</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">task</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">bullet_character</span> <span class="ruby-operator">+</span> <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">task</span> }
1425
- <span class="ruby-keyword">end</span>
1426
- <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span>
1427
- <span class="ruby-keyword">end</span>
1428
- <span class="ruby-keyword">end</span>
1429
- <span class="ruby-ivar">@file_written</span> = <span class="ruby-keyword">true</span>
301
+ <div class="method-source-code" id="reset_config-source">
302
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 27</span>
303
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">reset_config</span>
304
+ <span class="ruby-ivar">@config</span> = <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
1430
305
  <span class="ruby-keyword">end</span></pre>
1431
306
  </div>
1432
307