buttondown 0.3.0 → 0.3.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 +21 -6
- data/lib/buttondown/client.rb +10 -0
- data/lib/buttondown/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: 40a5cdd89ebd02a6cbc4c3dde4f533c77f270a7ebee3d942bc45f40ffb4cf31f
|
|
4
|
+
data.tar.gz: e56fc71b7af753155da09f5b4aac2aeb4e12dc92eea10b9ffb1142fee884153e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 858aecbb8b74975fd382d7d9212453dfebc0280105a3af74dde618a0ba2dc73a49cae672a426243810be7162f57b305654b198405f6c1a4f7d7589c39f5a6454
|
|
7
|
+
data.tar.gz: 348a5504469b4460988110098247da1f72682b86348a9b78c83f1a25f986acd0f5ef13ca40085d15b31f441952ac22a0911f2fff1386060e5808b081f1b7730c
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to this gem are documented here. The error classes are part
|
|
|
4
4
|
of the public API -- callers rescue them by name -- so every change to the error
|
|
5
5
|
hierarchy is listed.
|
|
6
6
|
|
|
7
|
+
## 0.3.1 - 2026-11-23
|
|
8
|
+
|
|
9
|
+
- `Net::HTTPBadResponse` and `Net::HTTPHeaderSyntaxError` are now wrapped as
|
|
10
|
+
`Buttondown::ConnectionError`. Neither descends from `IOError`, so both
|
|
11
|
+
escaped unwrapped -- past a `retry_on Buttondown::ConnectionError` that the
|
|
12
|
+
README asks for. `Net::ProtocolError` is deliberately still not rescued: it
|
|
13
|
+
would also catch HTTP status exceptions
|
|
14
|
+
|
|
7
15
|
## 0.3.0 - 2026-11-23
|
|
8
16
|
|
|
9
17
|
- **Breaking:** `#subscribe` no longer sends a collision behavior of its own,
|
data/README.md
CHANGED
|
@@ -215,7 +215,7 @@ enough to be safe. Rescue the specific classes where you want to act differently
|
|
|
215
215
|
| `RateLimitError` | 429. Exposes `#retry_after` when the header is sent | Yes, after a wait |
|
|
216
216
|
| `ServerError` | 5xx | Yes |
|
|
217
217
|
| `TimeoutError` | Connect, read or write timed out | Yes |
|
|
218
|
-
| `ConnectionError` | DNS, TLS or
|
|
218
|
+
| `ConnectionError` | DNS, TLS, socket or malformed-response failure | Yes |
|
|
219
219
|
| `InvalidResponseError` | A 2xx whose body wasn't usable JSON | Yes |
|
|
220
220
|
|
|
221
221
|
Every HTTP error carries `#status`, `#code`, `#body`, `#raw_body` and `#headers`:
|
|
@@ -273,15 +273,30 @@ points at the OpenAPI spec to check before adding an endpoint.
|
|
|
273
273
|
|
|
274
274
|
## Releasing a new version
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
Give the CHANGELOG's `## Unreleased` section the version it's shipping as,
|
|
277
|
+
with the date — `## 0.3.0 - 2026-11-23` — and **commit that first**. Then,
|
|
278
|
+
from a clean `main`:
|
|
277
279
|
|
|
278
280
|
```
|
|
279
|
-
|
|
281
|
+
git commit -am "Cut the 0.3.0 CHANGELOG section"
|
|
282
|
+
bin/release 0.3.0
|
|
280
283
|
```
|
|
281
284
|
|
|
282
|
-
That
|
|
283
|
-
|
|
284
|
-
|
|
285
|
+
That order isn't housekeeping. `gem bump` aborts on a dirty working tree, so
|
|
286
|
+
an uncommitted CHANGELOG stops the release after `bin/ci` has already run.
|
|
287
|
+
And the tag and the packaged `.gem` capture the CHANGELOG as it stands when
|
|
288
|
+
the version is bumped, so committing it afterwards ships a release that files
|
|
289
|
+
its own changes under "Unreleased" — which is how 0.2.1 went out.
|
|
290
|
+
|
|
291
|
+
`bin/release` refuses to start unless `CHANGELOG.md` already has a
|
|
292
|
+
`## <version>` section, so forgetting costs a second instead of a release. It
|
|
293
|
+
then runs `bin/ci`, bumps `lib/buttondown/version.rb`, tags, pushes the gem to
|
|
294
|
+
RubyGems, and creates the GitHub release last, so a failure there leaves a
|
|
295
|
+
published gem missing its release rather than a release pointing at a version
|
|
296
|
+
that never shipped. The release notes themselves come from the pull requests
|
|
297
|
+
merged since the last tag, not from the CHANGELOG.
|
|
298
|
+
|
|
299
|
+
One-time setup: `gem signin`, and `gh auth login` for the release step.
|
|
285
300
|
|
|
286
301
|
## Contributing
|
|
287
302
|
|
data/lib/buttondown/client.rb
CHANGED
|
@@ -30,10 +30,20 @@ module Buttondown
|
|
|
30
30
|
Net::WriteTimeout
|
|
31
31
|
].freeze
|
|
32
32
|
|
|
33
|
+
# Two Net::HTTP transport failures: a malformed status line, which is also
|
|
34
|
+
# what a keep-alive socket the server has since closed looks like, and a
|
|
35
|
+
# malformed header. Both descend straight from StandardError rather than
|
|
36
|
+
# from IOError or any shared Net:: class, so each has to be named here --
|
|
37
|
+
# no superclass rescue reaches them. Faraday's adapter lists them beside
|
|
38
|
+
# Net::ProtocolError, which is deliberately absent: it would catch neither
|
|
39
|
+
# of these, and its own subtree is HTTP status errors that must not reach a
|
|
40
|
+
# caller disguised as connection failures.
|
|
33
41
|
CONNECTION_ERRORS = [
|
|
34
42
|
SocketError,
|
|
35
43
|
EOFError,
|
|
36
44
|
IOError,
|
|
45
|
+
Net::HTTPBadResponse,
|
|
46
|
+
Net::HTTPHeaderSyntaxError,
|
|
37
47
|
Errno::ECONNREFUSED,
|
|
38
48
|
Errno::ECONNRESET,
|
|
39
49
|
Errno::EHOSTUNREACH,
|
data/lib/buttondown/version.rb
CHANGED