Module: Filander::CreateFile

Includes:
Base
Included in:
Filander
Defined in:
lib/filander/actions/create_file.rb

Instance Method Summary collapse

Methods included from Base

#create_directory_for, #entries, #join_destination, #join_source, #report, #with_report

Instance Method Details

#create_file(destination, content) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/filander/actions/create_file.rb', line 5

def create_file(destination, content)
  create_directory_for destination

  with_report destination, content do
    File.open(join_destination(destination), "w") { |file| file << content }
  end
end