• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lostisland / faraday / #4707
96%
master: 92%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 25 Nov 2026 09:09AM UTC
Jobs 1
Files 35
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Nov 2026 09:08AM UTC coverage: 96.548% (+0.9%) from 95.69%
#4707

push

web-flow
Convert Env to BaseOptions (#1653) (#1740)

* Convert Env to BaseOptions (#1653)

Env was the last Options class built on Struct. Middleware reads and
writes it on every request. The conversion keeps the API that the
gems in awesome-faraday use:
- [] and []= with custom members and the body key
- delete, dig, to_hash, dup, and update with a body key
- the streaming helpers and the Env constants

The rest of the Struct API (each, members, ==, fetch, key?,
positional new) goes, as for the other converted classes. No
Faraday 2 gem calls it.

Env keeps the old semantics where BaseOptions differs:
- to_hash keeps RequestOptions and SSLOptions as objects.
- Env.from(env) copies the options, headers and Hash values, but
  shares bodies and the URL, so a large parsed body is not copied.
- The writers and []= do not coerce.

false means "not set" for request, ssl and the headers, like in
ConnectionOptions. ssl is now coerced to SSLOptions. Before, a Hash
stayed a Hash.

Env.for_request replaces the positional Env.new calls in core. It
assigns the request options and headers without copying them, so a
request costs no extra allocations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the legacy merge and copy semantics of Env

The inspect spec failed on Ruby 3.0 to 3.3, which print a Hash as
{:custom=>1}. The spec now builds the expected text with Hash#inspect.

The review of #1740 found two changes from the Struct that middleware
could notice. merge! deep-merged every Hash member, so merging params
or a Hash body combined them instead of replacing them. update and
from stored the caller's Hash instead of a copy. Env now deep-merges
only the coerced members and copies other Hash values on write, as
the Struct did.

The docs now say which methods accept the String 'body' key, and that
Env#to_hash keeps nested options objects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

90 of 90 new or added lines in 3 files covered. (100.0%)

1706 of 1767 relevant lines covered (96.55%)

149.85 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #4707.1 25 Nov 2026 09:09AM UTC 35
96.55
Source Files on build #4707
  • Tree
  • List 35
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 81739626 on github
  • Prev Build on main
  • Next Build on main
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc