This method is deprecated or moved on the latest stable version.
The last existing version (v3.0.9) is shown here.
compute_asset_host(source)
private
Pick an asset host for this source. Returns nil if no host is set,
the host if no wildcard is set, the host interpolated with the numbers 0-3
if it contains %d (the number is the source hash mod 4), or the
value returned from invoking the proc if it’s a proc or the value from
invoking call if it’s an object responding to call.
# File actionpack/lib/action_view/helpers/asset_tag_helper.rb, line 766
def compute_asset_host(source)
if host = config.asset_host
if host.is_a?(Proc) || host.respond_to?(:call)
case host.is_a?(Proc) ? host.arity : host.method(:call).arity
when 2
request = controller.respond_to?(:request) && controller.request
host.call(source, request)
else
host.call(source)
end
else
(host =~ /%d/) ? host % (source.hash % 4) : host
end
end
end