module Sys

def split_all(path)

split_all("a/b/c") => ['a', 'b', 'c']
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