subdirectories at specified depth


/ Published in: Ruby
Save to your folder(s)

snippet from project.ioni.st - Marcel Molina (?)


Copy this code and paste it in your HTML
  1. def subdirectories_of(path, options = {})
  2. depth = options[:at_depth_of] || 1
  3. Dir[File.join(path, * ["*"] * depth + [""])]
  4. end

URL: http://project.ioni.st/post/1980#snippet_1980

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.