Skip to content

Instantly share code, notes, and snippets.

@ugisozols
Created June 15, 2011 20:13
Show Gist options
  • Save ugisozols/1027992 to your computer and use it in GitHub Desktop.
Save ugisozols/1027992 to your computer and use it in GitHub Desktop.
Search Psych::SyntaxError
# This will help you trace .yml file which containts Psych::SyntaxError
require "rubygems"
require "psych"
$LOAD_PATH.unshift(File.dirname(__FILE__))
# specify your locales folder in Dir.glob("*") with relative path from this file
Dir.glob("*").sort.each do |file|
begin
Psych.parse(File.open(file))
rescue Psych::SyntaxError => e
puts "#{file} -> #{e}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment