Returns the URL for the route. If it's templated,
 then we utilize the provided options hash to expand
 the route. Otherwise we return the `path`

 @return [String] The templated or base URI
779612
def url_for(options={})
      if templated?
        template = Addressable::Template.new(base_path)
        template = template.expand(options)
        template.to_s
      else
        base_path
      end
    end
652898
function () {
        var rootURL = this._getRootURL();
        var path = this._getPath();
        var hash = this._getHash();
        var query = this._getQuery();
        var rootURLIndex = path.indexOf(rootURL);
        var routeHash, hashParts;

        Ember.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0);

        // By convention, Ember.js routes using HashLocation are required to start
        // with `#/`. Anything else should NOT be considered a route and should
        // be passed straight through, without transformation.
        if (hash.substr(0, 2) === '#/') {
          // There could be extra hash segments after the route
          hashParts = hash.substr(1).split('#');
          // The first one is always the route url
          routeHash = hashParts.shift();

          // If the path already has a trailing slash, remove the one
          // from the hashed route so we don't double up.
          if (path.slice(-1) === '/') {
              routeHash = routeHash.substr(1);
          }

          // This is the "expected" final order
          path += routeHash;
          path += query;

          if (hashParts.length) {
            path += '#' + hashParts.join('#');
          }
        } else {
          path += query;
          path += hash;
        }

        return path;
      }
614572
def url(style = self.default)
      path = self.path(style)
      host = self.host
      host = self.aliases[path.hash % self.aliases.count] unless self.aliases.empty?
      return "#{host}#{path}"
    end
762034
def get_base_url(self):
        
        return "http://{hostname}:{port}/{api}".format(
                hostname=self.hostname,
                port=self.port,
                api=self.api_version)
147205
def path(self):
        
        path = self.__prefix
        if self is not self.over:
            path = self.over.path + path
        return path
1083159
def build_uri(path, options = {})
      uri = URI.join(host, path)
      uri.query = URI.encode_www_form(options)
      uri
    end
1125376
def url_for(resource, params = {}, options = {})
      Xhive.railtie_routes_url_helpers.send("#{resource}_url", params, options.merge(default_url_options))
    end
370418
def get_url(self, path):
        
        host = ('[' + self.host + ']' if (self.host.find(':') != -1)
                else self.host)
        base_url = self.protocol + '://' + host + ':' + str(self.port)
        return base_url + '/v3alpha/' + path.lstrip("/")
1111258
def final_url
      return @final_url if !@final_url.nil?
      location = final_location(FaviconParty::HTTPClient.head(@query_url))
      if !location.nil?
        if location =~ /\Ahttp/
          @final_url = URI.encode location
        else
          uri = URI @query_url
          root = "#{uri.scheme}://#{uri.host}"
          @final_url = URI.encode URI.join(root, location).to_s
        end
      end
      if !@final_url.nil?
        if %w( 127.0.0.1 localhost ).any? {|host| @final_url.include? host }
          # TODO Exception for invalid final urls
          @final_url = @query_url
        end
        return @final_url
      end
      @final_url = @query_url
    end
324637
def path_to_url(path, relative_to = nil)

      # Find the parent path we're in
      path = Pathname.new(path).realpath
      base = self.load_paths.find{|lp| path.to_s =~ /\A#{Regexp.escape(lp.realpath.to_s)}/ }

      path = path.relative_path_from(base).cleanpath
      
      if relative_to
        if relative_to.to_s =~ /\A\//
          relative_to = Pathname.new(File.dirname(relative_to.to_s)).relative_path_from(base).cleanpath
        else
          relative_to = Pathname.new(File.dirname(relative_to.to_s))
        end
        path = Pathname.new("/" + path.to_s).relative_path_from(Pathname.new("/" + relative_to.to_s))
        path.to_s
      else
        "/" + path.to_s
      end
      
    end
1080400
def route_and_method_from_resource_method_and_name_prefix(method, name_prefix)
      route_method = method.to_s.sub(/resource(s)?/) { $1 ? "#{name_prefix}#{route_name.pluralize}" : "#{name_prefix}#{route_name}" }
      return [Rails.application.routes.named_routes.get(route_method.sub(/_(path|url)$/,'').to_sym), route_method]
    end
514105
def base_url_from_schema
      json_schema.links.find do |link|
        if link.href && link.rel == "self"
          return link.href
        end
      end
    end
573506
function url(path) {
        if (path) {
            if (_.startsWith(path, "/")) {
                if (!_urlPrefix) {
                    // lets discover the base url via the base html element
                    _urlPrefix = $('base').attr('href') || "";
                    if (_.endsWith(_urlPrefix, '/')) {
                        _urlPrefix = _urlPrefix.substring(0, _urlPrefix.length - 1);
                    }
                }
                if (_urlPrefix) {
                    return _urlPrefix + path;
                }
            }
        }
        return path;
    }
1226152
def get(req)
    target_uri = req.header.request_uri
    return nil unless @challengeable.find { |uri, ok|
      Util.uri_part_of(target_uri, uri) and ok
    }
    return @cred if @cred
    Util.hash_find_value(@auth) { |uri, cred|
      Util.uri_part_of(target_uri, uri)
    }
  end
8723
def base_url(self):
        
        return get_current_url(
            self.environ, strip_querystring=True, trusted_hosts=self.trusted_hosts
        )
1080182
public function getUrl() {
		$url = $this->baseUrl . $this->name;
		
		if ($this->hashAppend) {
			$meta = $this->getMetadata();
			
			if ($meta !== false) {
				$url .= '?' . $meta->hash;
			}
		}
		
		return $url;
	}
676675
def root(to, options={})
      default = {path: '', to: to, method: :get, root: true}
      options = default.merge(options)
      @routes << Route.new(options)
    end