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

ruby-grape / grape / 25909410425 / 21
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: fix/recompile-settings-mutation-race
DEFAULT BRANCH: master
Ran 15 May 2026 09:01AM UTC
Files 160
Run time 5s
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

15 May 2026 08:59AM UTC coverage: 95.738%. First build
25909410425.21

Pull #2721

github

ericproulx
Introduce Grape::Validations::SharedOptions value object

`ValidationsSpec#shared_opts` was a frozen
`{ allow_blank:, fail_fast: }` Hash, flowing as the 5th `opts` argument
into `Validators::Base#initialize`, whose only use was
`opts.values_at(:fail_fast, :allow_blank)`.

Replace it with a `Grape::Validations::SharedOptions` Data value object
(`Data.define(:allow_blank, :fail_fast)` with defaults mirroring the
prior inline hash — `allow_blank: nil`, `fail_fast: false`).

`Validators::Base` no longer copies the two values into per-validator
ivars: it stores the `@opts` value object and exposes the fields via
`Forwardable.def_delegators :@opts, :allow_blank, :fail_fast`.
`#fail_fast?` now calls the delegated `fail_fast`. `ValuesValidator`
(the one subclass that read `@allow_blank` directly) switches to the
`allow_blank` reader.

Behaviour is unchanged for the normal path — Grape always builds the
`opts` via `ValidationsSpec` and passes it through `ParamsScope#validate`.
The 5th `opts` argument of `Validators::Base#initialize` is now a
`SharedOptions` value object rather than a Hash; custom validators that
forward `opts` to `super` are unaffected, but any code that
hand-constructs a validator with a literal Hash for that argument must
pass `Grape::Validations::SharedOptions.new(...)` instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2721: Introduce Grape::Validations::SharedOptions value object

1058 of 1165 branches covered (90.82%)

Branch coverage included in aggregate %.

3457 of 3551 relevant lines covered (97.35%)

1006.54 hits per line

Source Files on job run-3.4-gemfiles/rack_3_0.gemfile - 25909410425.21
  • Tree
  • List 160
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 25909410425
  • 304266f8 on github
  • Next Job for on refactor/shared-options-data (#25909440745.13)
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