standup_md 0.1.3 → 0.3.2

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