Skip to content

Instantly share code, notes, and snippets.

@gabrieljoelc
Created March 25, 2013 20:44
Show Gist options
  • Save gabrieljoelc/5240544 to your computer and use it in GitHub Desktop.
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.
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