standup_md 2.0.0 → 2.1.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/.ruby-version +1 -0
- data/Gemfile.lock +5 -2
- data/README.md +27 -17
- data/Rakefile +8 -48
- data/SLACK_SETUP_GUIDE.md +82 -0
- data/completion/zsh/_standup +2 -0
- data/lib/standup_md/cli/helpers.rb +67 -20
- data/lib/standup_md/cli.rb +8 -3
- data/lib/standup_md/config/cli.rb +10 -0
- data/lib/standup_md/version.rb +1 -1
- data/standup_md.gemspec +1 -0
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d76ddd28cf3a01f84583cb1a9a03ac2b4731b0e5f977e400e88bfa382f456582
|
|
4
|
+
data.tar.gz: a227c637b17cbc82a32b3d98cb0dc2de93c23861c41635049681e489515a87f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ebc8045842abc5356997c8fa38f5cff05350946cb854528f68ec88714e15b7853cfbcf1a5c6663dae138de0c26b14ec007fca0c62a11279217b35dcda1ae8af3
|
|
7
|
+
data.tar.gz: 2eefdcfae08a7e983a0b9d232795ab501b19ada60c159ad7c5c6fbda9956f1b51d4c521f20bf6ab669be1871199376362b5d05303a303b5bcf2802b08193d6cc
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.0.4
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
standup_md (2.
|
|
4
|
+
standup_md (2.1.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
@@ -49,6 +49,7 @@ GEM
|
|
|
49
49
|
rubocop (>= 1.75.0, < 2.0)
|
|
50
50
|
rubocop-ast (>= 1.47.1, < 2.0)
|
|
51
51
|
ruby-progressbar (1.13.0)
|
|
52
|
+
semverve (0.1.0)
|
|
52
53
|
simplecov (0.22.0)
|
|
53
54
|
docile (~> 1.1)
|
|
54
55
|
simplecov-html (~> 0.11)
|
|
@@ -82,6 +83,7 @@ PLATFORMS
|
|
|
82
83
|
DEPENDENCIES
|
|
83
84
|
rake (~> 13.0, >= 13.0.1)
|
|
84
85
|
rdoc
|
|
86
|
+
semverve
|
|
85
87
|
simplecov
|
|
86
88
|
standard (~> 1.54.0)
|
|
87
89
|
standup_md!
|
|
@@ -109,13 +111,14 @@ CHECKSUMS
|
|
|
109
111
|
rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035
|
|
110
112
|
rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834
|
|
111
113
|
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
114
|
+
semverve (0.1.0) sha256=cda51f2cc148af0a163ac5b25616ff3c3d20fc5aa9f036a7f2910e20ee3058b6
|
|
112
115
|
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
|
|
113
116
|
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
|
|
114
117
|
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
|
|
115
118
|
standard (1.54.0) sha256=7a4b08f83d9893083c8f03bc486f0feeb6a84d48233b40829c03ef4767ea0100
|
|
116
119
|
standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b
|
|
117
120
|
standard-performance (1.9.0) sha256=49483d31be448292951d80e5e67cdcb576c2502103c7b40aec6f1b6e9c88e3f2
|
|
118
|
-
standup_md (2.
|
|
121
|
+
standup_md (2.1.0)
|
|
119
122
|
stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
|
|
120
123
|
test-unit (3.7.8) sha256=689d1ca53f4d46f678b4e5d68d8e4294f87fc5e8b9238cc4de7c5727e8d65943
|
|
121
124
|
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# The Standup Doctor
|
|
2
2
|
<!-- vi: set ts=4 sw=4 : -->
|
|
3
3
|
[](https://actions-badge.atrox.dev/evanthegrayt/standup_md/goto?ref=master)
|
|
4
|
+
[](https://www.ruby-lang.org/)
|
|
4
5
|
[](https://rubygems.org/gems/standup_md)
|
|
5
|
-

|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
8
|
> The cure for all your standup woes.
|
|
@@ -19,7 +19,8 @@ client, such as Slack, Mattermost, or Riot. Typing out my standup every day
|
|
|
19
19
|
became tedious, as I'd have to look up what I did the day before, copy and paste
|
|
20
20
|
yesterday's work into a new entry, and add today's tasks. This gem automates
|
|
21
21
|
most of this process, along with providing means of opening the file in your
|
|
22
|
-
editor,
|
|
22
|
+
editor, finding and displaying entries from the command line, and posting
|
|
23
|
+
today's standup directly to a chat client.
|
|
23
24
|
|
|
24
25
|
In a nutshell, calling `standup` from the command line will open a standup file
|
|
25
26
|
for the current month in your preferred editor. If an entry for today is already
|
|
@@ -125,6 +126,13 @@ file:
|
|
|
125
126
|
- None
|
|
126
127
|
```
|
|
127
128
|
|
|
129
|
+
Impediments are not carried forward by default. To copy the previous entry's
|
|
130
|
+
impediments into a new entry, pass `-i` or `--carry-forward-impediments`.
|
|
131
|
+
|
|
132
|
+
```sh
|
|
133
|
+
standup -i
|
|
134
|
+
```
|
|
135
|
+
|
|
128
136
|
#### Copy the entry for today to clipboard
|
|
129
137
|
There are also flags that will print entries to the command line. There's a full
|
|
130
138
|
list of features below, but as a quick example, you can copy today's entry to
|
|
@@ -219,6 +227,7 @@ StandupMD.configure do |c|
|
|
|
219
227
|
c.cli.post_adapter = nil
|
|
220
228
|
c.cli.post_channel = nil
|
|
221
229
|
c.cli.auto_fill_previous = true
|
|
230
|
+
c.cli.carry_forward_impediments = false
|
|
222
231
|
c.cli.preference_file = ::File.expand_path(::File.join(ENV["HOME"], ".standuprc"))
|
|
223
232
|
|
|
224
233
|
# Defaults for posting standups to chat clients.
|
|
@@ -251,6 +260,8 @@ follows.
|
|
|
251
260
|
-d, --directory DIRECTORY The directory where standup files are located
|
|
252
261
|
-w, --[no-]write Write current entry if it doesn't exist. Default is true
|
|
253
262
|
-a, --[no-]auto-fill-previous Auto-generate 'previous' tasks for new entries
|
|
263
|
+
-i, --[no-]carry-forward-impediments
|
|
264
|
+
Carry impediments forward for new entries
|
|
254
265
|
-e, --[no-]edit Open the file in the editor. Default is true
|
|
255
266
|
-v, --[no-]verbose Verbose output. Default is false.
|
|
256
267
|
--zsh-completion Print zsh completion setup instructions
|
|
@@ -263,6 +274,9 @@ follows.
|
|
|
263
274
|
```
|
|
264
275
|
|
|
265
276
|
#### Posting and Secrets
|
|
277
|
+
For a real-world example of how to get the Slack integration working, see [the
|
|
278
|
+
guide](SLACK_SETUP_GUIDE.md).
|
|
279
|
+
|
|
266
280
|
The built-in Slack adapter sends the rendered markdown entry to Slack's
|
|
267
281
|
`chat.postMessage` API. It needs a Slack token with the `chat:write` scope and a
|
|
268
282
|
channel or conversation. Channel-like IDs such as `C123456`, `G123456`, and
|
|
@@ -426,11 +440,11 @@ markdown = parser.render(entries, start_date: entries.first.date, end_date: entr
|
|
|
426
440
|
runtime = StandupMD.config.copy
|
|
427
441
|
runtime.file.directory = "/tmp/request-standups"
|
|
428
442
|
runtime.entry.current = ["Work scoped to this request"]
|
|
443
|
+
runtime.cli.carry_forward_impediments = true
|
|
429
444
|
|
|
430
|
-
|
|
431
|
-
entry =
|
|
432
|
-
|
|
433
|
-
file.write
|
|
445
|
+
cli = StandupMD::Cli.new(["--no-edit"], config: runtime)
|
|
446
|
+
entry = cli.entry
|
|
447
|
+
cli.write_file
|
|
434
448
|
```
|
|
435
449
|
|
|
436
450
|
### API Examples
|
|
@@ -505,14 +519,10 @@ g:standup_dir = $HOME . '/.cache/standup_md' " the directory where your files ar
|
|
|
505
519
|
g:standup_file = strftime('%Y_%m.md') " the file format to use
|
|
506
520
|
```
|
|
507
521
|
|
|
508
|
-
##
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
I do these projects for fun, and I enjoy knowing that they're helpful to people.
|
|
516
|
-
Consider starring [the repository](https://github.com/evanthegrayt/standup_md)
|
|
517
|
-
if you like it! If you love it, follow me [on
|
|
518
|
-
Github](https://github.com/evanthegrayt)!
|
|
522
|
+
## Support this project
|
|
523
|
+
I love knowing when people find my work useful. Any kind of support is very much
|
|
524
|
+
appreciated!
|
|
525
|
+
|
|
526
|
+
- ⭐️ Like the project? Star [the repository](https://github.com/evanthegrayt/standup_md)!
|
|
527
|
+
- ❤️ Love the project? Follow me [on GitHub](https://github.com/evanthegrayt)!
|
|
528
|
+
- 💸 *Really* love it? Consider [buying me a tea](https://paypal.me/evanrgray)!
|
data/Rakefile
CHANGED
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
$LOAD_PATH.unshift(File.expand_path("lib", __dir__))
|
|
4
4
|
|
|
5
|
-
require "standup_md"
|
|
6
5
|
require "bundler/gem_tasks"
|
|
7
6
|
require "rdoc/task"
|
|
8
7
|
require "rake/testtask"
|
|
8
|
+
require "semverve/task"
|
|
9
|
+
require "standup_md"
|
|
9
10
|
|
|
10
11
|
STANDARD_FILES = ["lib", "test"].freeze
|
|
11
12
|
|
|
13
|
+
Semverve::Task.new do |t|
|
|
14
|
+
t.bundle_lock = true
|
|
15
|
+
end
|
|
16
|
+
|
|
12
17
|
Rake::TestTask.new do |t|
|
|
13
18
|
t.libs = ["lib"]
|
|
14
19
|
t.warning = true
|
|
@@ -22,6 +27,8 @@ RDoc::Task.new do |rdoc|
|
|
|
22
27
|
rdoc.rdoc_files.include("README.md", "lib/**/*.rb")
|
|
23
28
|
end
|
|
24
29
|
|
|
30
|
+
task default: :test
|
|
31
|
+
|
|
25
32
|
desc "Lint with the Standard Ruby style guide"
|
|
26
33
|
task :standard do
|
|
27
34
|
require "standard"
|
|
@@ -37,50 +44,3 @@ task :"standard:fix" do
|
|
|
37
44
|
exit_code = Standard::Cli.new(STANDARD_FILES + ["--fix"]).run
|
|
38
45
|
fail unless exit_code.zero?
|
|
39
46
|
end
|
|
40
|
-
|
|
41
|
-
task default: :test
|
|
42
|
-
|
|
43
|
-
namespace :version do
|
|
44
|
-
desc "Print the current version from the version.rb file"
|
|
45
|
-
task :current do
|
|
46
|
-
puts StandupMD::VERSION
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
namespace :increment do
|
|
50
|
-
desc "Increment the version's PATCH level"
|
|
51
|
-
task :patch do
|
|
52
|
-
File.join(__dir__, "lib", "standup_md", "version.rb").then do |version_file|
|
|
53
|
-
File.write(
|
|
54
|
-
version_file,
|
|
55
|
-
File.read(version_file).sub(/(PATCH\s=\s)(\d+)/) { "#{$1}#{$2.next}" }
|
|
56
|
-
)
|
|
57
|
-
end
|
|
58
|
-
system("bundle lock")
|
|
59
|
-
end
|
|
60
|
-
desc "Increment the version's MINOR level"
|
|
61
|
-
task :minor do
|
|
62
|
-
File.join(__dir__, "lib", "standup_md", "version.rb").then do |version_file|
|
|
63
|
-
File.write(
|
|
64
|
-
version_file,
|
|
65
|
-
File.read(version_file)
|
|
66
|
-
.sub(/(PATCH\s=\s)(\d+)/) { "#{$1}0" }
|
|
67
|
-
.sub(/(MINOR\s=\s)(\d+)/) { "#{$1}#{$2.next}" }
|
|
68
|
-
)
|
|
69
|
-
end
|
|
70
|
-
system("bundle lock")
|
|
71
|
-
end
|
|
72
|
-
desc "Increment the version's MAJOR level"
|
|
73
|
-
task :major do
|
|
74
|
-
File.join(__dir__, "lib", "standup_md", "version.rb").then do |version_file|
|
|
75
|
-
File.write(
|
|
76
|
-
version_file,
|
|
77
|
-
File.read(version_file)
|
|
78
|
-
.sub(/(PATCH\s=\s)(\d+)/) { "#{$1}0" }
|
|
79
|
-
.sub(/(MINOR\s=\s)(\d+)/) { "#{$1}0" }
|
|
80
|
-
.sub(/(MAJOR\s=\s)(\d+)/) { "#{$1}#{$2.next}" }
|
|
81
|
-
)
|
|
82
|
-
end
|
|
83
|
-
system("bundle lock")
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Slack Setup for StandupMD Posting
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
Create a private Slack app for your workspace, give its bot permission to post
|
|
5
|
+
messages, install it, copy the bot token, invite the bot to `#general`, and
|
|
6
|
+
configure StandupMD with the bot token plus the channel ID.
|
|
7
|
+
|
|
8
|
+
Workflow last tested and validated 2026-06-27.
|
|
9
|
+
|
|
10
|
+
## Assumptions
|
|
11
|
+
- You only need to post your standup into one Slack channel.
|
|
12
|
+
- The app is just for your own workspace, not a public Slack Marketplace app.
|
|
13
|
+
- `chat:write` plus inviting the bot to `#general` is the preferred setup.
|
|
14
|
+
- `chat:write.public` is not needed unless you want posting to public channels
|
|
15
|
+
without inviting the bot first.
|
|
16
|
+
|
|
17
|
+
## Exact Slack Steps
|
|
18
|
+
1. From the screen in your screenshot, click **Create an App**.
|
|
19
|
+
2. Choose **From scratch**.
|
|
20
|
+
3. Set:
|
|
21
|
+
- **App Name:** `StandupMD`
|
|
22
|
+
- **Pick a workspace:** choose the workspace where `#general` lives
|
|
23
|
+
4. Click **Create App**.
|
|
24
|
+
5. In the app sidebar, go to **OAuth & Permissions**.
|
|
25
|
+
6. Under **Scopes** → **Bot Token Scopes**, add:
|
|
26
|
+
- `chat:write`
|
|
27
|
+
7. Optional: add `chat:write.public` only if you want the bot to post to public
|
|
28
|
+
channels without being invited first. For the simplest and safest setup, skip
|
|
29
|
+
this and invite the bot to the channel.
|
|
30
|
+
8. Scroll up and click **Install to Workspace**.
|
|
31
|
+
9. Approve the installation.
|
|
32
|
+
10. After installation, stay on **OAuth & Permissions** and copy the **Bot User
|
|
33
|
+
OAuth Token**.
|
|
34
|
+
- It should start with `xoxb-`.
|
|
35
|
+
- Do not use an `xoxp-` user token.
|
|
36
|
+
- Do not use an app configuration token.
|
|
37
|
+
|
|
38
|
+
## Channel Setup
|
|
39
|
+
1. In Slack, go to `#general`.
|
|
40
|
+
2. Invite the app/bot:
|
|
41
|
+
```text
|
|
42
|
+
/invite @StandupMD
|
|
43
|
+
```
|
|
44
|
+
3. Get the channel ID for `#general`.
|
|
45
|
+
- Open `#general`.
|
|
46
|
+
- Click the channel name at the top.
|
|
47
|
+
- Look for **Copy channel ID** in the details or more/options menu.
|
|
48
|
+
- The ID should look like `C1234567890`.
|
|
49
|
+
|
|
50
|
+
Prefer using the channel ID over `#general` when configuring StandupMD, as the
|
|
51
|
+
name can change but the ID won't.
|
|
52
|
+
|
|
53
|
+
## StandupMD Values
|
|
54
|
+
Set your token in the shell:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
export STANDUP_MD_SLACK_TOKEN="xoxb-your-bot-token"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Post with the channel ID:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
standup -P slack --post-channel C1234567890
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Optional config in `~/.standuprc`:
|
|
67
|
+
|
|
68
|
+
```ruby
|
|
69
|
+
StandupMD.configure do |c|
|
|
70
|
+
c.post.configure_adapter(:slack, channel: "C1234567890")
|
|
71
|
+
c.post.title = "%s -- YOUR NAME"
|
|
72
|
+
end
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then you can run:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
standup -P
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If you have multiple users using the same bot, the `c.post.title` is important
|
|
82
|
+
to specify the user posting the standup, since the bot's name is `StandupMD`.
|
data/completion/zsh/_standup
CHANGED
|
@@ -66,6 +66,8 @@ _arguments -s -S \
|
|
|
66
66
|
'(-w --write --no-write)--no-write[do not write current entry if it does not exist]' \
|
|
67
67
|
'(-a --auto-fill-previous --no-auto-fill-previous)'{-a,--auto-fill-previous}'[auto-generate previous tasks for new entries]' \
|
|
68
68
|
'(-a --auto-fill-previous --no-auto-fill-previous)--no-auto-fill-previous[do not auto-generate previous tasks for new entries]' \
|
|
69
|
+
'(-i --carry-forward-impediments --no-carry-forward-impediments)'{-i,--carry-forward-impediments}'[carry impediments forward for new entries]' \
|
|
70
|
+
'(-i --carry-forward-impediments --no-carry-forward-impediments)--no-carry-forward-impediments[do not carry impediments forward for new entries]' \
|
|
69
71
|
'(-e --edit --no-edit)'{-e,--edit}'[open the file in the editor]' \
|
|
70
72
|
'(-e --edit --no-edit)--no-edit[do not open the file in the editor]' \
|
|
71
73
|
'(-v --verbose --no-verbose)'{-v,--verbose}'[use verbose output]' \
|
|
@@ -61,7 +61,10 @@ module StandupMD
|
|
|
61
61
|
opts.on(
|
|
62
62
|
"--current ARRAY", Array,
|
|
63
63
|
"List of current entry's tasks"
|
|
64
|
-
)
|
|
64
|
+
) do |v|
|
|
65
|
+
@current_option_passed = true
|
|
66
|
+
config.entry.current = v
|
|
67
|
+
end
|
|
65
68
|
|
|
66
69
|
opts.on(
|
|
67
70
|
"--previous ARRAY", Array,
|
|
@@ -98,6 +101,11 @@ module StandupMD
|
|
|
98
101
|
"Auto-generate 'previous' tasks for new entries. Default is true"
|
|
99
102
|
) { |v| config.cli.auto_fill_previous = v }
|
|
100
103
|
|
|
104
|
+
opts.on(
|
|
105
|
+
"-i", "--[no-]carry-forward-impediments",
|
|
106
|
+
"Carry impediments forward for new entries. Default is false"
|
|
107
|
+
) { |v| config.cli.carry_forward_impediments = v }
|
|
108
|
+
|
|
101
109
|
opts.on(
|
|
102
110
|
"-e", "--[no-]edit",
|
|
103
111
|
"Open the file in the editor. Default is true"
|
|
@@ -157,13 +165,17 @@ module StandupMD
|
|
|
157
165
|
# @return [StandupMD::Entry]
|
|
158
166
|
def new_entry(file)
|
|
159
167
|
entry = file.entries.find(config.cli.date)
|
|
160
|
-
return entry if read_only? ||
|
|
168
|
+
return entry if read_only? || config.cli.date != Date.today
|
|
169
|
+
if entry
|
|
170
|
+
append_current_entry(entry) if current_option_passed?
|
|
171
|
+
return entry
|
|
172
|
+
end
|
|
161
173
|
|
|
162
174
|
StandupMD::Entry.new(
|
|
163
175
|
config.cli.date,
|
|
164
176
|
config.entry.current,
|
|
165
177
|
previous_entry(file),
|
|
166
|
-
|
|
178
|
+
impediments_entry(file),
|
|
167
179
|
config.entry.notes
|
|
168
180
|
).tap { |e| file.entries << e }
|
|
169
181
|
end
|
|
@@ -174,12 +186,29 @@ module StandupMD
|
|
|
174
186
|
# @return [Array]
|
|
175
187
|
def previous_entry(file)
|
|
176
188
|
return config.entry.previous unless config.cli.auto_fill_previous
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
189
|
+
|
|
190
|
+
carry_forward_tasks(file, fallback: []) { |entry| entry.current_tasks }
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
##
|
|
194
|
+
# The "impediments" tasks.
|
|
195
|
+
#
|
|
196
|
+
# @return [Array]
|
|
197
|
+
def impediments_entry(file)
|
|
198
|
+
return config.entry.impediments unless config.cli.carry_forward_impediments
|
|
199
|
+
|
|
200
|
+
carry_forward_tasks(file, fallback: config.entry.impediments) do |entry|
|
|
201
|
+
entry.impediments_tasks
|
|
180
202
|
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def append_current_entry(entry)
|
|
206
|
+
current = entry.section(:current)
|
|
207
|
+
config.entry.current.each { |task| current << task }
|
|
208
|
+
end
|
|
181
209
|
|
|
182
|
-
|
|
210
|
+
def current_option_passed?
|
|
211
|
+
@current_option_passed
|
|
183
212
|
end
|
|
184
213
|
|
|
185
214
|
##
|
|
@@ -201,14 +230,19 @@ module StandupMD
|
|
|
201
230
|
raise OptionParser::InvalidArgument, value
|
|
202
231
|
end
|
|
203
232
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
233
|
+
def carry_forward_tasks(file, fallback:)
|
|
234
|
+
entry = carry_forward_entry(file)
|
|
235
|
+
entry.nil? ? fallback : yield(entry)
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
def carry_forward_entry(file)
|
|
239
|
+
carry_forward_entries(file).last
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
def carry_forward_entries(file)
|
|
243
|
+
return file.entries unless file.new?
|
|
244
|
+
|
|
245
|
+
find_previous_month_file&.load&.entries || file.entries
|
|
212
246
|
end
|
|
213
247
|
|
|
214
248
|
##
|
|
@@ -217,14 +251,27 @@ module StandupMD
|
|
|
217
251
|
# @param [StandupMD::Config::File] config
|
|
218
252
|
#
|
|
219
253
|
# @return [StandupMD::File]
|
|
220
|
-
def
|
|
254
|
+
def previous_month_file(config: self.config.file)
|
|
221
255
|
StandupMD::File.find_by_date(Date.today.prev_month, config: config)
|
|
222
256
|
end
|
|
223
257
|
|
|
224
|
-
def
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
258
|
+
def previous_month_file?
|
|
259
|
+
::File.file?(previous_month_file_path)
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
def find_previous_month_file
|
|
263
|
+
return nil unless previous_month_file?
|
|
264
|
+
|
|
265
|
+
without_file_creation do |file_config|
|
|
266
|
+
previous_month_file(config: file_config)
|
|
267
|
+
end
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
def previous_month_file_path
|
|
271
|
+
::File.join(
|
|
272
|
+
config.file.directory,
|
|
273
|
+
Date.today.prev_month.strftime(config.file.name_format)
|
|
274
|
+
)
|
|
228
275
|
end
|
|
229
276
|
|
|
230
277
|
##
|
data/lib/standup_md/cli.rb
CHANGED
|
@@ -127,16 +127,21 @@ module StandupMD
|
|
|
127
127
|
# Constructor. Sets defaults.
|
|
128
128
|
#
|
|
129
129
|
# @param [Array] options
|
|
130
|
-
|
|
130
|
+
#
|
|
131
|
+
# @param [Boolean] load_config
|
|
132
|
+
#
|
|
133
|
+
# @param [StandupMD::Config, nil] config
|
|
134
|
+
def initialize(options = [], load_config: true, config: nil)
|
|
131
135
|
@config = nil
|
|
132
136
|
@preference_file_loaded = false
|
|
133
137
|
@file_date_argument = false
|
|
138
|
+
@current_option_passed = false
|
|
134
139
|
@zsh_completion_requested = false
|
|
135
140
|
@options = options
|
|
136
141
|
return if load_zsh_completion_request(options)
|
|
137
142
|
|
|
138
|
-
load_preferences if load_config
|
|
139
|
-
@config = StandupMD.config.copy
|
|
143
|
+
load_preferences if load_config && config.nil?
|
|
144
|
+
@config = config.nil? ? StandupMD.config.copy : config.copy
|
|
140
145
|
load_runtime_preferences(options)
|
|
141
146
|
return if zsh_completion_requested?
|
|
142
147
|
|
|
@@ -22,6 +22,7 @@ module StandupMD
|
|
|
22
22
|
post_adapter: nil,
|
|
23
23
|
post_channel: nil,
|
|
24
24
|
auto_fill_previous: true,
|
|
25
|
+
carry_forward_impediments: false,
|
|
25
26
|
preference_file: ::File.expand_path(
|
|
26
27
|
::File.join(ENV["HOME"], ".standuprc")
|
|
27
28
|
)
|
|
@@ -123,6 +124,15 @@ module StandupMD
|
|
|
123
124
|
# @return [Boolean]
|
|
124
125
|
attr_accessor :auto_fill_previous
|
|
125
126
|
|
|
127
|
+
##
|
|
128
|
+
# When writing a new entry, should impediments be pulled from the last
|
|
129
|
+
# entry?
|
|
130
|
+
#
|
|
131
|
+
# @param [Boolean] carry_forward_impediments
|
|
132
|
+
#
|
|
133
|
+
# @return [Boolean]
|
|
134
|
+
attr_accessor :carry_forward_impediments
|
|
135
|
+
|
|
126
136
|
##
|
|
127
137
|
# Initializes the config with default values.
|
|
128
138
|
def initialize
|
data/lib/standup_md/version.rb
CHANGED
data/standup_md.gemspec
CHANGED
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
spec.require_paths = ["lib"]
|
|
33
33
|
spec.add_development_dependency "rake", "~> 13.0", ">= 13.0.1"
|
|
34
34
|
spec.add_development_dependency "rdoc"
|
|
35
|
+
spec.add_development_dependency "semverve"
|
|
35
36
|
spec.add_development_dependency "simplecov"
|
|
36
37
|
spec.add_development_dependency "standard", "~> 1.54.0"
|
|
37
38
|
spec.add_development_dependency "test-unit", "~> 3.3", ">= 3.3.5"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: standup_md
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Evan Gray
|
|
@@ -43,6 +43,20 @@ dependencies:
|
|
|
43
43
|
- - ">="
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
45
|
version: '0'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: semverve
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
requirements:
|
|
50
|
+
- - ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '0'
|
|
53
|
+
type: :development
|
|
54
|
+
prerelease: false
|
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
46
60
|
- !ruby/object:Gem::Dependency
|
|
47
61
|
name: simplecov
|
|
48
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -100,11 +114,13 @@ extra_rdoc_files: []
|
|
|
100
114
|
files:
|
|
101
115
|
- ".github/workflows/ruby.yml"
|
|
102
116
|
- ".gitignore"
|
|
117
|
+
- ".ruby-version"
|
|
103
118
|
- Gemfile
|
|
104
119
|
- Gemfile.lock
|
|
105
120
|
- LICENSE
|
|
106
121
|
- README.md
|
|
107
122
|
- Rakefile
|
|
123
|
+
- SLACK_SETUP_GUIDE.md
|
|
108
124
|
- _config.yml
|
|
109
125
|
- bin/standup
|
|
110
126
|
- completion/zsh/_standup
|