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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb1e1738360bfcd891e9929159cee6b88e026b532dd70ba10a36337e8bc9ee03
4
- data.tar.gz: fb9795c5b2221d8b3d149a73901b8364c9c79b4d15b0ac75139ede3a4913a0cb
3
+ metadata.gz: 40a5cdd89ebd02a6cbc4c3dde4f533c77f270a7ebee3d942bc45f40ffb4cf31f
4
+ data.tar.gz: e56fc71b7af753155da09f5b4aac2aeb4e12dc92eea10b9ffb1142fee884153e
5
5
  SHA512:
6
- metadata.gz: 8c5e32c039d4b417a8164c3d174b210408f041541f9d67d0dd0cd97e0498bd8e2770914ca8d6a497ea79eece14dffd8ed443c92549a682003cddc384cf9ffa51
7
- data.tar.gz: ae9b8cb7be0b7bad724b2ecc53e59eb3c59b7a55edad051bb5b663485ac3aba7937d73451eae380c76e495b15bf7d455ae11c09fc795e67d671a42fc6b3b3335
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 socket failure | Yes |
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
- Update `CHANGELOG.md`, then from a clean `main`:
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
- bin/release 0.1.1
281
+ git commit -am "Cut the 0.3.0 CHANGELOG section"
282
+ bin/release 0.3.0
280
283
  ```
281
284
 
282
- That runs `bin/ci`, bumps `lib/buttondown/version.rb`, tags, pushes the gem,
283
- and creates the GitHub release with generated notes. One-time setup: `gem
284
- signin`, and `gh auth login` for the release step.
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
 
@@ -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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Buttondown
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buttondown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Kelly