Created
February 11, 2011 14:00
-
-
Save semmons99/822378 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
def s3_find(filename) | |
keys = s3.directories.map do |directory| | |
directory.files.map do |file| | |
file.key if file.key =~ /.*#{filename}.*/ | |
end | |
end | |
keys.flatten.compact | |
end | |
## OR ## | |
def s3_find(filename) | |
s3.directories.map{|directory| | |
directory.files.map{|file| | |
file.key if file.key =~ /.*#{filename}.*/ | |
} | |
}.flatten.compact | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment