instance method
Gem::Commands::ContentsCommand#files_in_default_gem
files_in_default_gem(spec)
lib/rubygems/commands/contents_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/commands/contents_command.rb, line 104
def files_in_default_gem(spec)
spec.files.filter_map do |file|
if file.start_with?("#{spec.bindir}/")
[RbConfig::CONFIG["bindir"], file.delete_prefix("#{spec.bindir}/")]
else
gem spec.name, spec.version
require_path = spec.require_paths.find do |path|
file.start_with?("#{path}/")
end
requirable_part = file.delete_prefix("#{require_path}/")
resolve = $LOAD_PATH.resolve_feature_path(requirable_part)&.last
next unless resolve
[resolve.delete_suffix(requirable_part), requirable_part]
end
end
end
No documentation available