class String

def pathmap_explode

Explode a path into individual components. Used by +pathmap+.
def pathmap_explode
  head, tail = File.split(self)
  return [self] if head == self
  return [tail] if head == '.' || tail == '/'
  return [head, tail] if head == '/'
  return head.pathmap_explode + [tail]
end