module Crawler::Formatting
Public Instance Methods
construct_url(uri)
click to toggle source
constructs a full url from a given uri object
# File lib/crawler/formatting.rb, line 12 def construct_url(uri) "#{uri.scheme}://#{uri.host}#{uri.path}" end
normalize_path(path)
click to toggle source
normalize paths => '/path/to/'
# File lib/crawler/formatting.rb, line 6 def normalize_path(path) "#{path}/".gsub(/\/+/, '/') end