lib/i18n/tasks/scanners/pattern_scanner.rb in i18n-tasks-0.7.12 vs lib/i18n/tasks/scanners/pattern_scanner.rb in i18n-tasks-0.7.13

- old
+ new

@@ -58,10 +58,10 @@ def controller_file?(path) /controllers/.match(path) end def closest_method(location) - method = File.readlines(location[:src_path]).first(location[:line_num] - 1).reverse_each.find { |x| x=~ /\bdef\b/ } + method = File.readlines(location[:src_path], encoding: 'UTF-8').first(location[:line_num] - 1).reverse_each.find { |x| x=~ /\bdef\b/ } method &&= method.strip.sub(/^def\s*/, '').sub(/[\(\s;].*$/, '') method end def pattern