standup_md 2.0.0 → 2.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47c9542a3be072fc9067823aeeaf6c41741e657f7c628476cf1811c3699978f0
4
- data.tar.gz: 165f18178d4e7038f2c2511e0b7e0e907671c6819f9158fc601c29ebd18ac3be
3
+ metadata.gz: d5b3c3f8fe55eadcdc0ae76de9cb745bfe0c557c2c715884fd1056403fba31f1
4
+ data.tar.gz: d7191750ade93198d7a432762eb3327425a0dcb632389dc90ba6216735b941f2
5
5
  SHA512:
6
- metadata.gz: e56ad3a3e3e633f235af7078708ebb27f1a184cd6a0bd94a1b52299e82de2b75842f169e9495003f26c49907a9f0eb9b5c8d52511bf6cc39e1978f60848a2ca8
7
- data.tar.gz: 043a1a0119e0921196840fae06143f33a87dbbe4e9b62c381c671defd1695c6e1d5694174872a15932b63c42119dd19764cff992cd3c0f456220f0c9474d15d6
6
+ metadata.gz: 1cc3f477255e687f122e018ce1e4d31e6ca0ca7d9c16a003c463324230e68e528a97fc08a52194fa98965ae9ca82bfd963d0343f3b38f12526b5f8bb276b832b
7
+ data.tar.gz: c0291b6fabd240ac6b292b4e97c2e5c97ed74afd8675b0274295129625326b94ae2a866ff1dabf89a5e91678537b09b572ab677cc6c87bdbb80d8a2e6e36d401
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standup_md (2.0.0)
4
+ standup_md (2.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -115,7 +115,7 @@ CHECKSUMS
115
115
  standard (1.54.0) sha256=7a4b08f83d9893083c8f03bc486f0feeb6a84d48233b40829c03ef4767ea0100
116
116
  standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b
117
117
  standard-performance (1.9.0) sha256=49483d31be448292951d80e5e67cdcb576c2502103c7b40aec6f1b6e9c88e3f2
118
- standup_md (2.0.0)
118
+ standup_md (2.0.1)
119
119
  stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
120
120
  test-unit (3.7.8) sha256=689d1ca53f4d46f678b4e5d68d8e4294f87fc5e8b9238cc4de7c5727e8d65943
121
121
  tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
data/README.md CHANGED
@@ -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, and finding and displaying entries from the command line.
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
@@ -263,6 +264,9 @@ follows.
263
264
  ```
264
265
 
265
266
  #### Posting and Secrets
267
+ For a real-world example of how to get the Slack integration working, see [the
268
+ guide](SLACK_SETUP_GUIDE.md).
269
+
266
270
  The built-in Slack adapter sends the rendered markdown entry to Slack's
267
271
  `chat.postMessage` API. It needs a Slack token with the `chat:write` scope and a
268
272
  channel or conversation. Channel-like IDs such as `C123456`, `G123456`, and
@@ -505,14 +509,10 @@ g:standup_dir = $HOME . '/.cache/standup_md' " the directory where your files ar
505
509
  g:standup_file = strftime('%Y_%m.md') " the file format to use
506
510
  ```
507
511
 
508
- ## Reporting Bugs and Requesting Features
509
- If you have an idea or find a bug, please [create an
510
- issue](https://github.com/evanthegrayt/standup_md/issues/new). Just make sure
511
- the topic doesn't already exist. Better yet, you can always submit a Pull
512
- Request.
513
-
514
- ## Self-Promotion
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)!
512
+ ## Support this project
513
+ I love knowing when people find my work useful. Any kind of support is very much
514
+ appreciated!
515
+
516
+ - ⭐️ Like the project? Star [the repository](https://github.com/evanthegrayt/standup_md)!
517
+ - ❤️ Love the project? Follow me [on GitHub](https://github.com/evanthegrayt)!
518
+ - 💸 *Really* love it? Consider [buying me a tea](https://paypal.me/evanrgray)!
@@ -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`.
@@ -61,7 +61,10 @@ module StandupMD
61
61
  opts.on(
62
62
  "--current ARRAY", Array,
63
63
  "List of current entry's tasks"
64
- ) { |v| config.entry.current = v }
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,
@@ -157,7 +160,11 @@ module StandupMD
157
160
  # @return [StandupMD::Entry]
158
161
  def new_entry(file)
159
162
  entry = file.entries.find(config.cli.date)
160
- return entry if read_only? || entry || config.cli.date != Date.today
163
+ return entry if read_only? || config.cli.date != Date.today
164
+ if entry
165
+ append_current_entry(entry) if current_option_passed?
166
+ return entry
167
+ end
161
168
 
162
169
  StandupMD::Entry.new(
163
170
  config.cli.date,
@@ -182,6 +189,15 @@ module StandupMD
182
189
  prev_entry_tasks(file.entries)
183
190
  end
184
191
 
192
+ def append_current_entry(entry)
193
+ current = entry.section(:current)
194
+ config.entry.current.each { |task| current << task }
195
+ end
196
+
197
+ def current_option_passed?
198
+ @current_option_passed
199
+ end
200
+
185
201
  ##
186
202
  # Parses the optional file date argument.
187
203
  #
@@ -131,6 +131,7 @@ module StandupMD
131
131
  @config = nil
132
132
  @preference_file_loaded = false
133
133
  @file_date_argument = false
134
+ @current_option_passed = false
134
135
  @zsh_completion_requested = false
135
136
  @options = options
136
137
  return if load_zsh_completion_request(options)
@@ -21,7 +21,7 @@ module StandupMD
21
21
  # Patch version.
22
22
  #
23
23
  # @return [Integer]
24
- PATCH = 0
24
+ PATCH = 1
25
25
 
26
26
  ##
27
27
  # Version as +[MAJOR, MINOR, PATCH]+
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.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Gray
@@ -105,6 +105,7 @@ files:
105
105
  - LICENSE
106
106
  - README.md
107
107
  - Rakefile
108
+ - SLACK_SETUP_GUIDE.md
108
109
  - _config.yml
109
110
  - bin/standup
110
111
  - completion/zsh/_standup