Created
October 11, 2012 08:01
-
-
Save rubyginner/3870884 to your computer and use it in GitHub Desktop.
Browse through sub-folders of photos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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