summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/tasks/locales.rake27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/tasks/locales.rake b/lib/tasks/locales.rake
index 541f5b2f0..bc99a9a9b 100644
--- a/lib/tasks/locales.rake
+++ b/lib/tasks/locales.rake
@@ -116,4 +116,31 @@ END_DESC
end
end
end
+
+ desc 'Check parsing yaml by psych library on Ruby 1.9.'
+
+ # On Fedora 12 and 13, if libyaml-devel is available,
+ # in case of installing by rvm,
+ # Ruby 1.9 default yaml library is psych.
+
+ task :check_parsing_by_psynch do
+ begin
+ require 'psych'
+ parser = Psych::Parser.new
+ dir = ENV['DIR'] || './config/locales'
+ files = Dir.glob(File.join(dir,'*.yml'))
+ files.each do |filename|
+ next if File.directory? filename
+ puts "parsing #{filename}..."
+ begin
+ parser.parse File.open(filename)
+ rescue Exception => e1
+ puts(e1.message)
+ puts("")
+ end
+ end
+ rescue Exception => e
+ puts(e.message)
+ end
+ end
end