Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Package#content_address
content_address
lib/rubygems/package.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/package.rb, line 268
def content_address
path = @gem&.path
return unless path
address = Gem::ContentAddress.verified_file_name_claim(path, spec)
return nil unless address
return nil unless Gem::ContentAddress.eligible?(spec)
address
end
Derives the content address from the gem’s file name and verifies it against the SHA256 digest of the file contents.