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

ruby-grape / grape / 25878904332 / 15
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: robust_mounted_app_comparison
DEFAULT BRANCH: master
Ran 14 May 2026 06:49PM UTC
Files 161
Run time 14s
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

14 May 2026 06:47PM UTC coverage: 95.648%. First build
25878904332.15

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

1058 of 1169 branches covered (90.5%)

Branch coverage included in aggregate %.

3448 of 3542 relevant lines covered (97.35%)

996.17 hits per line

Source Files on job run-3.2-gemfiles/rack_2_2.gemfile - 25878904332.15
  • Tree
  • List 161
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 25878904332
  • e707766a on github
  • Next Job for on draft/middleware-options-data (#25973916459.17)
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