I was given a bunch of columns from a CSV spreadsheet of full names of users and I needed to keep the formatting, with spaces. The easiest way I found to get them in while using ruby was to do:
names = %( Porter Smith
Jimmy Jones
Ronald Jackson).split('\n')
This highlights that %()
creates a string like "Porter Smith\nJimmyJones\nRonald Jackson"
and to get the array you split
the string on the "\n"
["Porter Smith", "Jimmy Jones", "Ronald Jackson"]
So to answer the OP's original question too, they could have wrote %(cgi\ spaeinfilename.rb;complex.rb;date.rb).split(';')
if there happened to be space
when you want the space
to exist in the final array output.