Skip to content

Commit 93fe617

Browse files
hsbtclaude
andcommitted
Clarify before-fetch/after-fetch hook docstrings
The hook receives a Bundler spec proxy (Bundler::EndpointSpecification or Bundler::RemoteSpecification) that responds to the Gem::Specification API but is not itself a Gem::Specification instance. Plugins doing strict is_a? checks would break on the previous wording. Also clarify the cache-hit language: the hook does not fire when the initial download-cache check in fetch_gem finds the .gem already on disk, but Bundler.rubygems.download_gem also has a race-protection early return on the same path, which the previous wording obscured. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a8c04c4 commit 93fe617

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

bundler/lib/bundler/plugin/events.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,19 @@ def self.defined_event?(event)
5050

5151
# @!parse
5252
# A hook called before each individual gem is downloaded from a remote source.
53-
# Includes a Gem::Specification. Does not fire on cache hits.
53+
# Includes a spec-like object responding to the Gem::Specification API
54+
# (for example, a Bundler spec proxy such as Bundler::EndpointSpecification
55+
# or Bundler::RemoteSpecification). Does not fire when the gem is already
56+
# present at the initial download-cache check.
5457
# GEM_BEFORE_FETCH = "before-fetch"
5558
define :GEM_BEFORE_FETCH, "before-fetch"
5659

5760
# @!parse
5861
# A hook called after each individual gem is downloaded from a remote source.
59-
# Includes a Gem::Specification. Does not fire on cache hits.
62+
# Includes a spec-like object responding to the Gem::Specification API
63+
# (for example, a Bundler spec proxy such as Bundler::EndpointSpecification
64+
# or Bundler::RemoteSpecification). Does not fire when the gem is already
65+
# present at the initial download-cache check.
6066
# GEM_AFTER_FETCH = "after-fetch"
6167
define :GEM_AFTER_FETCH, "after-fetch"
6268

0 commit comments

Comments
 (0)