This method is deprecated or moved on the latest stable version.
The last existing version (v3.2.13) 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 call on an object responding to call (proc or
otherwise).
# File actionpack/lib/action_view/asset_paths.rb, line 107
def compute_asset_host(source)
if host = asset_host_config
if host.respond_to?(:call)
args = [source]
arity = arity_of(host)
if (arity > 1 || arity < -2) && !has_request?
invalid_asset_host!("Remove the second argument to your asset_host Proc if you do not need the request, or make it optional.")
end
args << current_request if (arity > 1 || arity < 0) && has_request?
host.call(*args)
else
(host =~ /%d/) ? host % (Zlib.crc32(source) % 4) : host
end
end
end