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

ruby-grape / grape / 25972887409
97%

Build:
DEFAULT BRANCH: master
Ran 16 May 2026 09:03PM UTC
Jobs 37
Files 163
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

16 May 2026 09:03PM UTC coverage: 96.961% (-0.02%) from 96.981%
25972887409

push

github

web-flow
Refactor DSL::Routing#version: guard clause, kwargs, value object (#2716)

Three changes that touch the same method:

1. Lift the body out of `if args.any? ... end` into a
   `return @versions&.last if args.empty?` guard.

2. Replace `**options` with explicit kwargs (`using:`, `cascade:`,
   `parameter:`, `strict:`, `vendor:`) and bake the defaults into the
   signature. The per-call `reverse_merge(using: :path)` is gone.

3. Introduce `Grape::DSL::VersionOptions` (built on `Data.define`)
   as the canonical representation of resolved version options.
   Threaded end-to-end:
   - `#version` builds and stores a `VersionOptions` on
     `inheritable_setting.namespace_inheritable[:version_options]`.
   - `Path#uses_path_versioning?`, `Endpoint#build_stack`, and
     `API::Instance#cascade?` read fields via accessors instead of
     `[:key]`.
   - The versioner middleware (`Versioner::Base`) now takes a
     `VersionOptions` directly, not a Hash. `Forwardable.def_delegators`
     forwards `cascade`/`parameter`/`strict`/`vendor` to it; the four
     ivars and per-call assignments are dropped. `DEFAULT_OPTIONS`
     stores a `VersionOptions.new(...)` so direct-mount callers still
     get safe defaults.

Public `.version` DSL surface unchanged — still accepts kwargs the same
way; the value object is an internal-only representation.

`version_options` is read for exactly these five keys across the
codebase: `:using` (`endpoint.rb`, `path.rb`), and `:cascade` /
`:parameter` / `:strict` / `:vendor` (`Versioner::Base`, plus
`:cascade` in `API::Instance#cascade?`). Any other kwarg passed to
`.version` was previously swallowed by the splat with no effect.

Spec fixtures updated:

- `spec/shared/versioning_examples.rb` (14 sites): `**macro_options`
  -> `**macro_options.except(:format)`. The `:format` key stays in
  the macro hash so the test helper (`versioned_helpers.rb`) can still
  build the `HTTP_ACCEPT` header.
