slk 0.12.0 → 0.12.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +24 -4
- data/lib/slk/commands/catchup.rb +8 -0
- data/lib/slk/commands/unread.rb +30 -14
- data/lib/slk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 709675ee0926af3aee4e201318382d1558d6a46e4ebd8158a6353ee0da49f670
|
|
4
|
+
data.tar.gz: 8b82f996a687811516b17c6fe164a0dcedffc0e199de0eacadab61f37918955d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ab37ace8886dd600f194faf26f96597e422f2d1252aaba09fafacf83fff77e549bd9bc69be059cd567c787a3b2b2e69e0fc84360ac42f186916c1ea8930fe5d
|
|
7
|
+
data.tar.gz: 68f5dcd8ca42484c6c9783de5c35d02e95755046a69b1b0184b62ed4a84aaedfe0a2067821d18572e5b1f821ad98fe45a2af8b438f44930626df433a5806c5e3
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.12.1] - 2026-10-06
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `slk unread --json` now prints exactly one valid JSON document, with no workspace name lines mixed in. With one workspace (or `-w`), it prints `{"channels": [...], "dms": [...]}` alone. With several, it prints an object keyed by workspace name: `{"oddball": {...}, "dsva": {...}}`. This changes the output shape for multi-workspace callers.
|
|
15
|
+
- `slk unread -w WS` and `slk catchup -w WS` now limit themselves to that workspace. Before, they defaulted to all workspaces and ignored `-w`.
|
|
16
|
+
- `slk unread` text output shows workspace name headers only when it covers more than one workspace.
|
|
17
|
+
|
|
10
18
|
## [0.12.0] - 2026-09-30
|
|
11
19
|
|
|
12
20
|
### Added
|
data/README.md
CHANGED
|
@@ -354,10 +354,30 @@ rake test
|
|
|
354
354
|
### Releasing
|
|
355
355
|
|
|
356
356
|
1. Update version in `lib/slk/version.rb`
|
|
357
|
-
2. Update `CHANGELOG.md`
|
|
358
|
-
3.
|
|
359
|
-
4.
|
|
360
|
-
5.
|
|
357
|
+
2. Update `CHANGELOG.md`: add a `## [X.Y.Z] - YYYY-MM-DD` heading under `## [Unreleased]` so the pending entries move into the release
|
|
358
|
+
3. Run `bundle install` so `Gemfile.lock` picks up the new version
|
|
359
|
+
4. Verify: `bundle exec rake test && bundle exec rubocop`
|
|
360
|
+
5. Commit version, changelog, and lockfile together, then push and wait for CI:
|
|
361
|
+
```bash
|
|
362
|
+
git commit -am "chore(release): prepare vX.Y.Z"
|
|
363
|
+
git push origin master
|
|
364
|
+
gh run watch --exit-status
|
|
365
|
+
```
|
|
366
|
+
6. Build, tag, and push the tag:
|
|
367
|
+
```bash
|
|
368
|
+
bundle exec rake build
|
|
369
|
+
git tag -a vX.Y.Z -m "Version X.Y.Z"
|
|
370
|
+
git push origin vX.Y.Z
|
|
371
|
+
```
|
|
372
|
+
7. Publish to RubyGems. `fnox exec` supplies `GEM_HOST_API_KEY` from `fnox.toml` (a stale key in `~/.gem/credentials` gets "Access Denied"); MFA is required, and `GEM_HOST_OTP_CODE` skips the prompt:
|
|
373
|
+
```bash
|
|
374
|
+
fnox exec -- sh -c 'GEM_HOST_OTP_CODE="$(op item get Rubygems --otp)" gem push pkg/slk-X.Y.Z.gem'
|
|
375
|
+
```
|
|
376
|
+
8. Create the GitHub Release with the changelog entry as notes:
|
|
377
|
+
```bash
|
|
378
|
+
awk '/^## \[X.Y.Z\]/{f=1;next} /^## \[/{f=0} f' CHANGELOG.md | sed '/./,$!d' > /tmp/notes.md
|
|
379
|
+
gh release create vX.Y.Z --title vX.Y.Z --notes-file /tmp/notes.md
|
|
380
|
+
```
|
|
361
381
|
|
|
362
382
|
## License
|
|
363
383
|
|
data/lib/slk/commands/catchup.rb
CHANGED
|
@@ -90,6 +90,14 @@ module Slk
|
|
|
90
90
|
|
|
91
91
|
private
|
|
92
92
|
|
|
93
|
+
# Catchup defaults to every workspace, but -w names one: let it win, or
|
|
94
|
+
# `slk catchup -w oddball` quietly walks (or batch-clears) all of them.
|
|
95
|
+
def target_workspaces
|
|
96
|
+
return [runner.workspace(@options[:workspace])] if @options[:workspace]
|
|
97
|
+
|
|
98
|
+
super
|
|
99
|
+
end
|
|
100
|
+
|
|
93
101
|
def batch_catchup
|
|
94
102
|
target_workspaces.each { |ws| batch_mark_workspace(ws) }
|
|
95
103
|
0
|
data/lib/slk/commands/unread.rb
CHANGED
|
@@ -95,22 +95,38 @@ module Slk
|
|
|
95
95
|
|
|
96
96
|
private
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
# Unread defaults to every workspace, but -w names one: let it win, or
|
|
99
|
+
# `slk unread -w oddball` quietly reports on all of them.
|
|
100
|
+
def target_workspaces
|
|
101
|
+
return [runner.workspace(@options[:workspace])] if @options[:workspace]
|
|
101
102
|
|
|
102
|
-
|
|
103
|
+
super
|
|
104
|
+
end
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
def show_unread
|
|
107
|
+
return show_unread_json if @options[:json]
|
|
108
|
+
|
|
109
|
+
workspaces = target_workspaces
|
|
110
|
+
workspaces.each do |workspace|
|
|
111
|
+
puts output.bold(workspace.name) if workspaces.size > 1
|
|
112
|
+
display_unread(workspace, fetch_unread_data(workspace))
|
|
109
113
|
end
|
|
110
114
|
|
|
111
115
|
0
|
|
112
116
|
end
|
|
113
117
|
|
|
118
|
+
# Exactly one JSON document: one workspace prints its {channels, dms}
|
|
119
|
+
# alone; several are keyed by workspace name. No name headers, so the
|
|
120
|
+
# output pipes straight into jq.
|
|
121
|
+
def show_unread_json
|
|
122
|
+
workspaces = target_workspaces
|
|
123
|
+
documents = workspaces.to_h do |workspace|
|
|
124
|
+
[workspace.name, unread_json(workspace, fetch_unread_data(workspace))]
|
|
125
|
+
end
|
|
126
|
+
output_json(workspaces.size == 1 ? documents.values.first : documents)
|
|
127
|
+
0
|
|
128
|
+
end
|
|
129
|
+
|
|
114
130
|
def fetch_unread_data(workspace)
|
|
115
131
|
counts = runner.client_api(workspace.name).counts
|
|
116
132
|
muted_ids = fetch_muted_ids(workspace)
|
|
@@ -135,11 +151,11 @@ module Slk
|
|
|
135
151
|
.reject { |c| muted_ids.include?(c['id']) }
|
|
136
152
|
end
|
|
137
153
|
|
|
138
|
-
def
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
154
|
+
def unread_json(workspace, data)
|
|
155
|
+
{
|
|
156
|
+
channels: data[:unread_channels].map { |c| format_channel_json(workspace, c) },
|
|
157
|
+
dms: data[:unread_ims].map { |i| format_dm_json(workspace, i) }
|
|
158
|
+
}
|
|
143
159
|
end
|
|
144
160
|
|
|
145
161
|
def format_channel_json(workspace, channel)
|
data/lib/slk/version.rb
CHANGED