public Method

Sys.split_all(path)

Split a file path into individual directory names.

For example:

split_all("a/b/c") =>  ['a', 'b', 'c']

Source Code

# File rake/contrib/sys.rb, line 156
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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.