Bind grabbed values into placeholders in given URL
 Ex: http://example.com?id={id} with {id => 1} becomes http://example.com?id=1
 @param url [String] parameterized URL with placeholders
 @return [String] binded URL or original URL if no placeholders
342098
def resolve url
      url.gsub!(/\{([a-zA-Z0-9_]+)\}/) do |s|
        s.gsub!(/[\{\}]/, '')
        if instance_variable_defined?("@#{s}")
          instance_variable_get("@#{s}")
        else
          raise 'Did you forget to "grab" ' + s + '?'
        end
      end
      url
    end
1205999
function (url) {
        !url && (url = E);
        var parsedUrl = _.isString(url) ? Url.parse(url) : url,
            auth = parsedUrl.auth,
            protocol = parsedUrl.protocol,
            port = parsedUrl.port,
            path = parsedUrl.path,
            hash = parsedUrl.hash,
            host = parsedUrl.host,
            query = parsedUrl.query,
            variable = parsedUrl.variable;

        // convert object based query string to array
        // @todo: create a key value parser
        if (query) {
            if (_.isString(query)) {
                query = QueryParam.parse(query);
            }

            if (!_.isArray(query) && _.keys(query).length) {
                query = _.map(_.keys(query), function (key) {
                    return {
                        key: key,
                        value: query[key]
                    };
                });
            }
        }

        // backward compatibility with path variables being storing thins with `id`
        if (_.isArray(variable)) {
            variable = _.map(variable, function (v) {
                _.isObject(v) && (v.key = v.key || v.id); // @todo Remove once path variables are deprecated
                return v;
            });
        }

        // expand string path name
        if (_.isString(path)) {
            path && (path = path.replace(regexes.trimPath, MATCH_1)); // remove leading slash for valid path
            // if path is blank string, we set it to undefined, if '/' then single blank string array
            path = path ? (path === PATH_SEPARATOR ? [E] : path.split(PATH_SEPARATOR)) : undefined;
        }

        // expand host string
        _.isString(host) && (host = host.split(regexes.splitDomain));

        _.assign(this, /** @lends Url.prototype */ {
            /**
             * @type {String}
             */
            auth: auth,

            /**
             * @type {String}
             */
            protocol: protocol,

            /**
             * @type {String}
             */
            port: port || undefined,

            /**
             * @type {Array<String>}
             */
            path: path,

            /**
             * @type {String}
             */
            hash: hash || undefined,

            /**
             * @type {Array<String>}
             */
            host: host,

            /**
             * @type {PropertyList<QueryParam>}
             */
            query: new PropertyList(QueryParam, this, query || []),

            /**
             * @type {VariableList}
             */
            variables: new VariableList(this, variable || [])
        });
    }
835529
def query_string=(query)
      self.query_params.clear

      ::URI::QueryParams.parse(query).each do |name,value|
        self.query_params.new(
          :name  => URLQueryParamName.first_or_new(:name => name),
          :value => value
        )
      end

      return query
    end
102218
function (url, key, value) {
                var regex = new RegExp("([?|&])" + key + "=.*?(&|#|$)(.*)", "gi"),
                    separator,
                    hash;

                if (regex.test(url)) {
                    url = url.replace(regex, '$1' + key + "=" + value + '$2$3');
                } else {
                    separator = url.indexOf('?') !== -1 ? '&' : '?';
                    hash = url.split('#');
                    url = hash[0] + separator + key + '=' + value;
                }
                return url;
            }
672632
def submit_url(self, url, params={}, _extra_params={}):
        
        self._check_user_parameters(params)
        params = copy.copy(params)
        params['url'] = url
        return self._submit(params, _extra_params=_extra_params)
982947
def put(url, params)
      params = convert_hash_keys(params)
      preform(url, :put, params: params) do
        return connection.put(url, params)
      end
    end
269765
def remote=(urls)
      case urls
      when nil then @remote = nil
      when RepositoryArray then @remote = urls
      when Array then @remote = RepositoryArray.new(urls.dup)
      else @remote =  RepositoryArray.new([urls])
      end
    end
678240
def url(self, var, default=NOTSET):
        
        return self.get_value(var, cast=urlparse, default=default, parse_default=True)
