There is an even cleaner way to do this, you can use "% w" as follows:
%w{hello there this is just\ a\ test} => ["hello", "there", "this", "is", "just a test"]
You can use the {} keys, as in the example, the brackets [], or even the quotation marks "" , and also avoid spaces by placing a backslash in front of the space.
source share