Created
March 25, 2013 20:44
-
-
Save gabrieljoelc/5240544 to your computer and use it in GitHub Desktop.
Script to find malformed YAML files. Ripped off from http://stackoverflow.com/a/9848226.
This file contains hidden or 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 'yaml' | |
d = Dir["./**/*.yml"] | |
d.each do |file| | |
begin | |
puts "checking : #{file}" | |
f = YAML.load_file(file) | |
rescue Exception | |
puts "failed to read #{file}: #{$!}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment