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

ruby-grape / grape / 25973916459 / 23
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: robust_mounted_app_comparison
DEFAULT BRANCH: master
Ran 16 May 2026 09:54PM UTC
Files 164
Run time 6s
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

16 May 2026 09:52PM UTC coverage: 95.672% (-0.01%) from 95.682%
25973916459.23

Pull #2718

github

ericproulx
Convert Error, Versioner::Base to Options Data; drop OptionsCompat

Building on the merged refactor/version-guard-clause (VersionOptions
Data) and feature/error-formatter-kwargs-2527 (RescueOptions Data),
convert the remaining two middlewares that include
`PrecomputedContentTypes` to per-class `Options = Data.define(...)`:

- Middleware::Error: 14-field Options replacing the 14-line
  DEFAULT_OPTIONS Hash + the 12-line attr_reader / ivar-set initialize
  body. `rescue_options:` defaults to `Grape::DSL::RescueOptions.new`;
  initialize coerces an explicit nil (from
  `Endpoint#error_middleware_options` when no `rescue_from` was called)
  to the default. `Forwardable.def_delegators :options, ...` covers
  every accessor; the existing `def_delegator :rescue_options, :backtrace,
  :include_backtrace` (and `:original_exception`) carry through unchanged.
- Middleware::Versioner::Base: 7-field Options (adds `content_types:` /
  `format:` so the mixin's accessor reads land cleanly). `version_options:`
  defaults to `Grape::DSL::VersionOptions.new`. The four
  `def_delegators :version_options, :cascade, :parameter, :strict, :vendor`
  stay; `mount_path` / `pattern` / `prefix` / `version_options` are now
  delegated via `def_delegators :options, ...`.

With every PrecomputedContentTypes consumer now using an Options Data
class, switch the mixin to accessor reads:

    options.content_types  # was options[:content_types]
    options.format         # was options[:format]

…and delete `Grape::Middleware::OptionsCompat` entirely.

Two supporting tweaks:

- `Middleware::Base#build_options` switches `const_defined?(:Options,
  false)` → `const_defined?(:Options)` so Versioner subclasses
  (`Path`, `Header`, `Param`, `AcceptVersionHeader`) inherit
  `Versioner::Base::Options` without redeclaring it.
- `Middleware::Formatter#read_rack_input` switches `options[:parsers]`
  to the existing `parsers` delegator.

`Filter` and `Auth::Base` / `Auth::*` remain on the legacy
`... (continued)
Pull Request #2718: [DRAFT] Generalize middleware options to per-class Data value objects

1062 of 1171 branches covered (90.69%)

Branch coverage included in aggregate %.

3470 of 3566 relevant lines covered (97.31%)

983.09 hits per line

Source Files on job run-4.0-gemfiles/rails_8_0.gemfile - 25973916459.23
  • Tree
  • List 164
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 25973916459
  • 13add91d on github
  • Prev Job for on draft/middleware-options-data (#25973819196.8)
  • Next Job for on draft/middleware-options-data (#26370276319.19)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc