Skip to content

Instantly share code, notes, and snippets.

@zhanglintc
Last active January 4, 2016 14:20
Show Gist options
  • Save zhanglintc/1d172381e0ff840eda03 to your computer and use it in GitHub Desktop.
Save zhanglintc/1d172381e0ff840eda03 to your computer and use it in GitHub Desktop.
return a list which contains each file's path
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