def compute_public_path(source, dir, options = {})
      source = source.to_s
      return source if is_uri?(source)

      source = rewrite_extension(source, dir, options[:ext]) if options[:ext]
      source = rewrite_asset_path(source, dir, options)
      source = rewrite_relative_url_root(source, relative_url_root)
      source = rewrite_host_and_protocol(source, options[:protocol])
      source
    end
def compute_public_path(source, dir, options = {})
      source = source.to_s
      return source if is_uri?(source)

      source = rewrite_extension(source, dir, options[:ext]) if options[:ext]
      source = rewrite_asset_path(source, dir, options)
      source = rewrite_relative_url_root(source, relative_url_root)
      source = rewrite_host_and_protocol(source, options[:protocol])
      source
    end
Add the extension +ext+ if not present. Return full or scheme-relative URLs otherwise untouched.
 Prefix with <tt>/dir/</tt> if lacking a leading +/+. Account for relative URL
 roots. Rewrite the asset path for cache-busting asset ids. Include
 asset host, if configured, with the correct request protocol.

 When :relative (default), the protocol will be determined by the client using current protocol
 When :request, the protocol will be the request protocol
 Otherwise, the protocol is used (E.g. :http, :https, etc)