Ruby 4.0.5 / Rack 3 support#1
Draft
lleirborras wants to merge 2 commits into
Draft
Conversation
- Declare `rexml` + `webrick` runtime deps — both are required in lib/rack_dav.rb and left Ruby's default gems in 3.0, so the gem failed to load on Ruby 4. - `URI.escape` / `URI.unescape` (removed in Ruby 3.0) → `URI::DEFAULT_PARSER`; `Rack::Utils.bytesize` (removed) → `String#bytesize`. - Rack 3 no longer coerces the response status via `#to_i`, so setting `response.status = NoContent` (an HTTPStatus class) left a non-Integer status. Coerce in the handler before `finish`. - Rack 3 leaves `request.body` nil for an empty body (Rack 2 gave an empty StringIO) — guard it in `request_document`. Reassign rather than mutate the OPTIONS Allow/Dav header strings in place. All changes are backward-compatible with Rack 2. Add a self-contained smoke harness (test/smoke.rb) driving OPTIONS/PUT/GET/PROPFIND/DELETE over a temp dir, plus a CI matrix over Ruby 4.0.5/3.4/2.7 × Rack 3/2.2. Verified green on Ruby 4.0.5/Rack 3 and Ruby 3.4/Rack 2.2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0.4.0 targets Rack 3 (Ruby >= 2.4) and uses safe-navigation `&.` (Ruby >= 2.3), so it can't run on the oldest Rubies — verified: Ruby 2.1/2.2 fail to parse controller.rb. Modern floor is 2.7 (Rack 3 + 2.7 smoke green). Run the smoke in each Ruby's official Docker image (GitHub-hosted runners can't install <= 2.6), with BUNDLE_FORCE_RUBY_PLATFORM so old rows resolve native gems from source. required_ruby_version >= 2.7. Consumer (scriptoria, Ruby 2.1) keeps the old release pinned until its staircase crosses 2.7. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings rack_dav up to Ruby 4.0.5 / Rack 3 for the fleet upgrade. Draft — opened for review/CI while the consuming app (scriptoria) is still on its own staircase.
What changed
to_ibeforefinish, response headers reassigned (not<<),request.body&.read.to_snil-guard.rexml+webrick(left the default gems).URI.escape→URI::DEFAULT_PARSER.escape(removed in Ruby 3.0).test/smoke.rb) across Ruby 2.7 / 3.0 / 3.4 / 4.0.5 via each Ruby's official Docker image.required_ruby_version >= 2.7.Ruby floor
0.4.0 is a modern release: it targets Rack 3 (Ruby ≥ 2.4) and uses safe-navigation
&.(Ruby ≥ 2.3), so it does not run on the very old Rubies (verified: Ruby 2.1/2.2 fail to parse). The only consumer, scriptoria (Ruby 2.1), keeps the old release pinned until its own upgrade staircase crosses Ruby 2.7 — at which point it adopts this version.How to test
Verified green on 2.7 and 4.0.5.