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

ruby-grape / grape / 26468402906
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: robust_mounted_app_comparison
DEFAULT BRANCH: master
Ran 26 May 2026 07:00PM UTC
Jobs 38
Files 165
Run time 2min
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

26 May 2026 06:50PM UTC coverage: 96.915% (-0.08%) from 96.998%
26468402906

Pull #2718

github

ericproulx
Generalize middleware options to per-class Data value objects

Following the per-feature `VersionOptions` / `RescueOptions` work in #2712
and #2716, middlewares that want typed option accessors now declare a
per-class `Options = Data.define(...)`.

`Middleware::Base#initialize`, when the subclass declares an `Options`
constant (ancestor search included), routes the kwargs through
`Options.new(**options)`:

- `@config` exposes the typed Data instance (named accessors).
- `@options` keeps returning a frozen `Hash` representation
  (`config.to_h.freeze`) for back-compat with subclasses that read
  `options[:key]`.

Subclasses without an `Options` constant still flow through the
`DEFAULT_OPTIONS` Hash + `deep_merge` path (`Filter`, `Auth::*`) unchanged.

- `Middleware::Formatter` (5 fields).
- `Middleware::Error` (14 fields). `rescue_options:` defaults to
  `Grape::DSL::RescueOptions.new`; an explicit nil (passed by
  `Endpoint#error_middleware_options` when no `rescue_from` was called)
  is coerced to the default in the initializer.
- `Middleware::Versioner::Base` (7 fields). Adds `content_types:` /
  `format:` so the `PrecomputedContentTypes` mixin's accessor reads land
  cleanly. `version_options:` defaults to `Grape::DSL::VersionOptions.new`.

Each `Options` field list is alphabetic.

- `attr_reader :options` still returns a frozen `Hash` for converted
  middlewares (now derived from `config.to_h`). Subclasses that read
  `options[:key]` keep working.
- `DEFAULT_OPTIONS` is restored as `Options.new.to_h.freeze` on each
  converted middleware so existing references continue to resolve.
  Marked `@deprecated` in the YARD comment; will be removed in a future
  release.
- `Options#[]` is defined on each Data class as a Hash-style shim that
  emits a deprecation warning via `Grape.deprecator` and forwards to
  the named accessor — gives any code that discovers the Data and
  reaches in with `[:key]` a migration nudge.

Passing an unknown kwarg to a convert... (continued)
Pull Request #2718: Generalize middleware options to per-class Options Data value objects

1089 of 1175 branches covered (92.68%)

Branch coverage included in aggregate %.

35 of 37 new or added lines in 6 files covered. (94.59%)

3529 of 3590 relevant lines covered (98.3%)

