in asf-site-src/ruby27_fix_uri.rb [106:129]
def manipulate_single_resource(resource)
return unless @exts.include?(resource.ext)
return if ignored_resource?(resource)
return if resource.ignored?
digest = if resource.binary?
::Digest::SHA1.file(resource.source_file).hexdigest[0..7]
else
response = @rack_client.get(
::URI.encode_www_form_component(resource.destination_path),
'bypass_inline_url_rewriter_asset_hash' => 'true'
)
raise "#{resource.path} should be in the sitemap!" unless response.status == 200
::Digest::SHA1.hexdigest(response.body)[0..7]
end
path, basename, extension = split_path(resource.destination_path)
resource.destination_path = options.rename_proc.call(path, basename, digest, extension, options)
resource
end