class String
def pathmap_partial(n)
front end (left hand side) if +n+ is positive. Include |+n+|
Extract a partial path from the path. Include +n+ directories from the
def pathmap_partial(n) dirs = File.dirname(self).pathmap_explode partial_dirs = if n > 0 dirs[0...n] elsif n < 0 dirs.reverse[0...-n].reverse else "." end File.join(partial_dirs) end