Created
May 14, 2014 20:35
-
-
Save danhawkins/eec0bbfd1d89ffea1195 to your computer and use it in GitHub Desktop.
Compare Script
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
matched_in_staging = 0 | |
matched_in_files = 0 | |
unmatched = [] | |
total = 0 | |
Dir['prod/decision/doc_file/**/*.doc'].each do |file| | |
total += 1 | |
staging_check_path = file.gsub('prod/','staging/') | |
if File.exists?(staging_check_path) | |
matched_in_staging += 1 | |
else | |
doc_name = file.split('/').last | |
doc_name = doc_name.split('_').first | |
doc_check_path = "2014/**/#{doc_name}*" | |
if !Dir.glob(doc_check_path).empty? | |
matched_in_files +=1 | |
else | |
unmatched << file | |
end | |
end | |
end | |
puts "staging: #{matched_in_staging}, files: #{matched_in_files}, total: #{total}" | |
puts unmatched.join("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment