Project

General

Profile

Patch #39207 ยป use_yaml_load_file.patch

Go MAEDA, 2023-10-20 03:26

View differences:

lib/tasks/locales.rake
10 10
  task :update do
11 11
    dir = ENV['DIR'] || './config/locales'
12 12

  
13
    en_strings = YAML.load(File.read(File.join(dir,'en.yml')))['en']
13
    en_strings = YAML.load_file(File.join(dir,'en.yml'))['en']
14 14

  
15 15
    files = Dir.glob(File.join(dir,'*.{yaml,yml}'))
16 16
    files.sort.each do |file|
17 17
      puts "Updating file #{file}"
18
      file_strings = YAML.load(File.read(file))
18
      file_strings = YAML.load_file(file)
19 19
      file_strings = file_strings[file_strings.keys.first]
20 20

  
21 21
      missing_keys = en_strings.keys - file_strings.keys
......
39 39
  desc 'Checks interpolation arguments in locals against en.yml'
40 40
  task :check_interpolation do
41 41
    dir = ENV['DIR'] || './config/locales'
42
    en_strings = YAML.load(File.read(File.join(dir,'en.yml')))['en']
42
    en_strings = YAML.load_file(File.join(dir,'en.yml'))['en']
43 43
    files = Dir.glob(File.join(dir,'*.{yaml,yml}'))
44 44
    files.sort.each do |file|
45 45
      puts "parsing #{file}..."
    (1-1/1)