module Sys
def split_all(path)
For example:
Split a file path into individual directory names.
def split_all(path) head, tail = File.split(path) return [tail] if head == '.' || tail == '/' return [head, tail] if head == '/' return split_all(head) + [tail] end