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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: daeb158ed43f78f1945fe8b66d24d9e9566096d560d7981d49827006f02e95c0
4
- data.tar.gz: 30061321cb8d8e2476aa75897fe0830f557eb24f818360db74e9184a74eaaa72
3
+ metadata.gz: 709675ee0926af3aee4e201318382d1558d6a46e4ebd8158a6353ee0da49f670
4
+ data.tar.gz: 8b82f996a687811516b17c6fe164a0dcedffc0e199de0eacadab61f37918955d
5
5
  SHA512:
6
- metadata.gz: 7e69f27340cd5072b22e026eb8a429e1e3d5c9f91d8ae11d74f4c216fe7b133c322871e20d6566d9237db32dc7a9f769eaf142aaf43954cab0cdf36be37c965c
7
- data.tar.gz: da29b5d82c8eb18e1e25c4ce65da977c309770946fc29b62f5de95a10394b9739eb4771fce9f4691ffe9a2d8ca5edeee1b10839e319fd9c4b64db30289ecdd64
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` (move Unreleased to new version, add date)
358
- 3. Commit: `git commit -am "Release vX.Y.Z"`
359
- 4. Release to RubyGems: `rake release`
360
- 5. Create GitHub Release: `gh release create vX.Y.Z --generate-notes`
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
 
@@ -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
@@ -95,22 +95,38 @@ module Slk
95
95
 
96
96
  private
97
97
 
98
- def show_unread
99
- target_workspaces.each do |workspace|
100
- puts output.bold(workspace.name) if @options[:all] || target_workspaces.size > 1
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
- unread_data = fetch_unread_data(workspace)
103
+ super
104
+ end
103
105
 
104
- if @options[:json]
105
- output_unread_json(workspace, unread_data)
106
- else
107
- display_unread(workspace, unread_data)
108
- end
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 output_unread_json(workspace, data)
139
- output_json({
140
- channels: data[:unread_channels].map { |c| format_channel_json(workspace, c) },
141
- dms: data[:unread_ims].map { |i| format_dm_json(workspace, i) }
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Slk
4
- VERSION = '0.12.0'
4
+ VERSION = '0.12.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Boehs