class Gem::Commands::ContentsCommand

def files_in_default_gem(spec)

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