standup_md 0.1.2 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +7 -1
- data/README.md +183 -97
- data/Rakefile +11 -28
- data/bin/standup +1 -1
- data/doc/README_md.html +185 -78
- data/doc/StandupMD.html +83 -1244
- data/doc/StandupMD/Cli.html +124 -474
- data/doc/StandupMD/Cli/Helpers.html +167 -0
- data/doc/StandupMD/Config.html +230 -0
- data/doc/StandupMD/Config/Cli.html +355 -0
- data/doc/StandupMD/Config/Entry.html +284 -0
- data/doc/StandupMD/Config/EntryList.html +197 -0
- data/doc/StandupMD/Config/File.html +609 -0
- data/doc/StandupMD/Entry.html +478 -0
- data/doc/StandupMD/EntryList.html +759 -0
- data/doc/StandupMD/File.html +575 -0
- data/doc/created.rid +15 -8
- data/doc/index.html +191 -79
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +150 -265
- data/lib/standup_md.rb +29 -508
- data/lib/standup_md/cli.rb +63 -242
- data/lib/standup_md/cli/helpers.rb +165 -0
- data/lib/standup_md/config.rb +45 -0
- data/lib/standup_md/config/cli.rb +106 -0
- data/lib/standup_md/config/entry.rb +61 -0
- data/lib/standup_md/config/entry_list.rb +26 -0
- data/lib/standup_md/config/file.rb +199 -0
- data/lib/standup_md/entry.rb +121 -0
- data/lib/standup_md/entry_list.rb +166 -0
- data/lib/standup_md/file.rb +173 -0
- data/lib/standup_md/file/helpers.rb +62 -0
- data/lib/standup_md/version.rb +5 -3
- data/standup_md.gemspec +1 -0
- metadata +35 -5
- data/doc/TestCli.html +0 -792
- data/doc/TestHelper.html +0 -282
- data/doc/TestStandupMD.html +0 -1354
data/bin/standup
CHANGED
data/doc/README_md.html
CHANGED
@@ -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-
|
70
|
+
<li><a href="#label-Command+Line">Command Line</a>
|
71
|
+
<li><a href="#label-CLI+Examples">CLI Examples</a>
|
72
|
+
<li><a href="#label-Adding+an+entry+for+today+via+editor">Adding an entry for today via editor</a>
|
73
|
+
<li><a href="#label-Copy+the+entry+for+today+to+clipboard">Copy the entry for today to clipboard</a>
|
74
|
+
<li><a href="#label-Add+entry+to+file+without+opening+it">Add entry to file without opening it</a>
|
75
|
+
<li><a href="#label-Find+an+entry+by+date+and+print+it.">Find an entry by date and print it.</a>
|
71
76
|
<li><a href="#label-Customization+and+Runtime+Options">Customization and Runtime Options</a>
|
72
|
-
<li><a href="#label-Available+Config+File+
|
77
|
+
<li><a href="#label-Available+Config+File+Options+and+Defaults">Available Config File Options and Defaults</a>
|
73
78
|
<li><a href="#label-Executable+Flags">Executable Flags</a>
|
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">¶</a> <a href="#top">↑</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="#
|
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">¶</a> <a href="#top">↑</a></span></h2>
|
133
158
|
|
134
|
-
<p>I've now been at two separate companies where we post our daily standups in a chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day became tedious, as I'd have to look up what I did the day before, copy and paste yesterday's work into a new entry, and add today's tasks. This gem automates most of this process, along with providing means of opening the file in your editor, and displaying entries from the command line.</p>
|
159
|
+
<p>I've now been at two separate companies where we post our daily standups in a chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day became tedious, as I'd have to look up what I did the day before, copy and paste yesterday's work into a new entry, and add today's tasks. This gem automates most of this process, along with providing means of opening the file in your editor, and finding and displaying entries from the command line.</p>
|
135
160
|
|
136
|
-
<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't exist, one will be generated, and if a previous entry exists, it will be added to today's entry as your previous day's work. See <a href="#example">example</a>. There's also an API if you'd like to use this in your own code somehow.</p>
|
161
|
+
<p>In a nutshell, calling <code>standup</code> from the command line will open a standup file for the current month in your preferred editor. If an entry for today is already present, no text will be generated. If an entry for today doesn't exist, one will be generated with your preferred values. When generating, if a previous entry exists, it will be added to today's entry as your previous day's work. See <a href="#example">example</a>. There's also a very robust API if you'd like to use this in your own code somehow.</p>
|
139
162
|
|
140
163
|
<h2 id="label-Installation">Installation<span><a href="#label-Installation">¶</a> <a href="#top">↑</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>
|
172
|
+
<p>To include in your project, add the following to your <code>Gemfile</code>.</p>
|
173
|
+
|
174
|
+
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">'standup_md'</span>
|
175
|
+
</pre>
|
150
176
|
|
151
177
|
<h3 id="label-Manual+Installation">Manual Installation<span><a href="#label-Manual+Installation">¶</a> <a href="#top">↑</a></span></h3>
|
152
178
|
|
153
|
-
<p>From your terminal, clone the repository where you want it
|
179
|
+
<p>From your terminal, clone the repository where you want it, and use <code>rake</code> to install the gem.</p>
|
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">¶</a> <a href="#top">↑</a></span></h2>
|
166
188
|
|
167
|
-
<
|
189
|
+
<h3 id="label-Command+Line">Command Line<span><a href="#label-Command+Line">¶</a> <a href="#top">↑</a></span></h3>
|
190
|
+
|
191
|
+
<p>For the most basic usage, simplyt call the executable.</p>
|
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's standup file. If an entry already exists for today, nothing is added. If no entry exists for today, the previous “Current” is placed in the “Previous” section of a new entry. The format of this file is very important;
|
196
|
+
<p>This opens the current month's standup file. If an entry already exists for today, nothing is added. If no entry exists for today, the previous “Current” is placed in the “Previous” section of a new entry. The format of this file is very important; you may add new entries, but don't change any of the headers. Doing so will cause the parser to break. If you want to customize the headers, you can do so in the <a href="#available-config-file-options-and-defaults">configuration file</a>.</p>
|
173
197
|
|
174
|
-
<h3 id="label-
|
198
|
+
<h3 id="label-CLI+Examples">CLI Examples<span><a href="#label-CLI+Examples">¶</a> <a href="#top">↑</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">¶</a> <a href="#top">↑</a></span></h4>
|
175
201
|
|
176
202
|
<p>For example, if the standup entry from yesterday reads as follows:</p>
|
177
203
|
|
@@ -184,95 +210,176 @@ ln -s $PWD/bin/standup /usr/local/bin/standup
|
|
184
210
|
## Impediments
|
185
211
|
- None</pre>
|
186
212
|
|
187
|
-
<p>The following scaffolding will be added for current entry at the top of the file
|
213
|
+
<p>The following scaffolding will be added for current entry at the top of the file:</p>
|
214
|
+
|
215
|
+
<pre># 2020-04-14
|
216
|
+
## Previous
|
217
|
+
- Write new feature for `standup_md`
|
218
|
+
- Fix bug in `standup_md`
|
219
|
+
## Current
|
220
|
+
- <!-- ADD TODAY'S WORK HERE -->
|
221
|
+
## Impediments
|
222
|
+
- None</pre>
|
223
|
+
|
224
|
+
<h4 id="label-Copy+the+entry+for+today+to+clipboard">Copy the entry for today to clipboard<span><a href="#label-Copy+the+entry+for+today+to+clipboard">¶</a> <a href="#top">↑</a></span></h4>
|
188
225
|
|
189
226
|
<p>There are also flags that will print entries to the command line. There's a full list of features below, but as a quick example, you can copy today's entry to your clipboard without even opening your editor.</p>
|
190
227
|
|
191
|
-
<pre class="ruby"><span class="ruby-identifier">standup</span> <span class="ruby-operator">-</span><span class="ruby-identifier">
|
228
|
+
<pre class="ruby"><span class="ruby-identifier">standup</span> <span class="ruby-operator">-</span><span class="ruby-identifier">p</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">pbcopy</span>
|
192
229
|
</pre>
|
193
230
|
|
194
|
-
<
|
231
|
+
<p>If you wanted to add today's entry without opening your editor, and print the result to the command line, you could use the following.</p>
|
232
|
+
|
233
|
+
<h4 id="label-Add+entry+to+file+without+opening+it">Add entry to file without opening it<span><a href="#label-Add+entry+to+file+without+opening+it">¶</a> <a href="#top">↑</a></span></h4>
|
234
|
+
|
235
|
+
<pre>standup --no-edit --current "Work on this thing","And another thing" -p</pre>
|
236
|
+
|
237
|
+
<h4 id="label-Find+an+entry+by+date+and+print+it.">Find an entry by date and print it.<span><a href="#label-Find+an+entry+by+date+and+print+it.">¶</a> <a href="#top">↑</a></span></h4>
|
238
|
+
|
239
|
+
<p>If you wanted to find and print the entry for March 2nd, 2020, you could use the following.</p>
|
240
|
+
|
241
|
+
<pre>standup -p 2020-03-02</pre>
|
242
|
+
|
243
|
+
<h3 id="label-Customization+and+Runtime+Options">Customization and Runtime Options<span><a href="#label-Customization+and+Runtime+Options">¶</a> <a href="#top">↑</a></span></h3>
|
195
244
|
|
196
|
-
<p>You can create a file in your home directory called <code>~/.
|
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'll notice, a lot of settings don't have the ability to be changed at runtime when calling the executable. This is because the file structure is very important, and changing values that affect formatting will cause problems with the file parser. If you don't want to use a default, make the change in your config file before you start editing standups. There is an <a href="https://github.com/evanthegrayt/standup_md/issues/16">open issue</a> for handling this for the user, but they're not available yet.</p>
|
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'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
|
-
<
|
203
|
-
|
204
|
-
<pre
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
- '
|
223
|
-
-
|
224
|
-
-
|
225
|
-
-
|
226
|
-
|
227
|
-
<
|
228
|
-
|
229
|
-
<
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
251
|
+
<h4 id="label-Available+Config+File+Options+and+Defaults">Available Config File Options and Defaults<span><a href="#label-Available+Config+File+Options+and+Defaults">¶</a> <a href="#top">↑</a></span></h4>
|
252
|
+
|
253
|
+
<pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
254
|
+
<span class="ruby-comment"># Defaults for how the file is formatted.</span>
|
255
|
+
<span class="ruby-comment"># See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html</span>
|
256
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_date_format</span> = <span class="ruby-string">'%Y-%m-%d'</span>
|
257
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_depth</span> = <span class="ruby-value">1</span>
|
258
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_depth</span> = <span class="ruby-value">2</span>
|
259
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Current'</span>
|
260
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">previous_header</span> = <span class="ruby-string">'Previous'</span>
|
261
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">impediments_header</span> = <span class="ruby-string">'Impediments'</span>
|
262
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">notes_header</span> = <span class="ruby-string">'Notes'</span>
|
263
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_order</span> = <span class="ruby-node">%w[previous current impediments notes]</span>
|
264
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">directory</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">'HOME'</span>], <span class="ruby-string">'.cache'</span>, <span class="ruby-string">'standup_md'</span>)
|
265
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">'-'</span>
|
266
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">name_format</span> = <span class="ruby-string">'%Y_%m.md'</span>
|
267
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">create</span> = <span class="ruby-keyword">true</span>
|
268
|
+
|
269
|
+
<span class="ruby-comment"># Defaults for entries</span>
|
270
|
+
<span class="ruby-comment"># See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Entry.html</span>
|
271
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">current</span> = [<span class="ruby-string">"<!-- ADD TODAY'S WORK HERE -->"</span>]
|
272
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">previous</span> = []
|
273
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">impediments</span> = [<span class="ruby-string">'None'</span>]
|
274
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">notes</span> = []
|
275
|
+
|
276
|
+
<span class="ruby-comment"># Defaults for executable runtime behavior.</span>
|
277
|
+
<span class="ruby-comment"># See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html</span>
|
278
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">date</span> = <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>
|
279
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">editor</span> = <span class="ruby-string">'vim'</span> <span class="ruby-comment"># Checks $VISUAL and $EDITOR first, in that order</span>
|
280
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">verbose</span> = <span class="ruby-keyword">false</span>
|
281
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">edit</span> = <span class="ruby-keyword">true</span>
|
282
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">write</span> = <span class="ruby-keyword">true</span>
|
283
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">print</span> = <span class="ruby-keyword">false</span>
|
284
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">auto_fill_previous</span> = <span class="ruby-keyword">true</span>
|
285
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">preference_file</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">'HOME'</span>], <span class="ruby-string">'.standuprc'</span>))
|
286
|
+
<span class="ruby-keyword">end</span>
|
287
|
+
</pre>
|
288
|
+
|
289
|
+
<h4 id="label-Executable+Flags">Executable Flags<span><a href="#label-Executable+Flags">¶</a> <a href="#top">↑</a></span></h4>
|
290
|
+
|
291
|
+
<pre>--current ARRAY List of current entry's tasks
|
292
|
+
--previous ARRAY List of precious entry's tasks
|
293
|
+
--impediments ARRAY List of impediments for current entry
|
294
|
+
--notes ARRAY List of notes for current entry
|
295
|
+
--sub-header-order ARRAY The order of the sub-headers when writing the file
|
296
|
+
-f, --file-name-format STRING Date-formattable string to use for standup file name
|
297
|
+
-E, --editor EDITOR Editor to use for opening standup files
|
298
|
+
-d, --directory DIRECTORY The directories where standup files are located
|
299
|
+
-w --[no-]write Write current entry if it doesn't exist. Default is true
|
300
|
+
-a --[no-]auto-fill-previous Auto-generate 'previous' tasks for new entries
|
301
|
+
-e --[no-]edit Open the file in the editor. Default is true
|
302
|
+
-v, --[no-]verbose Verbose output. Default is false.
|
303
|
+
-p, --print [DATE] Print current entry.
|
304
|
+
If DATE is passed, will print entry for DATE, if it exists.
|
305
|
+
DATE must be in the same format as file-name-format</pre>
|
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'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
|
-
<
|
309
|
+
<h4 id="label-Using+Existing+Standup+Files">Using Existing Standup Files<span><a href="#label-Using+Existing+Standup+Files">¶</a> <a href="#top">↑</a></span></h4>
|
249
310
|
|
250
|
-
<
|
311
|
+
<p>If you already have a directory of existing standup files, you can use them, but they must be in a format that the parser can understand. The default is:</p>
|
312
|
+
|
313
|
+
<pre># 2020-05-01
|
314
|
+
## Previous
|
315
|
+
- task
|
316
|
+
## Current
|
317
|
+
- task
|
318
|
+
## Impediments
|
319
|
+
- impediment
|
320
|
+
## Notes
|
321
|
+
- notes, if any are present</pre>
|
322
|
+
|
323
|
+
<p>The order, words, date format, and header level are all customizable, but the overall format must be the same. If customization is necessary, this must be done in <code>~/.standuprc</code> before execution, or else the parser will error.</p>
|
324
|
+
|
325
|
+
<p>For example, if you wanted the format to be as follows:</p>
|
326
|
+
|
327
|
+
<pre>## 05/01/2020
|
328
|
+
### Today
|
329
|
+
* task
|
330
|
+
### Yesterday
|
331
|
+
* task
|
332
|
+
### Hold-ups
|
333
|
+
* impediment
|
334
|
+
### Notes
|
335
|
+
* notes, if any are present</pre>
|
336
|
+
|
337
|
+
<p>Your <code>~/.standuprc</code> should contain:</p>
|
338
|
+
|
339
|
+
<pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
340
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_depth</span> <span class="ruby-value">2</span>
|
341
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_depth</span> <span class="ruby-value">3</span>
|
342
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> <span class="ruby-constant">Today</span>
|
343
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">previous_header</span> <span class="ruby-constant">Yesterday</span>
|
344
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">impediments_header</span> <span class="ruby-constant">Hold</span><span class="ruby-operator">-</span><span class="ruby-identifier">ups</span>
|
345
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">bullet_character</span> <span class="ruby-string">'*'</span>
|
346
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_date_format</span> <span class="ruby-string">'%m/%d/%Y'</span>
|
347
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_order</span> = <span class="ruby-node">%w[current previous impediments notes]</span>
|
348
|
+
<span class="ruby-keyword">end</span>
|
349
|
+
</pre>
|
251
350
|
|
252
351
|
<h2 id="label-API">API<span><a href="#label-API">¶</a> <a href="#top">↑</a></span></h2>
|
253
352
|
|
254
|
-
<p>
|
353
|
+
<p>The API is fully documented in the <a href="https://evanthegrayt.github.io/standup_md/doc/index.html">documentation</a>.</p>
|
255
354
|
|
256
|
-
<p>This was mainly written as a command line utility, but
|
355
|
+
<p>This was mainly written as a command line utility, but the API is ridiculously robust, and is available for use in your own projects. A quick example of how to write a new entry via code could look like the following:</p>
|
356
|
+
|
357
|
+
<h3 id="label-API+Examples">API Examples<span><a href="#label-API+Examples">¶</a> <a href="#top">↑</a></span></h3>
|
257
358
|
|
258
359
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
360
|
+
<span class="ruby-identifier">require</span> <span class="ruby-string">'date'</span>
|
259
361
|
|
260
|
-
<span class="ruby-identifier">
|
261
|
-
<span class="ruby-
|
262
|
-
|
263
|
-
<span class="ruby-value">impediments:</span> [<span class="ruby-string">'Not enough time in the day'</span>]
|
264
|
-
)
|
362
|
+
<span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
363
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span>,
|
364
|
+
<span class="ruby-keyword">end</span>
|
265
365
|
|
266
|
-
<span class="ruby-identifier">
|
366
|
+
<span class="ruby-identifier">file</span> = <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">find_by_date</span>(<span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>)
|
367
|
+
<span class="ruby-identifier">entry</span> = <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">Entry</span>.<span class="ruby-identifier">create</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">current</span> = [<span class="ruby-string">'Stuff I will do today'</span>] }
|
368
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">entries</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">entry</span>
|
369
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>
|
267
370
|
</pre>
|
268
371
|
|
269
|
-
<p>
|
372
|
+
<p>The above example was written as such to show how the different pieces of the API fit together. The code can actually be simplified to the following.</p>
|
270
373
|
|
271
374
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
272
|
-
<span class="ruby-identifier">require</span> <span class="ruby-string">'
|
375
|
+
<span class="ruby-identifier">require</span> <span class="ruby-string">'date'</span>
|
376
|
+
|
377
|
+
<span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
378
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span>,
|
379
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">entry</span>.<span class="ruby-identifier">current</span> = [<span class="ruby-string">'Stuff I will do today'</span>]
|
380
|
+
<span class="ruby-keyword">end</span>
|
273
381
|
|
274
|
-
<span class="ruby-
|
275
|
-
<span class="ruby-identifier">standup_entries_as_json</span> = <span class="ruby-identifier">standup</span>.<span class="ruby-identifier">all_entries</span>.<span class="ruby-identifier">to_json</span>
|
382
|
+
<span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">find_by_date</span>(<span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>).<span class="ruby-identifier">load</span>.<span class="ruby-identifier">write</span>
|
276
383
|
</pre>
|
277
384
|
|
278
385
|
<h2 id="label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features<span><a href="#label-Reporting+Bugs+and+Requesting+Features">¶</a> <a href="#top">↑</a></span></h2>
|
data/doc/StandupMD.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<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="
|
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'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">'*'</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">"#{k}="</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">↑ 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">"<!-- ADD TODAY'S WORK HERE -->"</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">'HOME'</span>], <span class="ruby-string">'.cache'</span>, <span class="ruby-string">'standup_md'</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'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'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'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">↑ 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's the first day of the month, <code>all_previous_entries</code> will be all of last month'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'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"># => {</span>
|
451
|
-
<span class="ruby-comment"># '2020-04-02' => {</span>
|
452
|
-
<span class="ruby-comment"># 'Previous' => ['Task from yesterday'],</span>
|
453
|
-
<span class="ruby-comment"># 'Current' => ["<!-- ADD TODAY'S WORK HERE -->"],</span>
|
454
|
-
<span class="ruby-comment"># 'Impediments' => ['None'],</span>
|
455
|
-
<span class="ruby-comment"># 'Notes' => [],</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('%Y_%m.md')+</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">'%y_%m.markdown'</span> }
|
478
|
-
<span class="ruby-identifier">su</span>.<span class="ruby-identifier">file</span>
|
479
|
-
<span class="ruby-comment"># => 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's file exists, but this month's doesn't or is empty, <a href="StandupMD.html#attribute-i-previous_file"><code>previous_file</code></a> should equal last month'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"># => []</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"># => ''</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"># => ['2020_03.md']</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"># => '2020_03.md'</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"># => ['2020_03.md', '2020_04.md']</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"># => '2020_04.md'</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">↑ 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">'%y_%m.markdown'</span>
|
701
|
-
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">'*'</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">'-'</span>
|
715
|
-
<span class="ruby-ivar">@current_entry_tasks</span> = [<span class="ruby-string">"<!-- ADD TODAY'S WORK HERE -->"</span>]
|
716
|
-
<span class="ruby-ivar">@impediments</span> = [<span class="ruby-string">'None'</span>]
|
717
|
-
<span class="ruby-ivar">@file_name_format</span> = <span class="ruby-string">'%Y_%m.md'</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">'HOME'</span>], <span class="ruby-string">'.cache'</span>, <span class="ruby-string">'standup_md'</span>)
|
719
|
-
<span class="ruby-ivar">@header_date_format</span> = <span class="ruby-string">'%Y-%m-%d'</span>
|
720
|
-
<span class="ruby-ivar">@current_header</span> = <span class="ruby-string">'Current'</span>
|
721
|
-
<span class="ruby-ivar">@previous_header</span> = <span class="ruby-string">'Previous'</span>
|
722
|
-
<span class="ruby-ivar">@impediments_header</span> = <span class="ruby-string">'Impediments'</span>
|
723
|
-
<span class="ruby-ivar">@notes_header</span> = <span class="ruby-string">'Notes'</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">↑ 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's entry already in the file?</p>
|
781
|
-
|
782
|
-
<p>@return [boolean] true if today'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"># => 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"># => 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">↑ 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">'Must be "-" or "*"'</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">'Must be an Array'</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't exist, it will be created. To reset instance variables after changing the directory, you'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">'Header depth out of bounds (1..5)'</span>
|
1019
|
-
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">sub_header_depth</span>
|
1020
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-string">'header_depth must be larger than sub_header_depth'</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
|
-
|
1035
|
-
|
1036
|
-
|
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">'Must be an Array'</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
|
-
|
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">'Must be an Array'</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
|
-
|
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">'Must be an Array'</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
|
-
|
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">'Sub-header depth out of bounds (2..6)'</span>
|
1175
|
-
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">header_depth</span>
|
1176
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-string">'sub_header_depth must be smaller than header_depth'</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
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
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">"Values must be #{order.join{', '}}"</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
|
-
|
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
|
-
|
1230
|
-
|
94
|
+
<p>The class for handing reading/writing of entries.</p>
|
95
|
+
|
1231
96
|
</section>
|
1232
97
|
|
1233
|
-
|
1234
|
-
|
1235
|
-
<header class="documentation-section-title">
|
1236
|
-
<h2>
|
1237
|
-
Misc
|
1238
|
-
</h2>
|
1239
|
-
<span class="section-click-top">
|
1240
|
-
<a href="#top">↑ top</a>
|
1241
|
-
</span>
|
1242
|
-
</header>
|
98
|
+
|
99
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
1243
100
|
|
1244
101
|
|
1245
102
|
|
@@ -1258,7 +115,7 @@
|
|
1258
115
|
<p>@example</p>
|
1259
116
|
|
1260
117
|
<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"># => '0.
|
118
|
+
<span class="ruby-comment"># => '0.3.0'</span>
|
1262
119
|
</pre>
|
1263
120
|
|
1264
121
|
|
@@ -1269,16 +126,16 @@
|
|
1269
126
|
|
1270
127
|
|
1271
128
|
|
1272
|
-
<section id="public-
|
129
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
1273
130
|
<header>
|
1274
|
-
<h3>Public
|
131
|
+
<h3>Public Class Methods</h3>
|
1275
132
|
</header>
|
1276
133
|
|
1277
134
|
|
1278
|
-
<div id="method-
|
135
|
+
<div id="method-c-config" class="method-detail ">
|
1279
136
|
|
1280
137
|
<div class="method-heading">
|
1281
|
-
<span class="method-name">
|
138
|
+
<span class="method-name">config</span><span
|
1282
139
|
class="method-args">()</span>
|
1283
140
|
|
1284
141
|
<span class="method-click-advice">click to toggle source</span>
|
@@ -1288,50 +145,32 @@
|
|
1288
145
|
|
1289
146
|
<div class="method-description">
|
1290
147
|
|
1291
|
-
<p>
|
148
|
+
<p>Shorthand for <code>StanupMD::Cli</code></p>
|
1292
149
|
|
1293
|
-
<p>@return [
|
150
|
+
<p>@return [StanupMD::Cli]</p>
|
1294
151
|
|
1295
152
|
|
1296
153
|
|
1297
154
|
|
1298
|
-
<div class="method-source-code" id="
|
1299
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1300
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
1301
|
-
<span class="ruby-
|
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">=></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>
|
155
|
+
<div class="method-source-code" id="config-source">
|
156
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 19</span>
|
157
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">config</span>
|
158
|
+
<span class="ruby-ivar">@config</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
|
1316
159
|
<span class="ruby-keyword">end</span></pre>
|
1317
160
|
</div>
|
1318
161
|
|
1319
162
|
</div>
|
1320
163
|
|
1321
164
|
|
1322
|
-
<div class="aliases">
|
1323
|
-
Also aliased as: <a href="StandupMD.html#method-i-reload">reload</a>
|
1324
|
-
</div>
|
1325
|
-
|
1326
165
|
|
1327
166
|
|
1328
167
|
</div>
|
1329
168
|
|
1330
169
|
|
1331
|
-
<div id="method-
|
170
|
+
<div id="method-c-config_file_loaded-3F" class="method-detail ">
|
1332
171
|
|
1333
172
|
<div class="method-heading">
|
1334
|
-
<span class="method-name">
|
173
|
+
<span class="method-name">config_file_loaded?</span><span
|
1335
174
|
class="method-args">()</span>
|
1336
175
|
|
1337
176
|
<span class="method-click-advice">click to toggle source</span>
|
@@ -1341,15 +180,17 @@
|
|
1341
180
|
|
1342
181
|
<div class="method-description">
|
1343
182
|
|
1344
|
-
<p>
|
183
|
+
<p>Has a config file been loaded?</p>
|
184
|
+
|
185
|
+
<p>@return [Boolean]</p>
|
1345
186
|
|
1346
187
|
|
1347
188
|
|
1348
189
|
|
1349
|
-
<div class="method-source-code" id="
|
1350
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1351
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
1352
|
-
<span class="ruby-
|
190
|
+
<div class="method-source-code" id="config_file_loaded-3F-source">
|
191
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 44</span>
|
192
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">config_file_loaded?</span>
|
193
|
+
<span class="ruby-ivar">@config_file_loaded</span>
|
1353
194
|
<span class="ruby-keyword">end</span></pre>
|
1354
195
|
</div>
|
1355
196
|
|
@@ -1361,41 +202,49 @@
|
|
1361
202
|
</div>
|
1362
203
|
|
1363
204
|
|
1364
|
-
<div id="method-
|
205
|
+
<div id="method-c-configure" class="method-detail ">
|
1365
206
|
|
1366
207
|
<div class="method-heading">
|
1367
|
-
<span class="method-name">
|
1368
|
-
class="method-args">()</span>
|
208
|
+
<span class="method-name">configure</span><span
|
209
|
+
class="method-args">() { |config| ... }</span>
|
210
|
+
|
211
|
+
<span class="method-click-advice">click to toggle source</span>
|
1369
212
|
|
1370
213
|
</div>
|
1371
214
|
|
1372
215
|
|
1373
216
|
<div class="method-description">
|
1374
217
|
|
1375
|
-
<p>
|
218
|
+
<p>Allows for configuration via a block. Useful when making config files.</p>
|
219
|
+
|
220
|
+
<p>@example</p>
|
1376
221
|
|
1377
|
-
<
|
222
|
+
<pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">editor</span> = <span class="ruby-string">'mate'</span> }
|
223
|
+
</pre>
|
1378
224
|
|
1379
225
|
|
1380
226
|
|
1381
227
|
|
228
|
+
<div class="method-source-code" id="configure-source">
|
229
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 36</span>
|
230
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">configure</span>
|
231
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">config</span>
|
232
|
+
<span class="ruby-keyword">end</span></pre>
|
233
|
+
</div>
|
234
|
+
|
1382
235
|
</div>
|
1383
236
|
|
1384
237
|
|
1385
238
|
|
1386
239
|
|
1387
|
-
<div class="aliases">
|
1388
|
-
Alias for: <a href="StandupMD.html#method-i-load">load</a>
|
1389
|
-
</div>
|
1390
|
-
|
1391
240
|
</div>
|
1392
241
|
|
1393
242
|
|
1394
|
-
<div id="method-
|
243
|
+
<div id="method-c-load_config_file" class="method-detail ">
|
1395
244
|
|
1396
245
|
<div class="method-heading">
|
1397
|
-
<span class="method-name">
|
1398
|
-
class="method-args">()</span>
|
246
|
+
<span class="method-name">load_config_file</span><span
|
247
|
+
class="method-args">(file)</span>
|
1399
248
|
|
1400
249
|
<span class="method-click-advice">click to toggle source</span>
|
1401
250
|
|
@@ -1404,17 +253,20 @@
|
|
1404
253
|
|
1405
254
|
<div class="method-description">
|
1406
255
|
|
1407
|
-
<p>
|
256
|
+
<p>Loads a config file.</p>
|
1408
257
|
|
1409
|
-
<p>@
|
258
|
+
<p>@param [String] file</p>
|
1410
259
|
|
1411
260
|
|
1412
261
|
|
1413
262
|
|
1414
|
-
<div class="method-source-code" id="
|
1415
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1416
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
1417
|
-
<span class="ruby-
|
263
|
+
<div class="method-source-code" id="load_config_file-source">
|
264
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 52</span>
|
265
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load_config_file</span>(<span class="ruby-identifier">file</span>)
|
266
|
+
<span class="ruby-identifier">file</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">file</span>)
|
267
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"File #{file} does not exist."</span> <span class="ruby-keyword">unless</span> <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">file</span>)
|
268
|
+
<span class="ruby-ivar">@config_file_loaded</span> = <span class="ruby-keyword">true</span>
|
269
|
+
<span class="ruby-identifier">load</span> <span class="ruby-identifier">file</span>
|
1418
270
|
<span class="ruby-keyword">end</span></pre>
|
1419
271
|
</div>
|
1420
272
|
|
@@ -1426,10 +278,10 @@
|
|
1426
278
|
</div>
|
1427
279
|
|
1428
280
|
|
1429
|
-
<div id="method-
|
281
|
+
<div id="method-c-reset_config" class="method-detail ">
|
1430
282
|
|
1431
283
|
<div class="method-heading">
|
1432
|
-
<span class="method-name">
|
284
|
+
<span class="method-name">reset_config</span><span
|
1433
285
|
class="method-args">()</span>
|
1434
286
|
|
1435
287
|
<span class="method-click-advice">click to toggle source</span>
|
@@ -1439,30 +291,17 @@
|
|
1439
291
|
|
1440
292
|
<div class="method-description">
|
1441
293
|
|
1442
|
-
<p>
|
294
|
+
<p>Reset all configuration values to their defaults.</p>
|
1443
295
|
|
1444
|
-
<p>@return [
|
296
|
+
<p>@return [StandupMD::Config]</p>
|
1445
297
|
|
1446
298
|
|
1447
299
|
|
1448
300
|
|
1449
|
-
<div class="method-source-code" id="
|
1450
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1451
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
1452
|
-
<span class="ruby-
|
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">'#'</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">header_depth</span> <span class="ruby-operator">+</span> <span class="ruby-string">' '</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">"#{value}_header"</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">'#'</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">sub_header_depth</span> <span class="ruby-operator">+</span> <span class="ruby-string">' '</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">' '</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>
|
301
|
+
<div class="method-source-code" id="reset_config-source">
|
302
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 27</span>
|
303
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">reset_config</span>
|
304
|
+
<span class="ruby-ivar">@config</span> = <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
|
1466
305
|
<span class="ruby-keyword">end</span></pre>
|
1467
306
|
</div>
|
1468
307
|
|