61154
def url_for(params)
      host_with_port = host || location.host
      host_with_port += ":#{port}" if port && port != 80
      scheme = scheme || location.scheme

      unless RUBY_PLATFORM == 'opal'
        # lazy load routes and views on the server
        if !@router && @routes_loader
          # Load the templates
          @routes_loader.call
        end
      end

      path, params = @router.params_to_url(params)

      if path == nil
        raise "No route matched, make sure you have the base route defined last: `client '/', {}`"
      end

      new_url    = "#{scheme}://#{host_with_port}#{path.chomp('/')}"

      # Add query params
      params_str = ''
      unless params.empty?
        query_parts = []
        nested_params_hash(params).each_pair do |key, value|
          # remove the _ from the front
          value = Volt::Parsing.encodeURI(value)
          query_parts << "#{key}=#{value}"
        end

        if query_parts.size > 0
          query = query_parts.join('&')
          new_url += "?#{query}"
        end
      end

      # Add fragment
      frag    = fragment
      new_url += '#' + frag if frag.present?

      new_url
    end
165077
def url
      @url ||= begin
        base = if @collection.nil?
                 cleaned_relative_path
               else
                 Jekyll::URL.new(
                   :template     => @collection.url_template,
                   :placeholders => placeholders
                 )
               end.to_s.chomp("/")
        base << extname
      end
    end
1038935
def retrieve(url, method = :get, headers = {}, data = nil)
      puts "[ActiveHarmony] Retrieving data:"
      puts "[ActiveHarmony]    URL:      #{url}"
      puts "[ActiveHarmony]    Method:   #{method}"
      puts "[ActiveHarmony]    Headers:  #{headers.inspect}"
      puts "[ActiveHarmony]    Data:     #{data.inspect}" if data
      if defined?(Rails) && !Rails.env.test?
        data = retrieve_with_typhoeus(url, method, headers, data)
      else
        data = retrieve_with_http(url, method, headers, data)
      end
      data
    end
788247
def lookup(selector)
      unless routes.nil?
		routes.each do |pattern, keys, block|

          if match = pattern.match(selector)
            match = match.to_a
            url = match.shift

            params = to_params_hash(keys, match)

            #
            # @todo think about this
            #
            @params = params

            return params, block
          end
        end
      end

      unless @default_route.nil?
        return {}, @default_route
      end

      raise Gopher::NotFoundError
    end
308041
def get_api_results(url)
      uri = URI.parse(url)
      puts "URL: #{url}" if self.verbose
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true

      request = Net::HTTP::Get.new(uri.request_uri)
      response = http.request(request)

      JSON.parse(response.body)
    end
34539
def api_hash(replace = nil)
      self.replace = replace unless replace.nil?
      {
        url:          href,
        description:  description,
        extended:     extended,
        tags:         tag.join(" "),
        replace:      replace,
        shared:       shared,
        toread:       toread
      }.select { |key, value| ! value.nil? }
    end
286867
def get(url, options={}, &block)
      http_options = options.merge(@basic_options)
      if block_given?
        RestClient.get(url, http_options, &block)
      else
        RestClient.get(url, http_options)
      end
    end
1227430
def parse(url)
      if url[0] == '#'
        # url only updates fragment
        self.fragment = url[1..-1]
        update!
      else
        host = location.host
        protocol = location.protocol

        if url !~ /[:]\/\//
          # Add the host for local urls
          url = protocol + "//#{host}" + url
        else
          # Make sure its on the same protocol and host, otherwise its external.
          if url !~ /#{protocol}\/\/#{host}/
            # Different host, don't process
            return false
          end
        end

        matcher         = url.match(/^(#{protocol[0..-2]})[:]\/\/([^\/]+)(.*)$/)
        self.scheme     = matcher[1]
        self.host, port = matcher[2].split(':')

        self.port = (port || 80).to_i

        path           = matcher[3]
        path, fragment = path.split('#', 2)
        path, query    = path.split('?', 2)

        self.path     = path
        self.fragment = fragment
        self.query    = query

        result = assign_query_hash_to_params
      end

      # Wait until things are rendered before we scroll
      Volt::Timers.next_tick do
        scroll
      end

      result
    end
1192028
def url=(new_val)
      return nil if new_val == @url
      # handy - from http://stackoverflow.com/questions/1805761/check-if-url-is-valid-ruby#1805788
      url_ok = new_val =~ /\A#{URI.regexp(%w(http https))}\z/
      raise JSS::InvalidDataError, 'New value is not a valid http(s) url' unless url_ok && url_ok.zero?
      @url = new_val
      @need_to_update = true
    end