# write the file from a string def put_file_from_string(f, s) File.open(f , 'w') do |file| file.puts(s) end end