class I18n::Processes::Scanners::Files::FileReader

Reads the files in 'rb' mode and UTF-8 encoding.

@since 0.9.0

Public Instance Methods

read_file(path) click to toggle source

Return the contents of the file at the given path. The file is read in the 'rb' mode and UTF-8 encoding.

@param path [String] Path to the file, absolute or relative to the working directory. @return [String] file contents

# File lib/i18n/processes/scanners/files/file_reader.rb, line 13
def read_file(path)
  result = nil
  File.open(path, 'rb', encoding: 'UTF-8') { |f| result = f.read }
  result
end