Method: File.append
- Defined in:
- lib/clir/File_extension.rb
.append(fpath, code) ⇒ Object
Add code to file at fpath
119 120 121 122 123 124 125 |
# File 'lib/clir/File_extension.rb', line 119 def self.append(fpath, code) begin open(fpath,'a') { |f| f.write(code) } rescue ENOENT raise "Folder #{File.dirname(fpath)} doesn't exist. Unable to write #{fpath} file." end end |