class Gamera::PathJoiner
Public Class Methods
path_join(*elements)
click to toggle source
This is a utility method to clean up URLs formed by concatenation since we sometimes ended up with “//” in the middle of URLs which broke the url_matcher checks.
@param elements [String] duck types @return [String] of elements joined by single “/” characters.
# File lib/gamera/utils/path_joiner.rb, line 9 def self.path_join(*elements) "/#{elements.join('/')}".gsub(%r{//+}, '/') end