Sha256: f9e3b7c2caa31bfd106fd46af2110f242e692684be0fa7b47840f73f7506dde8
Contents?: true
Size: 424 Bytes
Versions: 19
Compression:
Stored size: 424 Bytes
Contents
require 'fileutils' require 'etc' module Vpsb module Helpers class FileReplace def self.replace_json(path, hash) replace_text(path, hash.to_json) end def self.replace_text(path, text) file_path = File.join(Dir.pwd, path) FileUtils.rm(file_path) if File.exist?(file_path) File.open(file_path,"w") do |f| f.write(text) end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems