title: New lines list into array
body: <p>I have a list containing new lines and I like to convert it into an array, e.g.</p>
  
  <pre><code>JAN 
  
  FEB 
  
  MAR
  
  APR
  
  MAY
  </code></pre>
  
  <p>into <code>["JAN", "FEB", "MAR", "APR", "MAY]</code></p>
  
  <p>Any help will be appreciated.
  Thanks</p>
  
  <p>Something like this doesn't seem to work (text_file.txt contains a list of months as above)</p>
  
  <pre><code>file = File.new("text_file.txt", "r")
  while (line = file.gets)
      line.chomp 
      list = line.split(/\n/)
      puts "#{list}"
  end
  </code></pre>