Class: Gamera::PathJoiner
- Inherits:
-
Object
- Object
- Gamera::PathJoiner
- Defined in:
- lib/gamera/utils/path_joiner.rb
Class Method Summary collapse
-
.path_join(*elements) ⇒ String
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.
Class Method Details
.path_join(*elements) ⇒ String
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.
9 10 11 |
# File 'lib/gamera/utils/path_joiner.rb', line 9 def self.path_join(*elements) "/#{elements.join('/')}".gsub(%r{//+}, '/') end |