31357.56 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
50.0
lib/grape/middleware/deprecated_options_hash_access.rb
Jobs
ID Job ID Ran Files Coverage
1 run-3.2-gemfiles/rails_7_2.gemfile - 26468402906.1 26 May 2026 07:01PM UTC 165
95.67
GitHub Action Run
2 run-3.4-gemfiles/rails_7_2.gemfile - 26468402906.2 26 May 2026 07:01PM UTC 165
95.63
GitHub Action Run
3 run-3.3-gemfiles/rack_3_0.gemfile - 26468402906.3 26 May 2026 07:02PM UTC 164
95.63
GitHub Action Run
4 run-3.4-gemfiles/rack_3_2.gemfile - 26468402906.4 26 May 2026 07:01PM UTC 164
95.63
GitHub Action Run
5 run-3.2-gemfiles/rails_8_0.gemfile - 26468402906.5 26 May 2026 07:02PM UTC 165
95.67
GitHub Action Run
6 run-3.4-gemfiles/rails_8_1.gemfile - 26468402906.6 26 May 2026 07:01PM UTC 165
95.63
GitHub Action Run
7 run-4.0-gemfiles/dry_validation.gemfile - 26468402906.7 26 May 2026 07:02PM UTC 164
58.17
GitHub Action Run
8 run-3.3-gemfiles/rack_2_2.gemfile - 26468402906.8 26 May 2026 07:01PM UTC 164
95.58
GitHub Action Run
9 run-4.0-gemfiles/multi_xml.gemfile - 26468402906.9 26 May 2026 07:02PM UTC 164
37.04
GitHub Action Run
10 run-3.2-gemfiles/rails_8_1.gemfile - 26468402906.10 26 May 2026 07:02PM UTC 165
95.67
GitHub Action Run
11 run-3.2-gemfiles/rack_3_1.gemfile - 26468402906.11 26 May 2026 07:02PM UTC 164
95.67
GitHub Action Run
12 run-3.3-gemfiles/rails_8_0.gemfile - 26468402906.12 26 May 2026 07:02PM UTC 165
95.63
GitHub Action Run
13 run-4.0-gemfiles/rack_3_2.gemfile - 26468402906.13 26 May 2026 07:01PM UTC 164
95.63
GitHub Action Run
14 run-3.4-gemfiles/rails_8_0.gemfile - 26468402906.14 26 May 2026 07:02PM UTC 165
95.63
GitHub Action Run
15 run-4.0-gemfiles/multi_json.gemfile - 26468402906.15 26 May 2026 07:02PM UTC 164
37.04
GitHub Action Run
16 run-4.0-gemfiles/rack_3_1.gemfile - 26468402906.16 26 May 2026 07:02PM UTC 164
95.63
GitHub Action Run
17 run-3.4-gemfiles/rack_3_0.gemfile - 26468402906.17 26 May 2026 07:02PM UTC 164
95.63
GitHub Action Run
18 run-3.4-Gemfile - 26468402906.18 26 May 2026 07:02PM UTC 164
95.63
GitHub Action Run
19 run-3.2-gemfiles/rack_3_0.gemfile - 26468402906.19 26 May 2026 07:02PM UTC 164
95.67
GitHub Action Run
20 run-3.4-gemfiles/rack_2_2.gemfile - 26468402906.20 26 May 2026 07:01PM UTC 164
95.59
GitHub Action Run
21 run-3.3-gemfiles/rack_3_2.gemfile - 26468402906.21 26 May 2026 07:01PM UTC 164
95.63
GitHub Action Run
22 run-3.3-gemfiles/rails_7_2.gemfile - 26468402906.22 26 May 2026 07:01PM UTC 165
95.63
GitHub Action Run
23 run-3.3-Gemfile - 26468402906.23 26 May 2026 07:02PM UTC 164
95.63
GitHub Action Run
24 run-4.0-gemfiles/rails_8_1.gemfile - 26468402906.24 26 May 2026 07:01PM UTC 165
95.63
GitHub Action Run
25 run-4.0-gemfiles/rails_7_2.gemfile - 26468402906.25 26 May 2026 07:02PM UTC 165
95.63
GitHub Action Run
26 run-3.2-Gemfile - 26468402906.26 26 May 2026 07:00PM UTC 164
95.67
GitHub Action Run
27 run-3.4-gemfiles/rack_3_1.gemfile - 26468402906.27 26 May 2026 07:02PM UTC 164
95.63
GitHub Action Run
28 run-4.0-gemfiles/hashie.gemfile - 26468402906.28 26 May 2026 07:02PM UTC 164
62.37
GitHub Action Run
29 run-4.0-gemfiles/rack_2_2.gemfile - 26468402906.29 26 May 2026 07:02PM UTC 164
95.59
GitHub Action Run
30 run-4.0-gemfiles/rack_3_0.gemfile - 26468402906.30 26 May 2026 07:02PM UTC 164
95.63
GitHub Action Run
31 run-4.0-Gemfile - 26468402906.31 26 May 2026 07:02PM UTC 164
95.63
GitHub Action Run
32 run-4.0-gemfiles/grape_swagger.gemfile - 26468402906.32 26 May 2026 07:02PM UTC 164
55.12
GitHub Action Run
33 run-4.0-gemfiles/rails_8_0.gemfile - 26468402906.33 26 May 2026 07:02PM UTC 165
95.63
GitHub Action Run
34 run-3.3-gemfiles/rack_3_1.gemfile - 26468402906.34 26 May 2026 07:02PM UTC 164
95.63
GitHub Action Run
35 run-4.0-gemfiles/grape_entity.gemfile - 26468402906.35 26 May 2026 07:01PM UTC 164
50.16
GitHub Action Run
36 run-3.3-gemfiles/rails_8_1.gemfile - 26468402906.36 26 May 2026 07:01PM UTC 165
95.63
GitHub Action Run
37 run-3.2-gemfiles/rack_3_2.gemfile - 26468402906.37 26 May 2026 07:02PM UTC 164
95.67
GitHub Action Run
38 run-3.2-gemfiles/rack_2_2.gemfile - 26468402906.38 26 May 2026 07:00PM UTC 164
95.63
GitHub Action Run
Source Files on build 26468402906
  • Tree
  • List 165
  • Changed 5
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #26468402906
  • Pull Request #2718
  • PR Base - master (#26418525997)
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