Commit 31adbf1
Add plugin hooks around gem fetch and git source fetch
Adds four new hook points:
- before-fetch / after-fetch: fires in Source::Rubygems#download_gem
around actual network downloads, avoiding noise from cache hits.
- before-git-fetch / after-git-fetch: fires in Source::Git#specs
around fetch/checkout operations.
Based on the original proposal in #8162 with adjustments:
- Moved gem fetch hooks from fetch_gem_if_possible to download_gem
so they only fire on actual network I/O.
- Dropped the source argument since spec.source provides it.
- Renamed git hooks to before-git-fetch / after-git-fetch for
consistency with the existing before-*/after-* pattern.
- Removed GEM_BEFORE_FETCH/GEM_AFTER_FETCH from Source::Git#install
since using gem fetch events for git sources is semantically
inconsistent.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent cd3825c commit 31adbf1
3 files changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
48 | 72 | | |
49 | 73 | | |
50 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
480 | 481 | | |
481 | 482 | | |
482 | 483 | | |
| 484 | + | |
483 | 485 | | |
484 | 486 | | |
485 | 487 | | |
| |||
0 commit comments