-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add plugin hooks for Gemfile evaluation and source fetching #9488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fefe97c
34c4a46
a08ea29
acc0659
d33e3eb
a8c04c4
93fe617
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -477,8 +477,13 @@ def download_gem(spec, download_cache_path, previous_spec = nil) | |
| Bundler.ui.confirm("Fetching #{version_message(spec, previous_spec)}") | ||
| gem_remote_fetcher = remote_fetchers.fetch(spec.remote).gem_remote_fetcher | ||
|
|
||
| Gem.time("Downloaded #{spec.name} in", 0, true) do | ||
| Bundler.rubygems.download_gem(spec, uri, download_cache_path, gem_remote_fetcher) | ||
| Plugin.hook(Plugin::Events::GEM_BEFORE_FETCH, spec) | ||
| begin | ||
| Gem.time("Downloaded #{spec.name} in", 0, true) do | ||
| Bundler.rubygems.download_gem(spec, uri, download_cache_path, gem_remote_fetcher) | ||
| end | ||
| ensure | ||
| Plugin.hook(Plugin::Events::GEM_AFTER_FETCH, spec) | ||
| end | ||
|
Comment on lines
+480
to
487
|
||
| end | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
GIT_AFTER_FETCHis now guaranteed viaensure, it would be good to add a spec that exercises the failure path (e.g., invalid git URI or stubbingfetch/checkoutto raise) and asserts theafter-git-fetchhook still runs. That prevents regressions where future refactors accidentally remove theensuresemantics.