class Caco::FileReader
Constants
- UseCustomRoot
Public Instance Methods
file_exist(ctx, path:, **)
click to toggle source
# File lib/caco/file_reader.rb, line 17 def file_exist(ctx, path:, **) ctx[:file_exist] = File.exist?(path) end
read_file(ctx, path:, **)
click to toggle source
# File lib/caco/file_reader.rb, line 21 def read_file(ctx, path:, **) ctx[:output] = File.read(path) end
use_custom_root(ctx, path:, **)
click to toggle source
# File lib/caco/file_reader.rb, line 10 def use_custom_root(ctx, path:, **) return true unless Caco.config.write_files_root ctx[:path] = "#{Caco.config.write_files_root}#{ctx[:path]}" UseCustomRoot end