lib/sproutcore/library.rb
# Returns a re-written proxy URL for the passed URL or nil if no proxy
# is registered.  The URL should NOT include a hostname.
#
# === Returns
# the converted proxy_url and the proxy options or nil if no match
#
Returns a re-written proxy URL for the passed URL or nil if no proxy
is registered.  The URL should NOT include a hostname.

Returns
the converted proxy_url and the proxy options or nil if no match
Returns a re - written proxy URL for the passed URL or nil if no proxy is registered . The URL should NOT include a hostname . Returns the converted proxy_url and the proxy options or nil if no match
def proxy_url_for(url)
      matched = nil
      matched_url = nil
      @proxies.each do |proxy_url, opts|
        matched_url = proxy_url
        matched = opts if url =~ /^#{proxy_url}/
        break if matched
      end
      if matched
        if matched[:url]
          url = url.gsub(/^#{matched_url}/, matched[:url])
        end
        url = [(matched[:protocol] || 'http'), '://', matched[:to], url].join('')
      else
        url = nil
      end
      return [url, matched]
    end
def proxy_url_for ( url ) matched = nil matched_url = nil @proxies . each do | proxy_url , opts | matched_url = proxy_url matched = opts if url =~ / ^ #{ proxy_url } / break if matched end if matched if matched [ :url ] url = url . gsub ( / ^ #{ matched_url } / , matched [ :url ] ) end url = [ ( matched [ :protocol ] || 'http' ) , '://' , matched [ :to ] , url ] . join ( '' ) else url = nil end return [ url , matched ] end
Returns a re-written proxy URL for the passed URL or nil if no proxy
is registered.
Returns a re - written proxy URL for the passed URL or nil if no proxy is registered .
# look for a matching proxy. # If matched, rewrite the URL # rewrite the matched_url if needed... # prepend the hostname and protocol # otherwise nil
url
<not_specific>