Method: Illustration#to_rel
- Defined in:
- lib/illustration.rb
#to_rel(base, target) ⇒ Object
93 94 95 96 97 98 99 100 101 |
# File 'lib/illustration.rb', line 93 def to_rel(base, target) sep = /#{File::SEPARATOR}+/o base = base.split(sep) base.pop target = target.split(sep) while base.shift == target.shift end File.join([".."]*base.size+target) end |