Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/bashly/extensions/file.rb

Class Method Summary collapse

Class Method Details

.append(path, content) ⇒ Object



10
11
12
# File 'lib/bashly/extensions/file.rb', line 10

def self.append(path, content)
  File.open(path, 'a') { |f| f << content }
end

.deep_write(file, content) ⇒ Object



4
5
6
7
8
# File 'lib/bashly/extensions/file.rb', line 4

def self.deep_write(file, content)
  dir = File.dirname file
  FileUtils.mkdir_p dir
  File.write file, content
end