def image_url(path)
path = path.value
if absolute_path?(path)
return Sass::Script::String.new("url(#{path})")
end
http_images_path = if relative?
compute_relative_path(Compass.configuration.images_dir)
elsif Compass.configuration.http_images_path
Compass.configuration.http_images_path
else
Compass.configuration.root_relative(Compass.configuration.images_dir)
end
real_path = if Compass.configuration.images_dir
File.join(Compass.configuration.project_path, Compass.configuration.images_dir, path)
end
if http_images_path
http_images_path = "#{http_images_path}/" unless http_images_path[-1..-1] == "/"
path = "#{http_images_path}#{path}"
end
asset_host = if !relative? && Compass.configuration.asset_host
Compass.configuration.asset_host.call(path)
end
if buster = compute_cache_buster(path, real_path)
path += "?#{buster}"
end
path = "#{asset_host}#{'/' unless path[0..0] == "/"}#{path}" if asset_host
url(path)
end