class Genit::FileWriter
Write a file on disk.
Public Class Methods
write(content, full_path)
click to toggle source
# File lib/genit/utils/file_writer.rb, line 9 def self.write content, full_path create_dirs full_path File.open(full_path, "w") {|out| out.puts content } end
Private Class Methods
create_dirs(full_path)
click to toggle source
# File lib/genit/utils/file_writer.rb, line 16 def self.create_dirs full_path dir = File.dirname full_path FileUtils.makedirs(dir) unless File.directory?(dir) end