Created
December 20, 2012 04:29
-
-
Save taylorlapeyre/4342968 to your computer and use it in GitHub Desktop.
This file contains 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
IMAGE_DIRECTORY = '/images' | |
def determine_image_location | |
for base_directory in IMAGE_DIRECTORY | |
for 2nd_level_directory in base_directory | |
if number_of_files_in(2nd_level_directory) < 100 | |
return 2nd_level_directory.name | |
end | |
if number_of_files_in(base_directory) < 100 | |
return base_directory.name | |
end | |
end | |
raise "All directories are full" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment