Last active
January 4, 2016 14:20
-
-
Save zhanglintc/1d172381e0ff840eda03 to your computer and use it in GitHub Desktop.
return a list which contains each file's path
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
require 'Find' | |
def each_file target | |
Find.find(target) do |path| | |
if not File.directory? path | |
yield path | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment