Created
November 30, 2020 10:09
-
-
Save ollie/77cb6906e51b31b39476ddcb2e41db1c 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
require 'pathname' | |
directories = Pathname.name('.').children.select(&:directory?) | |
file_paths = {} | |
directories.each do |directory| | |
directory.children.each do |file_path| | |
basename = file_path.basename | |
file_paths[basename] ||= [] | |
file_paths[basename] << file_path | |
end | |
end | |
file_paths.each do |basename, file_paths| | |
next if file_paths.size <= 1 | |
puts "Duplicate #{basename}: #{file_paths.join(', ')}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment