Skip to content

Instantly share code, notes, and snippets.

@rubyginner
Created October 11, 2012 08:01
Browse through sub-folders of photos
path = 'C:/folio-gallery/albums'
valid_files = ['.png', '.jpg', '.jpeg']
Dir.foreach(path) { |folder|
next if ['.', '..'].include? folder
puts "#{folder}"
Dir.foreach("#{path}/#{folder}") { |subfolder|
puts "- #{subfolder}" if valid_files.include? File.extname(subfolder)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment