Class: Configuration::Path::RenderedPath

Inherits:
String
  • Object
show all
Defined in:
lib/httpimagestore/configuration/path.rb

Instance Method Summary collapse

Methods inherited from String

#to_template

Instance Method Details

#to_uriObject



26
27
28
29
30
# File 'lib/httpimagestore/configuration/path.rb', line 26

def to_uri
	uri_path = self.gsub(/^\/?([a-zA-Z])[\|:][\\\/]/){"/#{$1.downcase}:/"} # fix windows backslash
	uri_path = Addressable::URI::SLASH + uri_path if uri_path[0] != Addressable::URI::SLASH # make absolute
	Addressable::URI.new(path: uri_path).normalize
end