##// END OF EJS Templates
Ruby 1.9: add rake task to check parsing yaml by psych library (#8847, #4050)....
Toshi MARUYAMA -
r6527:29fb2fd280c4
parent child
Show More
@@ -116,4 +116,31 END_DESC
116 116 end
117 117 end
118 118 end
119
120 desc 'Check parsing yaml by psych library on Ruby 1.9.'
121
122 # On Fedora 12 and 13, if libyaml-devel is available,
123 # in case of installing by rvm,
124 # Ruby 1.9 default yaml library is psych.
125
126 task :check_parsing_by_psynch do
127 begin
128 require 'psych'
129 parser = Psych::Parser.new
130 dir = ENV['DIR'] || './config/locales'
131 files = Dir.glob(File.join(dir,'*.yml'))
132 files.each do |filename|
133 next if File.directory? filename
134 puts "parsing #{filename}..."
135 begin
136 parser.parse File.open(filename)
137 rescue Exception => e1
138 puts(e1.message)
139 puts("")
140 end
141 end
142 rescue Exception => e
143 puts(e.message)
144 end
145 end
119 146 end
General Comments 0
You need to be logged in to leave comments. Login now