Method: Bundler::URI::Generic#normalize

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

#normalizeObject

Returns normalized Bundler::URI.

require 'bundler/vendor/uri/lib/uri'

Bundler::URI("HTTP://my.EXAMPLE.com").normalize
#=> #<Bundler::URI::HTTP http://my.example.com/>

Normalization here means:

  • scheme and host are converted to lowercase,

  • an empty path component is set to “/”.



1331
1332
1333
1334
1335
# File 'lib/bundler/vendor/uri/lib/uri/generic.rb', line 1331

def normalize
  uri = dup
  uri.normalize!
  uri
end