Method: Bundler::URI::WS#request_uri

Defined in:
lib/bundler/vendor/uri/lib/uri/ws.rb

#request_uriObject

Description

Returns the full path for a WS Bundler::URI, as required by Net::HTTP::Get.

If the Bundler::URI contains a query, the full path is Bundler::URI#path + ‘?’ + Bundler::URI#query. Otherwise, the path is simply Bundler::URI#path.

Example:

uri = Bundler::URI::WS.build(path: '/foo/bar', query: 'test=true')
uri.request_uri #  => "/foo/bar?test=true"
[View source]

74
75
76
77
78
79
# File 'lib/bundler/vendor/uri/lib/uri/ws.rb', line 74

def request_uri
  return unless @path

  url = @query ? "#@path?#@query" : @path.dup
  url.start_with?(?/.freeze) ? url : ?/ + url
end