Patch #35026 ยป remove-check_parsing_by_psych.patch
| lib/tasks/locales.rake | ||
|---|---|---|
| 150 | 150 |
end |
| 151 | 151 |
end |
| 152 | 152 |
end |
| 153 | ||
| 154 |
desc 'Check parsing yaml by psych library on Ruby 1.9.' |
|
| 155 | ||
| 156 |
# On Fedora 12 and 13, if libyaml-devel is available, |
|
| 157 |
# in case of installing by rvm, |
|
| 158 |
# Ruby 1.9 default yaml library is psych. |
|
| 159 | ||
| 160 |
task :check_parsing_by_psych do |
|
| 161 |
begin |
|
| 162 |
require 'psych' |
|
| 163 |
parser = Psych::Parser.new |
|
| 164 |
dir = ENV['DIR'] || './config/locales' |
|
| 165 |
files = Dir.glob(File.join(dir,'*.yml')) |
|
| 166 |
files.sort.each do |filename| |
|
| 167 |
next if File.directory? filename |
|
| 168 |
puts "parsing #{filename}..."
|
|
| 169 |
begin |
|
| 170 |
parser.parse File.open(filename) |
|
| 171 |
rescue => e1 |
|
| 172 |
puts(e1.message) |
|
| 173 |
puts("")
|
|
| 174 |
end |
|
| 175 |
end |
|
| 176 |
rescue => e |
|
| 177 |
puts(e.message) |
|
| 178 |
end |
|
| 179 |
end |
|
| 180 | 153 |
end |