# File lib/cgikit/resource.rb, line 365 def url( name, request = nil ) url = nil if filepath = path(name) then if @web_server_resources and \ /\A#{File.expand_path(@web_server_resources)}/ === filepath then url = filepath.sub(File.expand_path(@document_root), '') if @document_root return url elsif @tmpdir and /\A#{File.expand_path(@tmpdir)}/ === filepath then url = @application.resource_request_handler.resource_url(name, request) end end url end