Skip to content

Instantly share code, notes, and snippets.

@tsommer
Created June 3, 2011 03:30
Show Gist options
  • Save tsommer/1005824 to your computer and use it in GitHub Desktop.
Save tsommer/1005824 to your computer and use it in GitHub Desktop.
Tom's solution
def leaf_paths_of(paths)
paths.dup.reject do |path|
paths.any? { |p| p =~ %r{^#{Regexp.escape(path)}/} }
end
end
@captainpete
Copy link

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment