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

ruby-grape / grape / 26614103339
97%

Build:
DEFAULT BRANCH: master
Ran 29 May 2026 02:21AM UTC
Jobs 38
Files 166
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

29 May 2026 02:20AM UTC coverage: 96.922% (-0.08%) from 97.005%
26614103339

push

github

web-flow
Generalize middleware options to per-class Data value objects (#2718)

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... (continued)

1099 of 1187 branches covered (92.59%)

Branch coverage included in aggregate %.

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

3530 of 3589 relevant lines covered (98.36%)

31021.29 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/rack_3_0.gemfile - 26614103339.1 29 May 2026 02:21AM UTC 165
95.7
GitHub Action Run
2 run-3.3-gemfiles/rack_3_1.gemfile - 26614103339.2 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
3 run-3.2-Gemfile - 26614103339.3 29 May 2026 02:21AM UTC 165
95.7
GitHub Action Run
4 run-3.3-gemfiles/rack_3_2.gemfile - 26614103339.4 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
5 run-4.0-gemfiles/rails_8_0.gemfile - 26614103339.5 29 May 2026 02:21AM UTC 166
95.66
GitHub Action Run
6 run-3.3-gemfiles/rack_3_0.gemfile - 26614103339.6 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
7 run-3.2-gemfiles/rack_2_2.gemfile - 26614103339.7 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
8 run-4.0-Gemfile - 26614103339.8 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
9 run-4.0-gemfiles/grape_swagger.gemfile - 26614103339.9 29 May 2026 02:21AM UTC 165
55.52
GitHub Action Run
10 run-3.4-gemfiles/rails_7_2.gemfile - 26614103339.10 29 May 2026 02:21AM UTC 166
95.66
GitHub Action Run
11 run-3.3-Gemfile - 26614103339.11 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
12 run-3.3-gemfiles/rack_2_2.gemfile - 26614103339.12 29 May 2026 02:21AM UTC 165
95.62
GitHub Action Run
13 run-4.0-gemfiles/rack_2_2.gemfile - 26614103339.13 29 May 2026 02:21AM UTC 165
95.62
GitHub Action Run
14 run-3.2-gemfiles/rack_3_1.gemfile - 26614103339.14 29 May 2026 02:21AM UTC 165
95.7
GitHub Action Run
15 run-3.2-gemfiles/rails_8_1.gemfile - 26614103339.15 29 May 2026 02:21AM UTC 166
95.71
GitHub Action Run
16 run-4.0-gemfiles/dry_validation.gemfile - 26614103339.16 29 May 2026 02:21AM UTC 165
58.6
GitHub Action Run
17 run-4.0-gemfiles/grape_entity.gemfile - 26614103339.17 29 May 2026 02:21AM UTC 165
50.48
GitHub Action Run
18 run-3.4-Gemfile - 26614103339.18 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
19 run-3.2-gemfiles/rails_8_0.gemfile - 26614103339.19 29 May 2026 02:21AM UTC 166
95.71
GitHub Action Run
20 run-3.4-gemfiles/rails_8_0.gemfile - 26614103339.20 29 May 2026 02:21AM UTC 166
95.66
GitHub Action Run
21 run-4.0-gemfiles/rack_3_2.gemfile - 26614103339.21 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
22 run-4.0-gemfiles/multi_xml.gemfile - 26614103339.22 29 May 2026 02:21AM UTC 165
37.29
GitHub Action Run
23 run-3.4-gemfiles/rack_2_2.gemfile - 26614103339.23 29 May 2026 02:21AM UTC 165
95.62
GitHub Action Run
24 run-3.4-gemfiles/rack_3_2.gemfile - 26614103339.24 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
25 run-3.2-gemfiles/rails_7_2.gemfile - 26614103339.25 29 May 2026 02:21AM UTC 166
95.71
GitHub Action Run
26 run-4.0-gemfiles/rails_8_1.gemfile - 26614103339.26 29 May 2026 02:21AM UTC 166
95.66
GitHub Action Run
27 run-3.3-gemfiles/rails_8_0.gemfile - 26614103339.27 29 May 2026 02:21AM UTC 166
95.66
GitHub Action Run
28 run-3.4-gemfiles/rails_8_1.gemfile - 26614103339.28 29 May 2026 02:21AM UTC 166
95.66
GitHub Action Run
29 run-3.4-gemfiles/rack_3_1.gemfile - 26614103339.29 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
30 run-4.0-gemfiles/rails_7_2.gemfile - 26614103339.30 29 May 2026 02:21AM UTC 166
95.66
GitHub Action Run
31 run-3.2-gemfiles/rack_3_2.gemfile - 26614103339.31 29 May 2026 02:21AM UTC 165
95.7
GitHub Action Run
32 run-3.3-gemfiles/rails_7_2.gemfile - 26614103339.32 29 May 2026 02:21AM UTC 166
95.66
GitHub Action Run
33 run-4.0-gemfiles/hashie.gemfile - 26614103339.33 29 May 2026 02:21AM UTC 165
62.79
GitHub Action Run
34 run-4.0-gemfiles/multi_json.gemfile - 26614103339.34 29 May 2026 02:21AM UTC 165
37.29
GitHub Action Run
35 run-3.3-gemfiles/rails_8_1.gemfile - 26614103339.35 29 May 2026 02:21AM UTC 166
95.66
GitHub Action Run
36 run-4.0-gemfiles/rack_3_0.gemfile - 26614103339.36 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
37 run-3.4-gemfiles/rack_3_0.gemfile - 26614103339.37 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
38 run-4.0-gemfiles/rack_3_1.gemfile - 26614103339.38 29 May 2026 02:21AM UTC 165
95.66
GitHub Action Run
Source Files on build 26614103339
  • Tree
  • List 166
  • 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 #26614103339
  • 571edbaa on github
  • Prev Build on master (#26496466230)
  • Next Build on master (#26614155237)
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