standup_md 0.3.4 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -9
- data/README.md +61 -44
- data/Rakefile +3 -1
- data/doc/README_md.html +55 -62
- data/doc/StandupMD.html +16 -102
- data/doc/StandupMD/Cli.html +28 -170
- data/doc/StandupMD/Cli/Helpers.html +13 -34
- data/doc/StandupMD/Config.html +7 -44
- data/doc/StandupMD/Config/Cli.html +10 -78
- data/doc/StandupMD/Config/Entry.html +10 -66
- data/doc/StandupMD/Config/EntryList.html +7 -48
- data/doc/StandupMD/Config/File.html +17 -149
- data/doc/StandupMD/Entry.html +23 -134
- data/doc/StandupMD/EntryList.html +94 -354
- data/doc/StandupMD/File.html +51 -182
- data/doc/StandupMD/Version.html +143 -0
- data/doc/created.rid +15 -15
- data/doc/css/rdoc.css +1 -1
- data/doc/index.html +53 -74
- 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 +46 -106
- data/lib/standup_md.rb +10 -6
- data/lib/standup_md/cli.rb +9 -10
- data/lib/standup_md/cli/helpers.rb +71 -44
- data/lib/standup_md/config.rb +0 -2
- data/lib/standup_md/config/cli.rb +2 -4
- data/lib/standup_md/config/entry.rb +2 -4
- data/lib/standup_md/config/file.rb +3 -3
- data/lib/standup_md/entry.rb +8 -11
- data/lib/standup_md/entry_list.rb +20 -37
- data/lib/standup_md/file.rb +31 -14
- data/lib/standup_md/file/helpers.rb +13 -15
- data/lib/standup_md/version.rb +22 -4
- data/standup_md.gemspec +12 -16
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a87d888af43be793a8c4d542a57d6260de252df5abf6d4e5025b04b389c1569c
|
4
|
+
data.tar.gz: 336d2d4c04678ab01262eebf2323f69d48347f873d9236dfdb8c781a6e20caa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f965f80af7cdb9023487f2ed458b9da2e6e94d6474f777c6ff11266e309a6025f4d6051e639d8bf3e31d8f8a4b23419c6a6be602ee32954974162eb1b41c0659
|
7
|
+
data.tar.gz: 1f3fcf18356183cea6fdf77a2cb1298b082e915d056f6b649ac41440c40aa76f88db6da365296fedea5b3723efe258a5cbe5be23d10e10a3810bdf941e920a24
|
data/Gemfile.lock
CHANGED
@@ -1,23 +1,25 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
standup_md (0.3.
|
4
|
+
standup_md (0.3.8)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
docile (1.3.
|
10
|
-
power_assert (
|
11
|
-
rake (13.0.
|
12
|
-
simplecov (0.
|
9
|
+
docile (1.3.5)
|
10
|
+
power_assert (2.0.0)
|
11
|
+
rake (13.0.3)
|
12
|
+
simplecov (0.21.2)
|
13
13
|
docile (~> 1.1)
|
14
14
|
simplecov-html (~> 0.11)
|
15
|
-
|
16
|
-
|
15
|
+
simplecov_json_formatter (~> 0.1)
|
16
|
+
simplecov-html (0.12.3)
|
17
|
+
simplecov_json_formatter (0.1.2)
|
18
|
+
test-unit (3.4.1)
|
17
19
|
power_assert
|
18
20
|
|
19
21
|
PLATFORMS
|
20
|
-
|
22
|
+
x86_64-darwin-20
|
21
23
|
|
22
24
|
DEPENDENCIES
|
23
25
|
rake (~> 13.0, >= 13.0.1)
|
@@ -26,4 +28,4 @@ DEPENDENCIES
|
|
26
28
|
test-unit (~> 3.3, >= 3.3.5)
|
27
29
|
|
28
30
|
BUNDLED WITH
|
29
|
-
2.
|
31
|
+
2.2.16
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# The Standup Doctor
|
2
|
+
<!-- vi: set ts=4 sw=4 : -->
|
2
3
|
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fevanthegrayt%2Fstandup_md%2Fbadge%3Fref%3Dmaster&style=flat)](https://actions-badge.atrox.dev/evanthegrayt/standup_md/goto?ref=master)
|
3
4
|
[![Gem Version](https://badge.fury.io/rb/standup_md.svg)](https://badge.fury.io/rb/standup_md)
|
4
5
|
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
@@ -12,27 +13,6 @@ View on: [Github](https://github.com/evanthegrayt/standup_md) |
|
|
12
13
|
[GitHub Pages](https://evanthegrayt.github.io/standup_md/) |
|
13
14
|
[RubyGems](https://rubygems.org/gems/standup_md)
|
14
15
|
|
15
|
-
## Table of Contents
|
16
|
-
- [About](#about)
|
17
|
-
- [Installation](#Installation)
|
18
|
-
- [Via RubyGems](#via-rubygems)
|
19
|
-
- [Manual Installation](#manual-installation)
|
20
|
-
- [Usage](#usage)
|
21
|
-
- [Command Line](#command-line)
|
22
|
-
- [CLI Examples](#cli-examples)
|
23
|
-
- [Adding an entry for today via editor](#adding-an-entry-for-today-via-editor)
|
24
|
-
- [Copy the entry for today to clipboard](#copy-the-entry-for-today-to-clipboard)
|
25
|
-
- [Add entry to file without opening it](#add-entry-to-file-without-opening-it)
|
26
|
-
- [Find an entry by date and print it](#find-an-entry-by-date-and-print-it)
|
27
|
-
- [Customization and Runtime Options](#customization-and-runtime-options)
|
28
|
-
- [Using existing standup files](#using-existing-standup-files)
|
29
|
-
- [API](#api)
|
30
|
-
- [API Examples](#api-examples)
|
31
|
-
- [Adding an entry for today](#adding-an-entry-for-today)
|
32
|
-
- [Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html)
|
33
|
-
- [Reporting Bugs and Requesting Features](#reporting-bugs-and-requesting-features)
|
34
|
-
- [Self-Promotion](#self-promotion)
|
35
|
-
|
36
16
|
## About
|
37
17
|
I've now been at two separate companies where we post our daily standups in a
|
38
18
|
chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day
|
@@ -46,8 +26,8 @@ for the current month in your preferred editor. If an entry for today is already
|
|
46
26
|
present, no text will be generated. If an entry for today doesn't exist, one
|
47
27
|
will be generated with your preferred values. When generating, if a previous
|
48
28
|
entry exists, it will be added to today's entry as your previous day's work. See
|
49
|
-
[example](#
|
50
|
-
in your own code somehow.
|
29
|
+
[example](#cli-examples). There's also a very robust API if you'd like to use
|
30
|
+
this in your own code somehow.
|
51
31
|
|
52
32
|
## Installation
|
53
33
|
If you don't have the permissions to install system-wide gems, you're probabaly
|
@@ -133,20 +113,12 @@ your clipboard without even opening your editor.
|
|
133
113
|
standup -p | pbcopy
|
134
114
|
```
|
135
115
|
|
136
|
-
If you wanted to add today's entry without opening your editor, and print the
|
137
|
-
result to the command line, you could use the following.
|
138
|
-
|
139
116
|
#### Add entry to file without opening it
|
140
|
-
|
141
|
-
|
142
|
-
```
|
143
|
-
|
144
|
-
#### Find an entry by date and print it.
|
145
|
-
If you wanted to find and print the entry for March 2nd, 2020, you could use the
|
146
|
-
following.
|
117
|
+
You can add an entry for today without even opening your editor. Note that, if
|
118
|
+
you have multiple entries, you must separate them with a comma and *no spaces*.
|
147
119
|
|
148
120
|
```sh
|
149
|
-
standup -
|
121
|
+
standup --no-edit --current "Work on this thing","And another thing"
|
150
122
|
```
|
151
123
|
|
152
124
|
### Customization and Runtime Options
|
@@ -213,7 +185,15 @@ StandupMD.configure do |c|
|
|
213
185
|
end
|
214
186
|
```
|
215
187
|
|
188
|
+
Any options not set in this file will retain their default values. Note that if
|
189
|
+
you change `file_name_format`, and don't use a month or year, there will only
|
190
|
+
ever be one standup file. This could cause issues long-term, as the files will
|
191
|
+
get large over time and possibly cause performance issues.
|
192
|
+
|
193
|
+
|
216
194
|
#### Executable Flags
|
195
|
+
Some of these options can be changed at runtime. They are as follows.
|
196
|
+
|
217
197
|
```
|
218
198
|
--current ARRAY List of current entry's tasks
|
219
199
|
--previous ARRAY List of precious entry's tasks
|
@@ -232,11 +212,6 @@ end
|
|
232
212
|
DATE must be in the same format as file-name-format
|
233
213
|
```
|
234
214
|
|
235
|
-
Any options not set in this file will retain their default values. Note that if
|
236
|
-
you change `file_name_format`, and don't use a month or year, there will only
|
237
|
-
ever be one standup file. This could cause issues long-term, as the files will
|
238
|
-
get large over time and possibly cause performance issues.
|
239
|
-
|
240
215
|
#### Using Existing Standup Files
|
241
216
|
If you already have a directory of existing standup files, you can use them, but
|
242
217
|
they must be in a format that the parser can understand. The default is:
|
@@ -290,9 +265,9 @@ end
|
|
290
265
|
The API is fully documented in the
|
291
266
|
[RDoc Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html).
|
292
267
|
|
293
|
-
This was mainly written as a command line utility, but the API is
|
294
|
-
|
295
|
-
|
268
|
+
This was mainly written as a command line utility, but the API is very robust,
|
269
|
+
and is available for use in your own projects. A quick example of how to write a
|
270
|
+
new entry via code could look like the following:
|
296
271
|
|
297
272
|
### API Examples
|
298
273
|
#### Adding an entry for today
|
@@ -323,10 +298,52 @@ end
|
|
323
298
|
StandupMD::File.find_by_date(Date.today).load.write
|
324
299
|
```
|
325
300
|
|
301
|
+
#### Finding a past entry
|
302
|
+
```ruby
|
303
|
+
require 'standup_md'
|
304
|
+
|
305
|
+
date = Date.new(2020, 04, 15)
|
306
|
+
file = StandupMD::File.find_by_date(date).load
|
307
|
+
entry = file.entries.find(date)
|
308
|
+
```
|
309
|
+
|
310
|
+
## Vim
|
311
|
+
While there's no official support for vim, you can add this to your `vimrc`
|
312
|
+
file, or something like `~/.vim/plugin/standup.vim`.
|
313
|
+
|
314
|
+
```vim
|
315
|
+
command! -complete=custom,<SID>StandupCompletion -nargs=? -bang Standup
|
316
|
+
\ call <SID>OpenStandupFile(<bang>0, <f-args>)
|
317
|
+
|
318
|
+
function! s:StandupCompletion(...) abort
|
319
|
+
let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
|
320
|
+
if !isdirectory(l:dir) | return '' | endif
|
321
|
+
return join(map(glob(l:dir . '*.md', 0, 1), "fnamemodify(v:val, ':t')"), "\n")
|
322
|
+
endfunction
|
323
|
+
|
324
|
+
function! s:OpenStandupFile(split, ...)
|
325
|
+
let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
|
326
|
+
let l:file = a:0 ? a:1 : get(g:, 'standup_file', strftime('%Y_%m.md'))
|
327
|
+
call system('standup --no-edit')
|
328
|
+
execute a:split ? 'vsplit' : 'split' l:dir . l:file
|
329
|
+
endfunction
|
330
|
+
```
|
331
|
+
|
332
|
+
This makes the `:Standup` command, which opens the standup file in a split,
|
333
|
+
while `:Standup!` opens it in a vertical split. If a file is passed to the
|
334
|
+
command, that file will be opened. There's tab completion for this. Lastly,
|
335
|
+
it allows for a few variables to be set for customization.
|
336
|
+
|
337
|
+
```vim
|
338
|
+
g:standup_dir = $HOME . '/.cache/standup_md' " the directory where your file are
|
339
|
+
g:standup_file = strftime('%Y_%m.md') " the file format to use
|
340
|
+
```
|
341
|
+
|
326
342
|
## Reporting Bugs and Requesting Features
|
327
343
|
If you have an idea or find a bug, please [create an
|
328
|
-
issue](https://github.com/evanthegrayt/standup_md/issues/new). Just make sure
|
329
|
-
doesn't already exist. Better yet, you can always submit a Pull
|
344
|
+
issue](https://github.com/evanthegrayt/standup_md/issues/new). Just make sure
|
345
|
+
the topic doesn't already exist. Better yet, you can always submit a Pull
|
346
|
+
Request.
|
330
347
|
|
331
348
|
## Self-Promotion
|
332
349
|
I do these projects for fun, and I enjoy knowing that they're helpful to people.
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'lib/standup_md'
|
2
4
|
require 'bundler/gem_tasks'
|
3
5
|
require 'rdoc/task'
|
@@ -16,4 +18,4 @@ RDoc::Task.new do |rdoc|
|
|
16
18
|
rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')
|
17
19
|
end
|
18
20
|
|
19
|
-
task :
|
21
|
+
task default: :test
|
data/doc/README_md.html
CHANGED
@@ -21,8 +21,6 @@
|
|
21
21
|
<link href="./css/rdoc.css" rel="stylesheet">
|
22
22
|
|
23
23
|
|
24
|
-
|
25
|
-
|
26
24
|
<body id="top" role="document" class="file">
|
27
25
|
<nav role="navigation">
|
28
26
|
<div id="project-navigation">
|
@@ -61,7 +59,6 @@
|
|
61
59
|
|
62
60
|
<ul class="link-list" role="directory">
|
63
61
|
<li><a href="#label-The+Standup+Doctor">The Standup Doctor</a>
|
64
|
-
<li><a href="#label-Table+of+Contents">Table of Contents</a>
|
65
62
|
<li><a href="#label-About">About</a>
|
66
63
|
<li><a href="#label-Installation">Installation</a>
|
67
64
|
<li><a href="#label-Via+RubyGems">Via RubyGems</a>
|
@@ -72,13 +69,15 @@
|
|
72
69
|
<li><a href="#label-Adding+an+entry+for+today+via+editor">Adding an entry for today via editor</a>
|
73
70
|
<li><a href="#label-Copy+the+entry+for+today+to+clipboard">Copy the entry for today to clipboard</a>
|
74
71
|
<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>
|
76
72
|
<li><a href="#label-Customization+and+Runtime+Options">Customization and Runtime Options</a>
|
77
73
|
<li><a href="#label-Available+Config+File+Options+and+Defaults">Available Config File Options and Defaults</a>
|
78
74
|
<li><a href="#label-Executable+Flags">Executable Flags</a>
|
79
75
|
<li><a href="#label-Using+Existing+Standup+Files">Using Existing Standup Files</a>
|
80
76
|
<li><a href="#label-API">API</a>
|
81
77
|
<li><a href="#label-API+Examples">API Examples</a>
|
78
|
+
<li><a href="#label-Adding+an+entry+for+today">Adding an entry for today</a>
|
79
|
+
<li><a href="#label-Finding+a+past+entry">Finding a past entry</a>
|
80
|
+
<li><a href="#label-Vim">Vim</a>
|
82
81
|
<li><a href="#label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features</a>
|
83
82
|
<li><a href="#label-Self-Promotion">Self-Promotion</a>
|
84
83
|
</ul>
|
@@ -86,13 +85,12 @@
|
|
86
85
|
|
87
86
|
|
88
87
|
<div id="project-metadata">
|
89
|
-
|
88
|
+
|
89
|
+
<div id="fileindex-section" class="nav-section">
|
90
90
|
<h3>Pages</h3>
|
91
91
|
|
92
92
|
<ul class="link-list">
|
93
|
-
|
94
93
|
<li><a href="./README_md.html">README</a>
|
95
|
-
|
96
94
|
</ul>
|
97
95
|
</div>
|
98
96
|
|
@@ -102,7 +100,7 @@
|
|
102
100
|
<main role="main" aria-label="Page README.md">
|
103
101
|
|
104
102
|
<h1 id="label-The+Standup+Doctor">The Standup Doctor<span><a href="#label-The+Standup+Doctor">¶</a> <a href="#top">↑</a></span></h1>
|
105
|
-
|
103
|
+
<!-- vi: set ts=4 sw=4 : -->
|
106
104
|
<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
105
|
|
108
106
|
<blockquote>
|
@@ -113,55 +111,16 @@
|
|
113
111
|
|
114
112
|
<p>View on: <a href="https://github.com/evanthegrayt/standup_md">Github</a> | <a href="https://evanthegrayt.github.io/standup_md/">GitHub Pages</a> | <a href="https://rubygems.org/gems/standup_md">RubyGems</a></p>
|
115
113
|
|
116
|
-
<h2 id="label-Table+of+Contents">Table of Contents<span><a href="#label-Table+of+Contents">¶</a> <a href="#top">↑</a></span></h2>
|
117
|
-
<ul><li>
|
118
|
-
<p><a href="#about">About</a></p>
|
119
|
-
</li><li>
|
120
|
-
<p><a href="#Installation">Installation</a></p>
|
121
|
-
</li><li>
|
122
|
-
<p><a href="#via-rubygems">Via RubyGems</a></p>
|
123
|
-
</li><li>
|
124
|
-
<p><a href="#manual-installation">Manual Installation</a></p>
|
125
|
-
</li><li>
|
126
|
-
<p><a href="#usage">Usage</a></p>
|
127
|
-
</li><li>
|
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>
|
139
|
-
</li><li>
|
140
|
-
<p><a href="#customization-and-runtime-options">Customization and Runtime Options</a></p>
|
141
|
-
</li><li>
|
142
|
-
<p><a href="#using-existing-standup-files">Using existing standup files</a></p>
|
143
|
-
</li></ul>
|
144
|
-
</li><li>
|
145
|
-
<p><a href="#api">API</a></p>
|
146
|
-
<ul><li>
|
147
|
-
<p><a href="#api-examples">API Examples</a></p>
|
148
|
-
</li><li>
|
149
|
-
<p><a href="https://evanthegrayt.github.io/standup_md/doc/index.html">Documentation</a></p>
|
150
|
-
</li></ul>
|
151
|
-
</li><li>
|
152
|
-
<p><a href="#reporting-bugs-and-requesting-features">Reporting Bugs and Requesting Features</a></p>
|
153
|
-
</li><li>
|
154
|
-
<p><a href="#self-promotion">Self-Promotion</a></p>
|
155
|
-
</li></ul>
|
156
|
-
|
157
114
|
<h2 id="label-About">About<span><a href="#label-About">¶</a> <a href="#top">↑</a></span></h2>
|
158
115
|
|
159
116
|
<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>
|
160
117
|
|
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="#
|
118
|
+
<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="#cli-examples">example</a>. There's also a very robust API if you'd like to use this in your own code somehow.</p>
|
162
119
|
|
163
120
|
<h2 id="label-Installation">Installation<span><a href="#label-Installation">¶</a> <a href="#top">↑</a></span></h2>
|
164
121
|
|
122
|
+
<p>If you don't have the permissions to install system-wide gems, you're probabaly also running an older version of ruby. I recommend installing <a href="https://github.com/rbenv/rbenv#installation">rbenv</a>, and then installing an up-to-date version of ruby.</p>
|
123
|
+
|
165
124
|
<h3 id="label-Via+RubyGems">Via RubyGems<span><a href="#label-Via+RubyGems">¶</a> <a href="#top">↑</a></span></h3>
|
166
125
|
|
167
126
|
<p>Just install the gem!</p>
|
@@ -228,17 +187,11 @@ rake install</pre>
|
|
228
187
|
<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>
|
229
188
|
</pre>
|
230
189
|
|
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
190
|
<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
191
|
|
235
|
-
<
|
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>
|
192
|
+
<p>You can add an entry for today without even opening your editor. Note that, if you have multiple entries, you must separate them with a comma and <em>no spaces</em>.</p>
|
238
193
|
|
239
|
-
<
|
240
|
-
|
241
|
-
<pre>standup -p 2020-03-02</pre>
|
194
|
+
<pre>standup --no-edit --current "Work on this thing","And another thing"</pre>
|
242
195
|
|
243
196
|
<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>
|
244
197
|
|
@@ -250,6 +203,8 @@ rake install</pre>
|
|
250
203
|
|
251
204
|
<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
205
|
|
206
|
+
<p>For command-line usage, this file needs to be named <code>~/.standuprc</code>. To use in a rails project, create an initializer (<code>config/initializers/standup_md.rb</code>).</p>
|
207
|
+
|
253
208
|
<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
209
|
<span class="ruby-comment"># Defaults for how the file is formatted.</span>
|
255
210
|
<span class="ruby-comment"># See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html</span>
|
@@ -286,8 +241,12 @@ rake install</pre>
|
|
286
241
|
<span class="ruby-keyword">end</span>
|
287
242
|
</pre>
|
288
243
|
|
244
|
+
<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>
|
245
|
+
|
289
246
|
<h4 id="label-Executable+Flags">Executable Flags<span><a href="#label-Executable+Flags">¶</a> <a href="#top">↑</a></span></h4>
|
290
247
|
|
248
|
+
<p>Some of these options can be changed at runtime. They are as follows.</p>
|
249
|
+
|
291
250
|
<pre>--current ARRAY List of current entry's tasks
|
292
251
|
--previous ARRAY List of precious entry's tasks
|
293
252
|
--impediments ARRAY List of impediments for current entry
|
@@ -304,8 +263,6 @@ rake install</pre>
|
|
304
263
|
If DATE is passed, will print entry for DATE, if it exists.
|
305
264
|
DATE must be in the same format as file-name-format</pre>
|
306
265
|
|
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>
|
308
|
-
|
309
266
|
<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>
|
310
267
|
|
311
268
|
<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>
|
@@ -352,10 +309,12 @@ rake install</pre>
|
|
352
309
|
|
353
310
|
<p>The API is fully documented in the <a href="https://evanthegrayt.github.io/standup_md/doc/index.html">RDoc Documentation</a>.</p>
|
354
311
|
|
355
|
-
<p>This was mainly written as a command line utility, but the API is
|
312
|
+
<p>This was mainly written as a command line utility, but the API is very 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
313
|
|
357
314
|
<h3 id="label-API+Examples">API Examples<span><a href="#label-API+Examples">¶</a> <a href="#top">↑</a></span></h3>
|
358
315
|
|
316
|
+
<h4 id="label-Adding+an+entry+for+today">Adding an entry for today<span><a href="#label-Adding+an+entry+for+today">¶</a> <a href="#top">↑</a></span></h4>
|
317
|
+
|
359
318
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
360
319
|
|
361
320
|
<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>
|
@@ -380,6 +339,40 @@ rake install</pre>
|
|
380
339
|
<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>
|
381
340
|
</pre>
|
382
341
|
|
342
|
+
<h4 id="label-Finding+a+past+entry">Finding a past entry<span><a href="#label-Finding+a+past+entry">¶</a> <a href="#top">↑</a></span></h4>
|
343
|
+
|
344
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
345
|
+
|
346
|
+
<span class="ruby-identifier">date</span> = <span class="ruby-constant">Date</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">2020</span>, <span class="ruby-value">04</span>, <span class="ruby-value">15</span>)
|
347
|
+
<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-identifier">date</span>).<span class="ruby-identifier">load</span>
|
348
|
+
<span class="ruby-identifier">entry</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">entries</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">date</span>)
|
349
|
+
</pre>
|
350
|
+
|
351
|
+
<h2 id="label-Vim">Vim<span><a href="#label-Vim">¶</a> <a href="#top">↑</a></span></h2>
|
352
|
+
|
353
|
+
<p>While there's no official support for vim, you can add this to your <code>vimrc</code> file, or something like <code>~/.vim/plugin/standup.vim</code>.</p>
|
354
|
+
|
355
|
+
<pre>command! -complete=custom,<SID>StandupCompletion -nargs=? -bang Standup
|
356
|
+
\ call <SID>OpenStandupFile(<bang>0, <f-args>)
|
357
|
+
|
358
|
+
function! s:StandupCompletion(...) abort
|
359
|
+
let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
|
360
|
+
if !isdirectory(l:dir) | return '' | endif
|
361
|
+
return join(map(glob(l:dir . '*.md', 0, 1), "fnamemodify(v:val, ':t')"), "\n")
|
362
|
+
endfunction
|
363
|
+
|
364
|
+
function! s:OpenStandupFile(split, ...)
|
365
|
+
let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
|
366
|
+
let l:file = a:0 ? a:1 : get(g:, 'standup_file', strftime('%Y_%m.md'))
|
367
|
+
call system('standup --no-edit')
|
368
|
+
execute a:split ? 'vsplit' : 'split' l:dir . l:file
|
369
|
+
endfunction</pre>
|
370
|
+
|
371
|
+
<p>This makes the <code>:Standup</code> command, which opens the standup file in a split, while <code>:Standup!</code> opens it in a vertical split. If a file is passed to the command, that file will be opened. There's tab completion for this. Lastly, it allows for a few variables to be set for customization.</p>
|
372
|
+
|
373
|
+
<pre>g:standup_dir = $HOME . '/.cache/standup_md' " the directory where your file are
|
374
|
+
g:standup_file = strftime('%Y_%m.md') " the file format to use</pre>
|
375
|
+
|
383
376
|
<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>
|
384
377
|
|
385
378
|
<p>If you have an idea or find a bug, please <a href="https://github.com/evanthegrayt/standup_md/issues/new">create an issue</a>. Just make sure the topic doesn't already exist. Better yet, you can always submit a Pull Request.</p>
|
@@ -394,7 +387,7 @@ rake install</pre>
|
|
394
387
|
|
395
388
|
<footer id="validator-badges" role="contentinfo">
|
396
389
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
397
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
390
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
398
391
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
399
392
|
</footer>
|
400
393
|
|