Skip to content

Instantly share code, notes, and snippets.

@thescubageek
Created August 8, 2016 21:31
Show Gist options
  • Save thescubageek/e6c42986659b870dca1b32b0822d3d2a to your computer and use it in GitHub Desktop.
Save thescubageek/e6c42986659b870dca1b32b0822d3d2a to your computer and use it in GitHub Desktop.
Array to File
def array_to_file(arr, file)
File.open(file, 'w') { |f| f.write(arr.join("\n")) } unless arr.blank?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment