# File lib/addressable/uri.rb, line 1281 def normalized_path @normalized_path ||= (begin if self.scheme == nil && self.path != nil && !self.path.empty? && self.path =~ NORMPATH # Relative paths with colons in the first segment are ambiguous. self.path.sub!(":", "%2F") end # String#split(delimeter, -1) uses the more strict splitting behavior # found by default in Python. result = (self.path.strip.split(SLASH, -1).map do |segment| Addressable::URI.normalize_component( segment, Addressable::URI::CharacterClasses::PCHAR ) end).join(SLASH) result = URI.normalize_path(result) if result.empty? && ["http", "https", "ftp", "tftp"].include?(self.normalized_scheme) result = SLASH end result end) end