Module: FileMutate::AppendContent::ClassMethods

Defined in:
lib/file_mutate/append_content.rb

Instance Method Summary collapse

Instance Method Details

#append(path, content = nil, &block) ⇒ Object



8
9
10
11
12
# File 'lib/file_mutate/append_content.rb', line 8

def append path, content=nil, &block
  File.open(path, 'a') do |f|
    f.puts content ||= yield
  end
end