standup_md 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +63 -9
- data/Rakefile +11 -28
- data/doc/README_md.html +55 -7
- data/doc/StandupMD.html +331 -266
- data/doc/StandupMD/Cli.html +27 -22
- data/doc/created.rid +5 -8
- data/doc/index.html +54 -13
- 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 +11 -275
- data/lib/standup_md.rb +71 -32
- data/lib/standup_md/cli.rb +10 -6
- data/lib/standup_md/version.rb +2 -2
- metadata +2 -5
- data/doc/TestCli.html +0 -792
- data/doc/TestHelper.html +0 -282
- data/doc/TestStandupMD.html +0 -1354
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9e0d3fe8970730c7b8b0762560546f3a7656db61d3c11ff5ac8523db1aaf7ea
|
4
|
+
data.tar.gz: 5532bc9cb33dbc14c9b6689ce50c0ad6c0e8edfa95d5092023f9745a93936057
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45fc54d5e6265b73ea39b0f0fa5e9431a721a1a8dbb6dae9999996388b950d3239ed65c8542b770a1bd4267fdd05620a97c7bbbf2e1ade05060d530415da9c31
|
7
|
+
data.tar.gz: c3dd89557155580a7c619bf2c65033b35da91094e63c5ab2502a58f537083593fd1111181ac897a2e739132ac68f9ed0bd4d737392b356d4caeb9cdab4962d37
|
data/README.md
CHANGED
@@ -16,6 +16,7 @@ View on: [Github](https://github.com/evanthegrayt/standup_md) |
|
|
16
16
|
- [Usage](#usage)
|
17
17
|
- [Example](#example)
|
18
18
|
- [Customization and Runtime Options](#customization-and-runtime-options)
|
19
|
+
- [Using existing standup files](#using-existing-standup-files)
|
19
20
|
- [API](#api)
|
20
21
|
- [Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html)
|
21
22
|
- [Reporting Bugs and Requesting Features](#reporting-bugs-and-requesting-features)
|
@@ -198,28 +199,80 @@ editor, you could use the following:
|
|
198
199
|
standup --no-edit --current-entry-tasks="Work on this thing","And another thing!"
|
199
200
|
```
|
200
201
|
|
202
|
+
### Using Existing Standup Files
|
203
|
+
If you already have a directory of existing standup files, you can use them, but
|
204
|
+
they must be in a format that the parser can understand. The default is:
|
205
|
+
|
206
|
+
```markdown
|
207
|
+
# 2020-05-01
|
208
|
+
## Previous
|
209
|
+
- task
|
210
|
+
## Current
|
211
|
+
- task
|
212
|
+
## Impediments
|
213
|
+
- impediment
|
214
|
+
## Notes
|
215
|
+
- notes, if any are present
|
216
|
+
```
|
217
|
+
|
218
|
+
The order, words, date format, and header level are all customizable, but the
|
219
|
+
overall format must be the same. If customization is necessary, this must be
|
220
|
+
done in `~/.standup_md.yml` before execution, or else the parser will error.
|
221
|
+
|
222
|
+
For example, if you wanted the format to be as follows:
|
223
|
+
|
224
|
+
```markdown
|
225
|
+
## 05/01/2020
|
226
|
+
### Today
|
227
|
+
- task
|
228
|
+
### Yesterday
|
229
|
+
- task
|
230
|
+
### Hold-ups
|
231
|
+
- impediment
|
232
|
+
### Notes
|
233
|
+
- notes, if any are present
|
234
|
+
```
|
235
|
+
|
236
|
+
Your `~/.standup_md.yml` should contain:
|
237
|
+
|
238
|
+
```yaml
|
239
|
+
sub_header_depth: 3
|
240
|
+
header_depth: 2
|
241
|
+
current_header: Today
|
242
|
+
previous_header: Yesterday
|
243
|
+
impediments_header: Hold-ups
|
244
|
+
header_date_format: '%m/%d/%Y'
|
245
|
+
sub_header_order:
|
246
|
+
- current
|
247
|
+
- previous
|
248
|
+
- impediments
|
249
|
+
- notes
|
250
|
+
|
251
|
+
```
|
252
|
+
|
201
253
|
## API
|
202
254
|
Below are some quick examples, but the API is fully documented in the
|
203
255
|
[documentation](https://evanthegrayt.github.io/standup_md/doc/index.html).
|
204
256
|
|
205
257
|
This was mainly written as a command line utility, but I made the API available
|
206
258
|
for scripting. There are attribute accessors for most of the settings in the
|
207
|
-
[customization table](#customization-and-runtime-options) above.
|
208
|
-
|
209
|
-
quick-and-dirty example of how to write a new entry via code could look like the
|
259
|
+
[customization table](#customization-and-runtime-options) above. A
|
260
|
+
quick example of how to write a new entry via code could look like the
|
210
261
|
following:
|
211
262
|
|
212
263
|
```ruby
|
213
264
|
require 'standup_md'
|
214
265
|
|
215
|
-
standup = StandupMD.load
|
216
|
-
current_header
|
217
|
-
current_entry_tasks
|
218
|
-
impediments
|
219
|
-
|
266
|
+
standup = StandupMD.load do |s|
|
267
|
+
s.current_header = 'Today',
|
268
|
+
s.current_entry_tasks = ['Thing to do today', 'Another thing to do today'],
|
269
|
+
s.impediments = ['Not enough time in the day']
|
270
|
+
end
|
220
271
|
|
221
272
|
standup.write
|
222
273
|
```
|
274
|
+
Note: `StandupMD::load() { ... }` just is a quick way to call `StandupMD::new
|
275
|
+
{ ... }.load`.
|
223
276
|
|
224
277
|
Entries are just hashes, so you can easily transform them to `json` objects.
|
225
278
|
|
@@ -228,7 +281,8 @@ require 'standup_md'
|
|
228
281
|
require 'json'
|
229
282
|
|
230
283
|
standup = StandupMD.load
|
231
|
-
|
284
|
+
|
285
|
+
standup_json = standup.all_entries.to_json
|
232
286
|
```
|
233
287
|
|
234
288
|
## Reporting Bugs and Requesting Features
|
data/Rakefile
CHANGED
@@ -1,36 +1,19 @@
|
|
1
1
|
require_relative 'lib/standup_md'
|
2
|
+
require 'bundler/gem_tasks'
|
2
3
|
require 'rdoc/task'
|
4
|
+
require 'rake/testtask'
|
5
|
+
|
6
|
+
Rake::TestTask.new do |t|
|
7
|
+
t.libs = ['lib']
|
8
|
+
t.warning = true
|
9
|
+
t.verbose = true
|
10
|
+
t.test_files = FileList['test/**/*_test.rb']
|
11
|
+
end
|
3
12
|
|
4
13
|
RDoc::Task.new do |rdoc|
|
5
|
-
rdoc.main =
|
14
|
+
rdoc.main = 'README.md'
|
6
15
|
rdoc.rdoc_dir = 'doc'
|
7
|
-
rdoc.rdoc_files.include(
|
16
|
+
rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')
|
8
17
|
end
|
9
18
|
|
10
19
|
task :default => :test
|
11
|
-
|
12
|
-
desc "Build the gem"
|
13
|
-
task :build do
|
14
|
-
system('gem build standup_md.gemspec')
|
15
|
-
end
|
16
|
-
|
17
|
-
desc "Build and install the gem"
|
18
|
-
task install: [:dependencies, :build] do
|
19
|
-
system("gem install standup_md-#{StandupMD::VERSION}.gem")
|
20
|
-
end
|
21
|
-
|
22
|
-
desc "Add dependencies"
|
23
|
-
task :dependencies do
|
24
|
-
system("gem install bundler")
|
25
|
-
system("bundle install")
|
26
|
-
end
|
27
|
-
|
28
|
-
desc "Uninstall the gem"
|
29
|
-
task :uninstall do
|
30
|
-
system('gem uninstall standup_md')
|
31
|
-
end
|
32
|
-
|
33
|
-
desc "Run test suite"
|
34
|
-
task :test do
|
35
|
-
Dir.glob(File.join(__dir__, 'test', '**', '*_test.rb')).each { |f| ruby f }
|
36
|
-
end
|
data/doc/README_md.html
CHANGED
@@ -71,6 +71,7 @@
|
|
71
71
|
<li><a href="#label-Customization+and+Runtime+Options">Customization and Runtime Options</a>
|
72
72
|
<li><a href="#label-Available+Config+File+Keys+and+Defaults">Available Config File Keys and Defaults</a>
|
73
73
|
<li><a href="#label-Executable+Flags">Executable Flags</a>
|
74
|
+
<li><a href="#label-Using+Existing+Standup+Files">Using Existing Standup Files</a>
|
74
75
|
<li><a href="#label-API">API</a>
|
75
76
|
<li><a href="#label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features</a>
|
76
77
|
<li><a href="#label-Self-Promotion">Self-Promotion</a>
|
@@ -120,6 +121,8 @@
|
|
120
121
|
</li><li>
|
121
122
|
<p><a href="#customization-and-runtime-options">Customization and Runtime Options</a></p>
|
122
123
|
</li><li>
|
124
|
+
<p><a href="#using-existing-standup-files">Using existing standup files</a></p>
|
125
|
+
</li><li>
|
123
126
|
<p><a href="#api">API</a></p>
|
124
127
|
</li><li>
|
125
128
|
<p><a href="https://evanthegrayt.github.io/standup_md/doc/index.html">Documentation</a></p>
|
@@ -249,30 +252,75 @@ sub_header_order:
|
|
249
252
|
|
250
253
|
<pre>standup --no-edit --current-entry-tasks="Work on this thing","And another thing!"</pre>
|
251
254
|
|
255
|
+
<h3 id="label-Using+Existing+Standup+Files">Using Existing Standup Files<span><a href="#label-Using+Existing+Standup+Files">¶</a> <a href="#top">↑</a></span></h3>
|
256
|
+
|
257
|
+
<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>
|
258
|
+
|
259
|
+
<pre># 2020-05-01
|
260
|
+
## Previous
|
261
|
+
- task
|
262
|
+
## Current
|
263
|
+
- task
|
264
|
+
## Impediments
|
265
|
+
- impediment
|
266
|
+
## Notes
|
267
|
+
- notes, if any are present</pre>
|
268
|
+
|
269
|
+
<p>The order, words, date format, and header level are all customizable, but the overall format must be the same. If customization is necessary, this must be done in <code>~/.standup_md.yml</code> before execution, or else the parser will error.</p>
|
270
|
+
|
271
|
+
<p>For example, if you wanted the format to be as follows:</p>
|
272
|
+
|
273
|
+
<pre>## 05/01/2020
|
274
|
+
### Today
|
275
|
+
- task
|
276
|
+
### Yesterday
|
277
|
+
- task
|
278
|
+
### Hold-ups
|
279
|
+
- impediment
|
280
|
+
### Notes
|
281
|
+
- notes, if any are present</pre>
|
282
|
+
|
283
|
+
<p>Your <code>~/.standup_md.yml</code> should contain:</p>
|
284
|
+
|
285
|
+
<pre>sub_header_depth: 3
|
286
|
+
header_depth: 2
|
287
|
+
current_header: Today
|
288
|
+
previous_header: Yesterday
|
289
|
+
impediments_header: Hold-ups
|
290
|
+
header_date_format: '%m/%d/%Y'
|
291
|
+
sub_header_order:
|
292
|
+
- current
|
293
|
+
- previous
|
294
|
+
- impediments
|
295
|
+
- notes</pre>
|
296
|
+
|
252
297
|
<h2 id="label-API">API<span><a href="#label-API">¶</a> <a href="#top">↑</a></span></h2>
|
253
298
|
|
254
299
|
<p>Below are some quick examples, but the API is fully documented in the <a href="https://evanthegrayt.github.io/standup_md/doc/index.html">documentation</a>.</p>
|
255
300
|
|
256
|
-
<p>This was mainly written as a command line utility, but I made the API available for scripting. There are attribute accessors for most of the settings in the <a href="#customization-and-runtime-options">customization table</a> above.
|
301
|
+
<p>This was mainly written as a command line utility, but I made the API available for scripting. There are attribute accessors for most of the settings in the <a href="#customization-and-runtime-options">customization table</a> above. A quick example of how to write a new entry via code could look like the following:</p>
|
257
302
|
|
258
303
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
259
304
|
|
260
|
-
<span class="ruby-identifier">standup</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>
|
261
|
-
<span class="ruby-
|
262
|
-
<span class="ruby-
|
263
|
-
<span class="ruby-
|
264
|
-
|
305
|
+
<span class="ruby-identifier">standup</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
306
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span>,
|
307
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">current_entry_tasks</span> = [<span class="ruby-string">'Thing to do today'</span>, <span class="ruby-string">'Another thing to do today'</span>],
|
308
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">impediments</span> = [<span class="ruby-string">'Not enough time in the day'</span>]
|
309
|
+
<span class="ruby-keyword">end</span>
|
265
310
|
|
266
311
|
<span class="ruby-identifier">standup</span>.<span class="ruby-identifier">write</span>
|
267
312
|
</pre>
|
268
313
|
|
314
|
+
<p>Note: <code>StandupMD::load() { ... }</code> just is a quick way to call <code>StandupMD::new { ... }.load</code>.</p>
|
315
|
+
|
269
316
|
<p>Entries are just hashes, so you can easily transform them to <code>json</code> objects.</p>
|
270
317
|
|
271
318
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
272
319
|
<span class="ruby-identifier">require</span> <span class="ruby-string">'json'</span>
|
273
320
|
|
274
321
|
<span class="ruby-identifier">standup</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>
|
275
|
-
|
322
|
+
|
323
|
+
<span class="ruby-identifier">standup_json</span> = <span class="ruby-identifier">standup</span>.<span class="ruby-identifier">all_entries</span>.<span class="ruby-identifier">to_json</span>
|
276
324
|
</pre>
|
277
325
|
|
278
326
|
<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
@@ -71,12 +71,6 @@
|
|
71
71
|
|
72
72
|
<li><a href="#Attributes+with+default+getters+and+setters.">Attributes with default getters and setters.</a></li>
|
73
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
74
|
</ul>
|
81
75
|
</div>
|
82
76
|
|
@@ -102,6 +96,10 @@
|
|
102
96
|
|
103
97
|
<li ><a href="#method-i-bullet_character-3D">#bullet_character=</a>
|
104
98
|
|
99
|
+
<li ><a href="#method-i-config_file-3D">#config_file=</a>
|
100
|
+
|
101
|
+
<li ><a href="#method-i-config_file_loaded-3F">#config_file_loaded?</a>
|
102
|
+
|
105
103
|
<li ><a href="#method-i-current_entry_tasks-3D">#current_entry_tasks=</a>
|
106
104
|
|
107
105
|
<li ><a href="#method-i-directory-3D">#directory=</a>
|
@@ -116,6 +114,8 @@
|
|
116
114
|
|
117
115
|
<li ><a href="#method-i-load">#load</a>
|
118
116
|
|
117
|
+
<li ><a href="#method-i-load_config_file">#load_config_file</a>
|
118
|
+
|
119
119
|
<li ><a href="#method-i-new_month-3F">#new_month?</a>
|
120
120
|
|
121
121
|
<li ><a href="#method-i-notes-3D">#notes=</a>
|
@@ -175,7 +175,7 @@
|
|
175
175
|
|
176
176
|
<div class="method-heading">
|
177
177
|
<span class="method-name">load</span><span
|
178
|
-
class="method-args">(
|
178
|
+
class="method-args">(config_file = nil) { |s| ... }</span>
|
179
179
|
|
180
180
|
<span class="method-click-advice">click to toggle source</span>
|
181
181
|
|
@@ -184,9 +184,9 @@
|
|
184
184
|
|
185
185
|
<div class="method-description">
|
186
186
|
|
187
|
-
<p>Convenience method for calling <code>new</code> + <code>load</code
|
187
|
+
<p>Convenience method for calling <code>new</code> + <code>load</code>. Accepts a <code>YAML</code> config file as an argument, and yields the standup instance if a block is given.</p>
|
188
188
|
|
189
|
-
<p>@param [
|
189
|
+
<p>@param [String] <a href="StandupMD.html#attribute-i-config_file"><code>config_file</code></a> File path to config file.</p>
|
190
190
|
|
191
191
|
<p>@example</p>
|
192
192
|
|
@@ -197,14 +197,11 @@
|
|
197
197
|
|
198
198
|
|
199
199
|
<div class="method-source-code" id="load-source">
|
200
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
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">
|
202
|
-
<span class="ruby-
|
203
|
-
|
204
|
-
|
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>
|
200
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 22</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">config_file</span> = <span class="ruby-keyword">nil</span>)
|
202
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">config_file</span>)
|
203
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-identifier">s</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
|
204
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">load</span>
|
208
205
|
<span class="ruby-keyword">end</span></pre>
|
209
206
|
</div>
|
210
207
|
|
@@ -258,6 +255,36 @@
|
|
258
255
|
</div>
|
259
256
|
</div>
|
260
257
|
|
258
|
+
<div id="attribute-i-config" class="method-detail">
|
259
|
+
<div class="method-heading attribute-method-heading">
|
260
|
+
<span class="method-name">config</span><span
|
261
|
+
class="attribute-access-type">[R]</span>
|
262
|
+
</div>
|
263
|
+
|
264
|
+
<div class="method-description">
|
265
|
+
|
266
|
+
<p>The options from <code>config_file</code> as a hash.</p>
|
267
|
+
|
268
|
+
<p>@return [Hash] Options from <code>config_file</code></p>
|
269
|
+
|
270
|
+
</div>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
<div id="attribute-i-config_file" class="method-detail">
|
274
|
+
<div class="method-heading attribute-method-heading">
|
275
|
+
<span class="method-name">config_file</span><span
|
276
|
+
class="attribute-access-type">[R]</span>
|
277
|
+
</div>
|
278
|
+
|
279
|
+
<div class="method-description">
|
280
|
+
|
281
|
+
<p>The configuration file. Default is <code>nil</code>. If set to a string, and the file exists, it is used to set options.</p>
|
282
|
+
|
283
|
+
<p>@return [String] file path</p>
|
284
|
+
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
|
261
288
|
<div id="attribute-i-current_entry_tasks" class="method-detail">
|
262
289
|
<div class="method-heading attribute-method-heading">
|
263
290
|
<span class="method-name">current_entry_tasks</span><span
|
@@ -505,7 +532,7 @@
|
|
505
532
|
|
506
533
|
<div class="method-description">
|
507
534
|
|
508
|
-
<p>The file that contains previous
|
535
|
+
<p>The file that contains the previous entry. If previous entry was same month, <a href="StandupMD.html#attribute-i-previous_file"><code>previous_file</code></a> will be the same as file. If previous entry was last month, and a file exists for last month, <a href="StandupMD.html#attribute-i-previous_file"><code>previous_file</code></a> is last month's file. If neither is true, returns an empty string.</p>
|
509
536
|
|
510
537
|
<p>@return [String]</p>
|
511
538
|
|
@@ -556,6 +583,26 @@
|
|
556
583
|
|
557
584
|
|
558
585
|
|
586
|
+
<section class="constants-list">
|
587
|
+
<header>
|
588
|
+
<h3>Constants</h3>
|
589
|
+
</header>
|
590
|
+
<dl>
|
591
|
+
|
592
|
+
<dt id="VERSION">VERSION
|
593
|
+
|
594
|
+
<dd><p>The gem verision</p>
|
595
|
+
|
596
|
+
<p>@example</p>
|
597
|
+
|
598
|
+
<pre class="ruby"><span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
|
599
|
+
<span class="ruby-comment"># => '0.1.3'</span>
|
600
|
+
</pre>
|
601
|
+
|
602
|
+
|
603
|
+
</dl>
|
604
|
+
</section>
|
605
|
+
|
559
606
|
|
560
607
|
|
561
608
|
<section class="attribute-method-details" class="method-section">
|
@@ -680,7 +727,7 @@
|
|
680
727
|
|
681
728
|
<div class="method-heading">
|
682
729
|
<span class="method-name">new</span><span
|
683
|
-
class="method-args">() { |self| ... }</span>
|
730
|
+
class="method-args">(config_file = nil) { |self| ... }</span>
|
684
731
|
|
685
732
|
<span class="method-click-advice">click to toggle source</span>
|
686
733
|
|
@@ -689,13 +736,15 @@
|
|
689
736
|
|
690
737
|
<div class="method-description">
|
691
738
|
|
692
|
-
<p>Constructor.
|
739
|
+
<p>Constructor. Takes a path to a <code>YAML</code> configuration file as an argument. If passed, settings from the config file will be set. After <code>config_file</code> is loaded, yields <code>self</code> so you can pass a block to access setters, overwriting settings from <code>config_file</code>.</p>
|
740
|
+
|
741
|
+
<p>@param [String] <a href="StandupMD.html#attribute-i-config_file"><code>config_file</code></a> The config file, if any, to load.</p>
|
693
742
|
|
694
743
|
<p>@return [self]</p>
|
695
744
|
|
696
745
|
<p>@example</p>
|
697
746
|
|
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>
|
747
|
+
<pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">'~/.standup_md.yml'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
699
748
|
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">directory</span> = <span class="ruby-ivar">@workdir</span>
|
700
749
|
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">file_name_format</span> = <span class="ruby-string">'%y_%m.markdown'</span>
|
701
750
|
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">'*'</span>
|
@@ -706,8 +755,9 @@
|
|
706
755
|
|
707
756
|
|
708
757
|
<div class="method-source-code" id="new-source">
|
709
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
710
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
|
758
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 250</span>
|
759
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">config_file</span> = <span class="ruby-keyword">nil</span>)
|
760
|
+
<span class="ruby-ivar">@config</span> = {}
|
711
761
|
<span class="ruby-ivar">@notes</span> = []
|
712
762
|
<span class="ruby-ivar">@header_depth</span> = <span class="ruby-value">1</span>
|
713
763
|
<span class="ruby-ivar">@sub_header_depth</span> = <span class="ruby-value">2</span>
|
@@ -722,6 +772,10 @@
|
|
722
772
|
<span class="ruby-ivar">@impediments_header</span> = <span class="ruby-string">'Impediments'</span>
|
723
773
|
<span class="ruby-ivar">@notes_header</span> = <span class="ruby-string">'Notes'</span>
|
724
774
|
<span class="ruby-ivar">@sub_header_order</span> = <span class="ruby-node">%w[previous current impediments notes]</span>
|
775
|
+
<span class="ruby-ivar">@config_file_loaded</span> = <span class="ruby-keyword">false</span>
|
776
|
+
<span class="ruby-ivar">@config_file</span> = <span class="ruby-identifier">config_file</span> <span class="ruby-operator">&&</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">config_file</span>)
|
777
|
+
|
778
|
+
<span class="ruby-identifier">load_config_file</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">config_file</span>
|
725
779
|
|
726
780
|
<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
781
|
<span class="ruby-keyword">end</span></pre>
|
@@ -737,38 +791,17 @@
|
|
737
791
|
|
738
792
|
</section>
|
739
793
|
|
740
|
-
|
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">
|
794
|
+
<section id="public-instance-Attributes+with+default+getters+and+setters.-method-details" class="method-section">
|
762
795
|
<header>
|
763
796
|
<h3>Public Instance Methods</h3>
|
764
797
|
</header>
|
765
798
|
|
766
799
|
|
767
|
-
<div id="method-i-
|
800
|
+
<div id="method-i-bullet_character-3D" class="method-detail ">
|
768
801
|
|
769
802
|
<div class="method-heading">
|
770
|
-
<span class="method-name">
|
771
|
-
class="method-args">()</span>
|
803
|
+
<span class="method-name">bullet_character=</span><span
|
804
|
+
class="method-args">(character)</span>
|
772
805
|
|
773
806
|
<span class="method-click-advice">click to toggle source</span>
|
774
807
|
|
@@ -777,17 +810,20 @@
|
|
777
810
|
|
778
811
|
<div class="method-description">
|
779
812
|
|
780
|
-
<p>
|
813
|
+
<p>Setter for bullet_character. Must be * (asterisk) or - (dash).</p>
|
781
814
|
|
782
|
-
<p>@
|
815
|
+
<p>@param [String] character</p>
|
816
|
+
|
817
|
+
<p>@return [String]</p>
|
783
818
|
|
784
819
|
|
785
820
|
|
786
821
|
|
787
|
-
<div class="method-source-code" id="
|
788
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
789
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
790
|
-
<span class="ruby-
|
822
|
+
<div class="method-source-code" id="bullet_character-3D-source">
|
823
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 356</span>
|
824
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bullet_character=</span>(<span class="ruby-identifier">character</span>)
|
825
|
+
<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>)
|
826
|
+
<span class="ruby-ivar">@bullet_character</span> = <span class="ruby-identifier">character</span>
|
791
827
|
<span class="ruby-keyword">end</span></pre>
|
792
828
|
</div>
|
793
829
|
|
@@ -799,11 +835,11 @@
|
|
799
835
|
</div>
|
800
836
|
|
801
837
|
|
802
|
-
<div id="method-i-
|
838
|
+
<div id="method-i-config_file-3D" class="method-detail ">
|
803
839
|
|
804
840
|
<div class="method-heading">
|
805
|
-
<span class="method-name">
|
806
|
-
class="method-args">()</span>
|
841
|
+
<span class="method-name">config_file=</span><span
|
842
|
+
class="method-args">(config_file)</span>
|
807
843
|
|
808
844
|
<span class="method-click-advice">click to toggle source</span>
|
809
845
|
|
@@ -812,27 +848,19 @@
|
|
812
848
|
|
813
849
|
<div class="method-description">
|
814
850
|
|
815
|
-
<p>
|
816
|
-
|
817
|
-
<p>@return [boolean]</p>
|
851
|
+
<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>
|
818
852
|
|
819
|
-
<p>@
|
853
|
+
<p>@param [String] file</p>
|
820
854
|
|
821
|
-
<
|
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>
|
855
|
+
<p>@return [String]</p>
|
828
856
|
|
829
857
|
|
830
858
|
|
831
859
|
|
832
|
-
<div class="method-source-code" id="
|
833
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
834
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
835
|
-
<span class="ruby-ivar">@
|
860
|
+
<div class="method-source-code" id="config_file-3D-source">
|
861
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 369</span>
|
862
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">config_file=</span>(<span class="ruby-identifier">config_file</span>)
|
863
|
+
<span class="ruby-ivar">@config_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">config_file</span>)
|
836
864
|
<span class="ruby-keyword">end</span></pre>
|
837
865
|
</div>
|
838
866
|
|
@@ -844,40 +872,11 @@
|
|
844
872
|
</div>
|
845
873
|
|
846
874
|
|
847
|
-
|
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 ">
|
875
|
+
<div id="method-i-config_file_loaded-3F" class="method-detail ">
|
877
876
|
|
878
877
|
<div class="method-heading">
|
879
|
-
<span class="method-name">
|
880
|
-
class="method-args">(
|
878
|
+
<span class="method-name">config_file_loaded?</span><span
|
879
|
+
class="method-args">()</span>
|
881
880
|
|
882
881
|
<span class="method-click-advice">click to toggle source</span>
|
883
882
|
|
@@ -886,20 +885,17 @@
|
|
886
885
|
|
887
886
|
<div class="method-description">
|
888
887
|
|
889
|
-
<p>
|
888
|
+
<p>Has a config file been loaded?</p>
|
890
889
|
|
891
|
-
<p>@
|
892
|
-
|
893
|
-
<p>@return [String]</p>
|
890
|
+
<p>@return [Boolean]</p>
|
894
891
|
|
895
892
|
|
896
893
|
|
897
894
|
|
898
|
-
<div class="method-source-code" id="
|
899
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
900
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
901
|
-
<span class="ruby-
|
902
|
-
<span class="ruby-ivar">@bullet_character</span> = <span class="ruby-identifier">character</span>
|
895
|
+
<div class="method-source-code" id="config_file_loaded-3F-source">
|
896
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 278</span>
|
897
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">config_file_loaded?</span>
|
898
|
+
<span class="ruby-ivar">@config_file_loaded</span>
|
903
899
|
<span class="ruby-keyword">end</span></pre>
|
904
900
|
</div>
|
905
901
|
|
@@ -934,7 +930,7 @@
|
|
934
930
|
|
935
931
|
|
936
932
|
<div class="method-source-code" id="current_entry_tasks-3D-source">
|
937
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
933
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 334</span>
|
938
934
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_entry_tasks=</span>(<span class="ruby-identifier">tasks</span>)
|
939
935
|
<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
936
|
<span class="ruby-ivar">@current_entry_tasks</span> = <span class="ruby-identifier">tasks</span>
|
@@ -972,9 +968,8 @@
|
|
972
968
|
|
973
969
|
|
974
970
|
<div class="method-source-code" id="directory-3D-source">
|
975
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
971
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 381</span>
|
976
972
|
<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
973
|
<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
974
|
<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
975
|
<span class="ruby-ivar">@directory</span> = <span class="ruby-identifier">directory</span>
|
@@ -986,6 +981,86 @@
|
|
986
981
|
|
987
982
|
|
988
983
|
|
984
|
+
</div>
|
985
|
+
|
986
|
+
|
987
|
+
<div id="method-i-entry_previously_added-3F" class="method-detail ">
|
988
|
+
|
989
|
+
<div class="method-heading">
|
990
|
+
<span class="method-name">entry_previously_added?</span><span
|
991
|
+
class="method-args">()</span>
|
992
|
+
|
993
|
+
<span class="method-click-advice">click to toggle source</span>
|
994
|
+
|
995
|
+
</div>
|
996
|
+
|
997
|
+
|
998
|
+
<div class="method-description">
|
999
|
+
|
1000
|
+
<p>Was today's entry already in the file?</p>
|
1001
|
+
|
1002
|
+
<p>@return [boolean] true if today's entry was already in the file</p>
|
1003
|
+
|
1004
|
+
|
1005
|
+
|
1006
|
+
|
1007
|
+
<div class="method-source-code" id="entry_previously_added-3F-source">
|
1008
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 302</span>
|
1009
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">entry_previously_added?</span>
|
1010
|
+
<span class="ruby-ivar">@entry_previously_added</span>
|
1011
|
+
<span class="ruby-keyword">end</span></pre>
|
1012
|
+
</div>
|
1013
|
+
|
1014
|
+
</div>
|
1015
|
+
|
1016
|
+
|
1017
|
+
|
1018
|
+
|
1019
|
+
</div>
|
1020
|
+
|
1021
|
+
|
1022
|
+
<div id="method-i-file_written-3F" class="method-detail ">
|
1023
|
+
|
1024
|
+
<div class="method-heading">
|
1025
|
+
<span class="method-name">file_written?</span><span
|
1026
|
+
class="method-args">()</span>
|
1027
|
+
|
1028
|
+
<span class="method-click-advice">click to toggle source</span>
|
1029
|
+
|
1030
|
+
</div>
|
1031
|
+
|
1032
|
+
|
1033
|
+
<div class="method-description">
|
1034
|
+
|
1035
|
+
<p>Has the file been written since instantiated?</p>
|
1036
|
+
|
1037
|
+
<p>@return [boolean]</p>
|
1038
|
+
|
1039
|
+
<p>@example</p>
|
1040
|
+
|
1041
|
+
<pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
|
1042
|
+
<span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_written?</span>
|
1043
|
+
<span class="ruby-comment"># => false</span>
|
1044
|
+
<span class="ruby-identifier">su</span>.<span class="ruby-identifier">write</span>
|
1045
|
+
<span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_written?</span>
|
1046
|
+
<span class="ruby-comment"># => true</span>
|
1047
|
+
</pre>
|
1048
|
+
|
1049
|
+
|
1050
|
+
|
1051
|
+
|
1052
|
+
<div class="method-source-code" id="file_written-3F-source">
|
1053
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 294</span>
|
1054
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">file_written?</span>
|
1055
|
+
<span class="ruby-ivar">@file_written</span>
|
1056
|
+
<span class="ruby-keyword">end</span></pre>
|
1057
|
+
</div>
|
1058
|
+
|
1059
|
+
</div>
|
1060
|
+
|
1061
|
+
|
1062
|
+
|
1063
|
+
|
989
1064
|
</div>
|
990
1065
|
|
991
1066
|
|
@@ -1012,12 +1087,12 @@
|
|
1012
1087
|
|
1013
1088
|
|
1014
1089
|
<div class="method-source-code" id="header_depth-3D-source">
|
1015
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1090
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 393</span>
|
1016
1091
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">header_depth=</span>(<span class="ruby-identifier">depth</span>)
|
1017
1092
|
<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
1093
|
<span class="ruby-identifier">raise</span> <span class="ruby-string">'Header depth out of bounds (1..5)'</span>
|
1019
1094
|
<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">
|
1095
|
+
<span class="ruby-ivar">@sub_header_depth</span> = <span class="ruby-identifier">depth</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
1021
1096
|
<span class="ruby-keyword">end</span>
|
1022
1097
|
<span class="ruby-ivar">@header_depth</span> = <span class="ruby-identifier">depth</span>
|
1023
1098
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1054,7 +1129,7 @@
|
|
1054
1129
|
|
1055
1130
|
|
1056
1131
|
<div class="method-source-code" id="impediments-3D-source">
|
1057
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1132
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 345</span>
|
1058
1133
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">impediments=</span>(<span class="ruby-identifier">tasks</span>)
|
1059
1134
|
<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
1135
|
<span class="ruby-ivar">@impediments</span> = <span class="ruby-identifier">tasks</span>
|
@@ -1069,11 +1144,11 @@
|
|
1069
1144
|
</div>
|
1070
1145
|
|
1071
1146
|
|
1072
|
-
<div id="method-i-
|
1147
|
+
<div id="method-i-load" class="method-detail ">
|
1073
1148
|
|
1074
1149
|
<div class="method-heading">
|
1075
|
-
<span class="method-name">
|
1076
|
-
class="method-args">(
|
1150
|
+
<span class="method-name">load</span><span
|
1151
|
+
class="method-args">()</span>
|
1077
1152
|
|
1078
1153
|
<span class="method-click-advice">click to toggle source</span>
|
1079
1154
|
|
@@ -1082,36 +1157,51 @@
|
|
1082
1157
|
|
1083
1158
|
<div class="method-description">
|
1084
1159
|
|
1085
|
-
<p>
|
1086
|
-
|
1087
|
-
<p>@param [Array] notes</p>
|
1160
|
+
<p>Sets internal instance variables. Called when first instantiated, or after directory is set.</p>
|
1088
1161
|
|
1089
|
-
<p>@return [
|
1162
|
+
<p>@return [self]</p>
|
1090
1163
|
|
1091
1164
|
|
1092
1165
|
|
1093
1166
|
|
1094
|
-
<div class="method-source-code" id="
|
1095
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1096
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
1097
|
-
<span class="ruby-identifier">
|
1098
|
-
|
1167
|
+
<div class="method-source-code" id="load-source">
|
1168
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 475</span>
|
1169
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load</span>
|
1170
|
+
<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>)
|
1171
|
+
|
1172
|
+
<span class="ruby-ivar">@today</span> = <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>
|
1173
|
+
<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>)
|
1174
|
+
<span class="ruby-ivar">@file_written</span> = <span class="ruby-keyword">false</span>
|
1175
|
+
<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>)))
|
1176
|
+
<span class="ruby-ivar">@previous_file</span> = <span class="ruby-identifier">get_previous_file</span>
|
1177
|
+
<span class="ruby-ivar">@all_previous_entries</span> = <span class="ruby-identifier">get_all_previous_entries</span>
|
1178
|
+
<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>)
|
1179
|
+
<span class="ruby-ivar">@previous_entry_tasks</span> = <span class="ruby-identifier">previous_entry</span>[<span class="ruby-identifier">current_header</span>]
|
1180
|
+
<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>
|
1181
|
+
<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>)
|
1182
|
+
|
1183
|
+
<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>)
|
1184
|
+
<span class="ruby-keyword">self</span>
|
1099
1185
|
<span class="ruby-keyword">end</span></pre>
|
1100
1186
|
</div>
|
1101
1187
|
|
1102
1188
|
</div>
|
1103
1189
|
|
1104
1190
|
|
1191
|
+
<div class="aliases">
|
1192
|
+
Also aliased as: <a href="StandupMD.html#method-i-reload">reload</a>
|
1193
|
+
</div>
|
1194
|
+
|
1105
1195
|
|
1106
1196
|
|
1107
1197
|
</div>
|
1108
1198
|
|
1109
1199
|
|
1110
|
-
<div id="method-i-
|
1200
|
+
<div id="method-i-load_config_file" class="method-detail ">
|
1111
1201
|
|
1112
1202
|
<div class="method-heading">
|
1113
|
-
<span class="method-name">
|
1114
|
-
class="method-args">(
|
1203
|
+
<span class="method-name">load_config_file</span><span
|
1204
|
+
class="method-args">()</span>
|
1115
1205
|
|
1116
1206
|
<span class="method-click-advice">click to toggle source</span>
|
1117
1207
|
|
@@ -1120,20 +1210,21 @@
|
|
1120
1210
|
|
1121
1211
|
<div class="method-description">
|
1122
1212
|
|
1123
|
-
<p>
|
1124
|
-
|
1125
|
-
<p>@param [Array] tasks</p>
|
1213
|
+
<p>Loads the config file</p>
|
1126
1214
|
|
1127
|
-
<p>@return [
|
1215
|
+
<p>@return [Hash] The config options</p>
|
1128
1216
|
|
1129
1217
|
|
1130
1218
|
|
1131
1219
|
|
1132
|
-
<div class="method-source-code" id="
|
1133
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1134
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
1135
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-string">'
|
1136
|
-
<span class="ruby-
|
1220
|
+
<div class="method-source-code" id="load_config_file-source">
|
1221
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 441</span>
|
1222
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_config_file</span>
|
1223
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'No config file set'</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">nil?</span>
|
1224
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"File #{config_file} does not exist"</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">config_file</span>)
|
1225
|
+
<span class="ruby-ivar">@config</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">config_file</span>)
|
1226
|
+
<span class="ruby-ivar">@config_file_loaded</span> = <span class="ruby-keyword">true</span>
|
1227
|
+
<span class="ruby-ivar">@config</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">send</span>(<span class="ruby-node">"#{k}="</span>, <span class="ruby-identifier">v</span>) }
|
1137
1228
|
<span class="ruby-keyword">end</span></pre>
|
1138
1229
|
</div>
|
1139
1230
|
|
@@ -1145,11 +1236,11 @@
|
|
1145
1236
|
</div>
|
1146
1237
|
|
1147
1238
|
|
1148
|
-
<div id="method-i-
|
1239
|
+
<div id="method-i-new_month-3F" class="method-detail ">
|
1149
1240
|
|
1150
1241
|
<div class="method-heading">
|
1151
|
-
<span class="method-name">
|
1152
|
-
class="method-args">(
|
1242
|
+
<span class="method-name">new_month?</span><span
|
1243
|
+
class="method-args">()</span>
|
1153
1244
|
|
1154
1245
|
<span class="method-click-advice">click to toggle source</span>
|
1155
1246
|
|
@@ -1158,24 +1249,15 @@
|
|
1158
1249
|
|
1159
1250
|
<div class="method-description">
|
1160
1251
|
|
1161
|
-
<p>
|
1162
|
-
|
1163
|
-
<p>@param [Integer] depth</p>
|
1164
|
-
|
1165
|
-
<p>@return [Integer]</p>
|
1252
|
+
<p>Is today a different month than the previous entry?</p>
|
1166
1253
|
|
1167
1254
|
|
1168
1255
|
|
1169
1256
|
|
1170
|
-
<div class="method-source-code" id="
|
1171
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1172
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
1173
|
-
<span class="ruby-
|
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>
|
1257
|
+
<div class="method-source-code" id="new_month-3F-source">
|
1258
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 501</span>
|
1259
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">new_month?</span>
|
1260
|
+
<span class="ruby-identifier">file</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">previous_file</span>
|
1179
1261
|
<span class="ruby-keyword">end</span></pre>
|
1180
1262
|
</div>
|
1181
1263
|
|
@@ -1187,11 +1269,11 @@
|
|
1187
1269
|
</div>
|
1188
1270
|
|
1189
1271
|
|
1190
|
-
<div id="method-i-
|
1272
|
+
<div id="method-i-notes-3D" class="method-detail ">
|
1191
1273
|
|
1192
1274
|
<div class="method-heading">
|
1193
|
-
<span class="method-name">
|
1194
|
-
class="method-args">(
|
1275
|
+
<span class="method-name">notes=</span><span
|
1276
|
+
class="method-args">(tasks)</span>
|
1195
1277
|
|
1196
1278
|
<span class="method-click-advice">click to toggle source</span>
|
1197
1279
|
|
@@ -1200,21 +1282,20 @@
|
|
1200
1282
|
|
1201
1283
|
<div class="method-description">
|
1202
1284
|
|
1203
|
-
<p>
|
1285
|
+
<p>Setter for notes.</p>
|
1204
1286
|
|
1205
|
-
<p>@param [Array]
|
1287
|
+
<p>@param [Array] notes</p>
|
1206
1288
|
|
1207
1289
|
<p>@return [Array]</p>
|
1208
1290
|
|
1209
1291
|
|
1210
1292
|
|
1211
1293
|
|
1212
|
-
<div class="method-source-code" id="
|
1213
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1214
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
1215
|
-
<span class="ruby-identifier">
|
1216
|
-
<span class="ruby-
|
1217
|
-
<span class="ruby-ivar">@sub_header_order</span> = <span class="ruby-identifier">array</span>
|
1294
|
+
<div class="method-source-code" id="notes-3D-source">
|
1295
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 323</span>
|
1296
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">notes=</span>(<span class="ruby-identifier">tasks</span>)
|
1297
|
+
<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>)
|
1298
|
+
<span class="ruby-ivar">@notes</span> = <span class="ruby-identifier">tasks</span>
|
1218
1299
|
<span class="ruby-keyword">end</span></pre>
|
1219
1300
|
</div>
|
1220
1301
|
|
@@ -1226,113 +1307,79 @@
|
|
1226
1307
|
</div>
|
1227
1308
|
|
1228
1309
|
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1310
|
+
<div id="method-i-previous_entry_tasks-3D" class="method-detail ">
|
1311
|
+
|
1312
|
+
<div class="method-heading">
|
1313
|
+
<span class="method-name">previous_entry_tasks=</span><span
|
1314
|
+
class="method-args">(tasks)</span>
|
1315
|
+
|
1316
|
+
<span class="method-click-advice">click to toggle source</span>
|
1317
|
+
|
1318
|
+
</div>
|
1319
|
+
|
1232
1320
|
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
<h2>
|
1237
|
-
Misc
|
1238
|
-
</h2>
|
1239
|
-
<span class="section-click-top">
|
1240
|
-
<a href="#top">↑ top</a>
|
1241
|
-
</span>
|
1242
|
-
</header>
|
1243
|
-
|
1321
|
+
<div class="method-description">
|
1322
|
+
|
1323
|
+
<p>Setter for current entry tasks.</p>
|
1244
1324
|
|
1245
|
-
|
1325
|
+
<p>@param [Array] tasks</p>
|
1246
1326
|
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
<h3>Constants</h3>
|
1251
|
-
</header>
|
1252
|
-
<dl>
|
1253
|
-
|
1254
|
-
<dt id="VERSION">VERSION
|
1255
|
-
|
1256
|
-
<dd><p>The gem verision</p>
|
1327
|
+
<p>@return [Array]</p>
|
1328
|
+
|
1329
|
+
|
1257
1330
|
|
1258
|
-
|
1331
|
+
|
1332
|
+
<div class="method-source-code" id="previous_entry_tasks-3D-source">
|
1333
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 312</span>
|
1334
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">previous_entry_tasks=</span>(<span class="ruby-identifier">tasks</span>)
|
1335
|
+
<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>)
|
1336
|
+
<span class="ruby-ivar">@previous_entry_tasks</span> = <span class="ruby-identifier">tasks</span>
|
1337
|
+
<span class="ruby-keyword">end</span></pre>
|
1338
|
+
</div>
|
1339
|
+
|
1340
|
+
</div>
|
1259
1341
|
|
1260
|
-
<pre class="ruby"><span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
|
1261
|
-
<span class="ruby-comment"># => '0.1.1'</span>
|
1262
|
-
</pre>
|
1263
1342
|
|
1264
|
-
|
1265
|
-
</dl>
|
1266
|
-
</section>
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
1343
|
|
1271
|
-
|
1272
|
-
|
1273
|
-
<header>
|
1274
|
-
<h3>Public Instance Methods</h3>
|
1275
|
-
</header>
|
1344
|
+
|
1345
|
+
</div>
|
1276
1346
|
|
1277
1347
|
|
1278
|
-
<div id="method-i-
|
1348
|
+
<div id="method-i-reload" class="method-detail method-alias">
|
1279
1349
|
|
1280
1350
|
<div class="method-heading">
|
1281
|
-
<span class="method-name">
|
1351
|
+
<span class="method-name">reload</span><span
|
1282
1352
|
class="method-args">()</span>
|
1283
1353
|
|
1284
|
-
<span class="method-click-advice">click to toggle source</span>
|
1285
|
-
|
1286
1354
|
</div>
|
1287
1355
|
|
1288
1356
|
|
1289
1357
|
<div class="method-description">
|
1290
1358
|
|
1291
|
-
<p>
|
1359
|
+
<p>Alias of <code>load</code></p>
|
1292
1360
|
|
1293
1361
|
<p>@return [self]</p>
|
1294
1362
|
|
1295
1363
|
|
1296
1364
|
|
1297
1365
|
|
1298
|
-
<div class="method-source-code" id="load-source">
|
1299
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 431</span>
|
1300
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load</span>
|
1301
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">directory</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">directory</span>)
|
1302
|
-
|
1303
|
-
<span class="ruby-ivar">@today</span> = <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>
|
1304
|
-
<span class="ruby-ivar">@header</span> = <span class="ruby-identifier">today</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">header_date_format</span>)
|
1305
|
-
<span class="ruby-ivar">@file_written</span> = <span class="ruby-keyword">false</span>
|
1306
|
-
<span class="ruby-ivar">@file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">today</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">file_name_format</span>)))
|
1307
|
-
<span class="ruby-ivar">@previous_file</span> = <span class="ruby-identifier">get_previous_file</span>
|
1308
|
-
<span class="ruby-ivar">@all_previous_entries</span> = <span class="ruby-identifier">get_all_previous_entries</span>
|
1309
|
-
<span class="ruby-ivar">@entry_previously_added</span> = <span class="ruby-identifier">all_previous_entries</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">header</span>)
|
1310
|
-
<span class="ruby-ivar">@previous_entry_tasks</span> = <span class="ruby-identifier">previous_entry</span>[<span class="ruby-identifier">current_header</span>]
|
1311
|
-
<span class="ruby-ivar">@current_entry</span> = <span class="ruby-ivar">@all_previous_entries</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">header</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">new_entry</span>
|
1312
|
-
<span class="ruby-ivar">@all_entries</span> = {<span class="ruby-identifier">header</span> <span class="ruby-operator">=></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>
|
1316
|
-
<span class="ruby-keyword">end</span></pre>
|
1317
|
-
</div>
|
1318
|
-
|
1319
1366
|
</div>
|
1320
1367
|
|
1321
1368
|
|
1369
|
+
|
1370
|
+
|
1322
1371
|
<div class="aliases">
|
1323
|
-
|
1372
|
+
Alias for: <a href="StandupMD.html#method-i-load">load</a>
|
1324
1373
|
</div>
|
1325
1374
|
|
1326
|
-
|
1327
|
-
|
1328
1375
|
</div>
|
1329
1376
|
|
1330
1377
|
|
1331
|
-
<div id="method-i-
|
1378
|
+
<div id="method-i-sub_header_depth-3D" class="method-detail ">
|
1332
1379
|
|
1333
1380
|
<div class="method-heading">
|
1334
|
-
<span class="method-name">
|
1335
|
-
class="method-args">()</span>
|
1381
|
+
<span class="method-name">sub_header_depth=</span><span
|
1382
|
+
class="method-args">(depth)</span>
|
1336
1383
|
|
1337
1384
|
<span class="method-click-advice">click to toggle source</span>
|
1338
1385
|
|
@@ -1341,15 +1388,24 @@
|
|
1341
1388
|
|
1342
1389
|
<div class="method-description">
|
1343
1390
|
|
1344
|
-
<p>
|
1391
|
+
<p>Number of octothorps (#) to use before sub headers (Current, Previous, etc).</p>
|
1392
|
+
|
1393
|
+
<p>@param [Integer] depth</p>
|
1394
|
+
|
1395
|
+
<p>@return [Integer]</p>
|
1345
1396
|
|
1346
1397
|
|
1347
1398
|
|
1348
1399
|
|
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-
|
1400
|
+
<div class="method-source-code" id="sub_header_depth-3D-source">
|
1401
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 408</span>
|
1402
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub_header_depth=</span>(<span class="ruby-identifier">depth</span>)
|
1403
|
+
<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>)
|
1404
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'Sub-header depth out of bounds (2..6)'</span>
|
1405
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">header_depth</span>
|
1406
|
+
<span class="ruby-ivar">@header_depth</span> = <span class="ruby-identifier">depth</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
1407
|
+
<span class="ruby-keyword">end</span>
|
1408
|
+
<span class="ruby-ivar">@sub_header_depth</span> = <span class="ruby-identifier">depth</span>
|
1353
1409
|
<span class="ruby-keyword">end</span></pre>
|
1354
1410
|
</div>
|
1355
1411
|
|
@@ -1361,41 +1417,46 @@
|
|
1361
1417
|
</div>
|
1362
1418
|
|
1363
1419
|
|
1364
|
-
<div id="method-i-
|
1420
|
+
<div id="method-i-sub_header_order" class="method-detail ">
|
1365
1421
|
|
1366
1422
|
<div class="method-heading">
|
1367
|
-
<span class="method-name">
|
1423
|
+
<span class="method-name">sub_header_order</span><span
|
1368
1424
|
class="method-args">()</span>
|
1369
1425
|
|
1426
|
+
<span class="method-click-advice">click to toggle source</span>
|
1427
|
+
|
1370
1428
|
</div>
|
1371
1429
|
|
1372
1430
|
|
1373
1431
|
<div class="method-description">
|
1374
1432
|
|
1375
|
-
<p>
|
1433
|
+
<p>Return a copy of the sub-header order so the user can't modify the array.</p>
|
1376
1434
|
|
1377
|
-
<p>@return [
|
1435
|
+
<p>@return [Array]</p>
|
1378
1436
|
|
1379
1437
|
|
1380
1438
|
|
1381
1439
|
|
1440
|
+
<div class="method-source-code" id="sub_header_order-source">
|
1441
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 433</span>
|
1442
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub_header_order</span>
|
1443
|
+
<span class="ruby-ivar">@sub_header_order</span>.<span class="ruby-identifier">dup</span>
|
1444
|
+
<span class="ruby-keyword">end</span></pre>
|
1445
|
+
</div>
|
1446
|
+
|
1382
1447
|
</div>
|
1383
1448
|
|
1384
1449
|
|
1385
1450
|
|
1386
1451
|
|
1387
|
-
<div class="aliases">
|
1388
|
-
Alias for: <a href="StandupMD.html#method-i-load">load</a>
|
1389
|
-
</div>
|
1390
|
-
|
1391
1452
|
</div>
|
1392
1453
|
|
1393
1454
|
|
1394
|
-
<div id="method-i-sub_header_order" class="method-detail ">
|
1455
|
+
<div id="method-i-sub_header_order-3D" class="method-detail ">
|
1395
1456
|
|
1396
1457
|
<div class="method-heading">
|
1397
|
-
<span class="method-name">sub_header_order
|
1398
|
-
class="method-args">()</span>
|
1458
|
+
<span class="method-name">sub_header_order=</span><span
|
1459
|
+
class="method-args">(array)</span>
|
1399
1460
|
|
1400
1461
|
<span class="method-click-advice">click to toggle source</span>
|
1401
1462
|
|
@@ -1404,17 +1465,21 @@
|
|
1404
1465
|
|
1405
1466
|
<div class="method-description">
|
1406
1467
|
|
1407
|
-
<p>
|
1468
|
+
<p>Preferred order for sub-headers.</p>
|
1469
|
+
|
1470
|
+
<p>@param [Array] Values must be %w[previous current impediment notes]</p>
|
1408
1471
|
|
1409
1472
|
<p>@return [Array]</p>
|
1410
1473
|
|
1411
1474
|
|
1412
1475
|
|
1413
1476
|
|
1414
|
-
<div class="method-source-code" id="sub_header_order-source">
|
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">sub_header_order</span>
|
1417
|
-
<span class="ruby-
|
1477
|
+
<div class="method-source-code" id="sub_header_order-3D-source">
|
1478
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 423</span>
|
1479
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub_header_order=</span>(<span class="ruby-identifier">array</span>)
|
1480
|
+
<span class="ruby-identifier">order</span> = <span class="ruby-node">%w[previous current impediments notes]</span>
|
1481
|
+
<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>
|
1482
|
+
<span class="ruby-ivar">@sub_header_order</span> = <span class="ruby-identifier">array</span>
|
1418
1483
|
<span class="ruby-keyword">end</span></pre>
|
1419
1484
|
</div>
|
1420
1485
|
|
@@ -1447,7 +1512,7 @@
|
|
1447
1512
|
|
1448
1513
|
|
1449
1514
|
<div class="method-source-code" id="write-source">
|
1450
|
-
<pre><span class="ruby-comment"># File lib/standup_md.rb, line
|
1515
|
+
<pre><span class="ruby-comment"># File lib/standup_md.rb, line 453</span>
|
1451
1516
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write</span>
|
1452
1517
|
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>, <span class="ruby-string">'w'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
1453
1518
|
<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>
|
@@ -1459,7 +1524,7 @@
|
|
1459
1524
|
<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
1525
|
<span class="ruby-keyword">end</span>
|
1461
1526
|
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span>
|
1462
|
-
<span class="ruby-keyword">
|
1527
|
+
<span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">new_month?</span>
|
1463
1528
|
<span class="ruby-keyword">end</span>
|
1464
1529
|
<span class="ruby-keyword">end</span>
|
1465
1530
|
<span class="ruby-ivar">@file_written</span> = <span class="ruby-keyword">true</span>
|