Module: PathSep

Defined in:
lib/scriptorium/helpers.rb

Overview

Path magic

Instance Method Summary collapse

Instance Method Details

#/(right) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/scriptorium/helpers.rb', line 4

def /(right)
  s1 = self.to_s.dup
  s2 = right.to_s.dup
  s1 << "/" unless s1.end_with?("/") || s2.start_with?("/")
  path = s1 + s2
  path.gsub!("//", "/")
  path
end