This tastes good...

Posted by ungraspiness Tue, 24 Jan 2006 21:56:00 GMT

...like strawberries

def parse_directories(dir)
  sub_dirs = []
  Dir.new(dir).collect do |item|
    path = (dir + '/' + item).gsub('//', '/')
    if File::directory?(path) and item[0].chr != '.'
      sub_dirs << path
    end
  end
  @directories.concat(sub_dirs)
  #Recursively find other sub dirs
  sub_dirs.each do |subdir| 
     parse_directories(subdir)
  end
end

Tags  | no comments

Comments

(leave url/email »)

   Comment Markup Help Preview comment