Sha256: 2774331f9cc1e110692a470454d3dfdacfa547d21d17db82cde836459d9b7f5d
Contents?: true
Size: 556 Bytes
Versions: 6
Compression:
Stored size: 556 Bytes
Contents
# frozen_string_literal: true module I18n::Tasks::Scanners::Files # Reads the files in 'rb' mode and UTF-8 encoding. # # @since 0.9.0 class FileReader # 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 def read_file(path) result = nil File.open(path, 'rb', encoding: 'UTF-8') { |f| result = f.read } result end end end
Version data entries
6 entries across 6 versions & 1 rubygems