- `spec/grape/exceptions/invalid_accept_header_... (continued)

1082 of 1167 branches covered (92.72%)

Branch coverage included in aggregate %.

26 of 26 new or added lines in 6 files covered. (100.0%)

3512 of 3571 relevant lines covered (98.35%)

31997.07 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-4.0-gemfiles/rack_3_0.gemfile - 25972887409.1 16 May 2026 09:04PM UTC 162
95.66
GitHub Action Run
2 run-3.3-gemfiles/rack_3_0.gemfile - 25972887409.2 16 May 2026 09:03PM UTC 162
95.66
GitHub Action Run
3 run-3.3-gemfiles/rack_2_2.gemfile - 25972887409.3 16 May 2026 09:03PM UTC 162
95.62
GitHub Action Run
4 run-4.0-gemfiles/rack_2_2.gemfile - 25972887409.4 16 May 2026 09:04PM UTC 162
95.62
GitHub Action Run
5 run-4.0-gemfiles/multi_json.gemfile - 25972887409.5 16 May 2026 09:04PM UTC 162
36.63
GitHub Action Run
6 run-4.0-gemfiles/rails_8_0.gemfile - 25972887409.6 16 May 2026 09:04PM UTC 163
95.67
GitHub Action Run
7 run-3.3-Gemfile - 25972887409.7 16 May 2026 09:03PM UTC 162
95.66
GitHub Action Run
8 run-3.4-gemfiles/rack_3_1.gemfile - 25972887409.8 16 May 2026 09:03PM UTC 162
95.66
GitHub Action Run
9 run-3.2-gemfiles/rails_8_1.gemfile - 25972887409.9 16 May 2026 09:03PM UTC 163
95.71
GitHub Action Run
10 run-3.4-gemfiles/rack_2_2.gemfile - 25972887409.10 16 May 2026 09:03PM UTC 162
95.62
GitHub Action Run
11 run-4.0-gemfiles/multi_xml.gemfile - 25972887409.11 16 May 2026 09:04PM UTC 162
36.63
GitHub Action Run
12 run-3.2-gemfiles/rails_8_0.gemfile - 25972887409.12 16 May 2026 09:03PM UTC 163
95.71
GitHub Action Run
13 run-4.0-gemfiles/hashie.gemfile - 25972887409.13 16 May 2026 09:04PM UTC 162
62.58
GitHub Action Run
14 run-4.0-gemfiles/grape_entity.gemfile - 25972887409.14 16 May 2026 09:04PM UTC 162
50.23
GitHub Action Run
15 run-3.2-gemfiles/rack_3_1.gemfile - 25972887409.15 16 May 2026 09:03PM UTC 162
95.71
GitHub Action Run
16 run-4.0-gemfiles/dry_validation.gemfile - 25972887409.16 16 May 2026 09:04PM UTC 162
58.25
GitHub Action Run
17 run-4.0-gemfiles/rack_3_1.gemfile - 25972887409.17 16 May 2026 09:04PM UTC 162
95.66
GitHub Action Run
18 run-4.0-Gemfile - 25972887409.18 16 May 2026 09:04PM UTC 162
95.66
GitHub Action Run
19 run-3.4-gemfiles/rack_3_2.gemfile - 25972887409.19 16 May 2026 09:04PM UTC 162
95.66
GitHub Action Run
20 run-3.2-gemfiles/rack_2_2.gemfile - 25972887409.20 16 May 2026 09:03PM UTC 162
95.67
GitHub Action Run
21 run-4.0-gemfiles/rack_3_2.gemfile - 25972887409.21 16 May 2026 09:04PM UTC 162
95.66
GitHub Action Run
22 run-3.3-gemfiles/rack_3_2.gemfile - 25972887409.22 16 May 2026 09:03PM UTC 162
95.66
GitHub Action Run
23 run-3.4-gemfiles/rails_7_2.gemfile - 25972887409.23 16 May 2026 09:03PM UTC 163
95.67
GitHub Action Run
24 run-3.4-gemfiles/rack_3_0.gemfile - 25972887409.24 16 May 2026 09:03PM UTC 162
95.66
GitHub Action Run
25 run-3.3-gemfiles/rails_7_2.gemfile - 25972887409.25 16 May 2026 09:03PM UTC 163
95.67
GitHub Action Run
26 run-3.4-gemfiles/rails_8_1.gemfile - 25972887409.26 16 May 2026 09:04PM UTC 163
95.67
GitHub Action Run
27 run-4.0-gemfiles/rails_8_1.gemfile - 25972887409.27 16 May 2026 09:03PM UTC 163
95.67
GitHub Action Run
28 run-3.2-gemfiles/rack_3_2.gemfile - 25972887409.28 16 May 2026 09:03PM UTC 162
95.71
GitHub Action Run
29 run-3.3-gemfiles/rails_8_0.gemfile - 25972887409.29 16 May 2026 09:04PM UTC 163
95.67
GitHub Action Run
30 run-3.2-gemfiles/rails_7_2.gemfile - 25972887409.30 16 May 2026 09:03PM UTC 163
95.71
GitHub Action Run
31 run-3.2-Gemfile - 25972887409.31 16 May 2026 09:03PM UTC 162
95.71
GitHub Action Run
32 run-3.2-gemfiles/rack_3_0.gemfile - 25972887409.32 16 May 2026 09:03PM UTC 162
95.71
GitHub Action Run
33 run-3.3-gemfiles/rack_3_1.gemfile - 25972887409.33 16 May 2026 09:04PM UTC 162
95.66
GitHub Action Run
34 run-3.3-gemfiles/rails_8_1.gemfile - 25972887409.34 16 May 2026 09:03PM UTC 163
95.67
GitHub Action Run
35 run-3.4-gemfiles/rails_8_0.gemfile - 25972887409.35 16 May 2026 09:04PM UTC 163
95.67
GitHub Action Run
36 run-4.0-gemfiles/rails_7_2.gemfile - 25972887409.36 16 May 2026 09:04PM UTC 163
95.67
GitHub Action Run
37 run-3.4-Gemfile - 25972887409.37 16 May 2026 09:04PM UTC 162
95.66
GitHub Action Run
Source Files on build 25972887409
  • Tree
  • List 163
  • 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 #25972887409
  • e4835513 on github
  • Prev Build on master (#25968435334)
  • Next Build on master (#25972968115)
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