module PageMagic::Utils::URL

module String - contains methods for manipulating strings

Public Class Methods

concat(base_url, path) click to toggle source

build a url from a base and path. @example

concat('http://base.url/', '/path') # => "http://base.url/path"

@return [String]

# File lib/page_magic/utils/url.rb, line 12
def concat(base_url, path)
  path = path.sub(%r{^/}, '')
  base_url = base_url.sub(%r{/$}, '')
  "#{base_url}/#{path}"
end