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

ruby-grape / grape / 33607562285
97%

Build:
DEFAULT BRANCH: master
Ran 02 Sep 2026 08:13AM UTC
Jobs 32
Files 169
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

02 Sep 2026 08:13AM UTC coverage: 96.973%. Remained the same
33607562285

push

github

web-flow
Strip the versioner's prefixes with each instead of reduce (#2882)

`Versioner::Path#before` runs on every request of a versioned API and takes the
mount path and prefix off the front of PATH_INFO before looking for a version
segment:

    path_info = @prefixes.reduce(path_info) do |pi, path|
      pi.start_with?(path) ? pi.delete_prefix(path) : pi
    end

`@prefixes` holds at most two entries — a mount path and a prefix — and for an
API with neither it is empty. `Array` does not override `Enumerable#reduce`, so
that list pays the generic accumulator path on every request, which costs more
than the work it is driving.

`each` over the same list, assigning as it goes, is the same operation without
it. Measured in one process:

    one prefix    reduce 205 ns   ->   each  89 ns    2.31x
    no prefix     reduce 102 ns   ->   each  25 ns    4.02x

It allocates less too, which the timing alone does not show — 3 objects against
1 for identical work, the extra two being the Enumerable machinery rather than
anything the stripping needs:

    reduce  3.0 objects
    each    1.0 objects

End to end that is 166,376 -> 170,079 req/s on a small path-versioned API
(+2.2%, median of 9 runs interleaved with master's, Ruby 4.0.5 with YJIT), and
two fewer objects allocated per request. An API that declares no version never
builds this middleware and is untouched.

The result is byte-identical: the same prefixes are removed, in the same order,
under the same `start_with?` guard.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

1237 of 1330 branches covered (93.01%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

3920 of 3988 relevant lines covered (98.29%)

27250.61 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.4-gemfiles/rack_2_2.gemfile - 33607562285.1 02 Sep 2026 08:13AM UTC 168
95.69
GitHub Action Run
2 run-4.0-gemfiles/rails_8_0.gemfile - 33607562285.2 02 Sep 2026 08:14AM UTC 169
95.73
GitHub Action Run
3 run-3.4-Gemfile - 33607562285.3 02 Sep 2026 08:14AM UTC 168
95.73
GitHub Action Run
4 run-3.3-gemfiles/rails_8_0.gemfile - 33607562285.4 02 Sep 2026 08:13AM UTC 169
95.73
GitHub Action Run
5 run-4.0-gemfiles/rack_3_1.gemfile - 33607562285.5 02 Sep 2026 08:14AM UTC 168
95.73
GitHub Action Run
6 run-3.3-gemfiles/rack_3_0.gemfile - 33607562285.6 02 Sep 2026 08:14AM UTC 168
95.73
GitHub Action Run
7 run-3.3-gemfiles/rails_8_1.gemfile - 33607562285.7 02 Sep 2026 08:13AM UTC 169
95.73
GitHub Action Run
8 run-3.4-gemfiles/rails_8_0.gemfile - 33607562285.8 02 Sep 2026 08:13AM UTC 169
95.73
GitHub Action Run
9 run-4.0-gemfiles/rails_8_1.gemfile - 33607562285.9 02 Sep 2026 08:13AM UTC 169
95.73
GitHub Action Run
10 run-4.0-Gemfile - 33607562285.10 02 Sep 2026 08:13AM UTC 168
95.73
GitHub Action Run
11 run-4.0-gemfiles/rack_3_0.gemfile - 33607562285.11 02 Sep 2026 08:14AM UTC 168
95.73
GitHub Action Run
12 run-3.3-gemfiles/rack_2_2.gemfile - 33607562285.12 02 Sep 2026 08:13AM UTC 168
95.69
GitHub Action Run
13 run-4.0-gemfiles/multi_xml.gemfile - 33607562285.13 02 Sep 2026 08:13AM UTC 168
46.89
GitHub Action Run
14 run-4.0-gemfiles/rack_3_2.gemfile - 33607562285.14 02 Sep 2026 08:14AM UTC 168
95.73
GitHub Action Run
15 run-4.0-gemfiles/dry_validation.gemfile - 33607562285.15 02 Sep 2026 08:13AM UTC 168
57.87
GitHub Action Run
16 run-3.3-Gemfile - 33607562285.16 02 Sep 2026 08:13AM UTC 168
95.73
GitHub Action Run
17 run-3.4-gemfiles/rails_8_1.gemfile - 33607562285.17 02 Sep 2026 08:13AM UTC 169
95.73
GitHub Action Run
18 run-4.0-gemfiles/multi_json_1_20.gemfile - 33607562285.18 02 Sep 2026 08:13AM UTC 168
47.42
GitHub Action Run
19 run-3.4-gemfiles/rails_7_2.gemfile - 33607562285.19 02 Sep 2026 08:14AM UTC 169
95.73
GitHub Action Run
20 run-3.4-gemfiles/rack_3_0.gemfile - 33607562285.20 02 Sep 2026 08:14AM UTC 168
95.73
GitHub Action Run
21 run-4.0-gemfiles/rack_2_2.gemfile - 33607562285.21 02 Sep 2026 08:13AM UTC 168
95.69
GitHub Action Run
22 run-4.0-gemfiles/grape_entity.gemfile - 33607562285.22 02 Sep 2026 08:14AM UTC 168
50.28
GitHub Action Run
23 run-3.4-gemfiles/rack_3_1.gemfile - 33607562285.23 02 Sep 2026 08:14AM UTC 168
95.73
GitHub Action Run
24 run-4.0-gemfiles/rails_7_2.gemfile - 33607562285.24 02 Sep 2026 08:14AM UTC 169
95.73
GitHub Action Run
25 run-4.0-gemfiles/hashie.gemfile - 33607562285.25 02 Sep 2026 08:13AM UTC 168
61.77
GitHub Action Run
26 run-3.3-gemfiles/rails_7_2.gemfile - 33607562285.26 02 Sep 2026 08:13AM UTC 169
95.73
GitHub Action Run
27 run-4.0-gemfiles/multi_json.gemfile - 33607562285.27 02 Sep 2026 08:13AM UTC 168
47.38
GitHub Action Run
28 run-4.0-gemfiles/grape_swagger.gemfile - 33607562285.28 02 Sep 2026 08:13AM UTC 168
55.2
GitHub Action Run
29 run-3.4-gemfiles/rack_3_2.gemfile - 33607562285.29 02 Sep 2026 08:13AM UTC 168
95.73
GitHub Action Run
30 run-3.3-gemfiles/rack_3_2.gemfile - 33607562285.30 02 Sep 2026 08:13AM UTC 168
95.73
GitHub Action Run
31 run-3.3-gemfiles/rack_3_1.gemfile - 33607562285.31 02 Sep 2026 08:13AM UTC 168
95.73
GitHub Action Run
32 run-4.0-gemfiles/multi_xml_0_8.gemfile - 33607562285.32 02 Sep 2026 08:13AM UTC 168
46.93
GitHub Action Run
Source Files on build 33607562285
  • Tree
  • List 169
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #33607562285
  • 625f7a59 on github
  • Prev Build on master (#33600556914)
  • Next Build on master (#33608919837)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc