Anyone know how to push something from 'exec' into an array?

Code:
user="foo"
 host="bar@barfoo"
 r_dir="/home/foo/test"
 
 files = exec "ssh #{user}@#{host} ls #{r_dir}"

This prints to STDOUT the contents of 'r_dir' - I'd like to put this into a array so I could iterate over the actual files that are in 'r_dir.'

Do I have to use the I/O module?