Spawn and interact with background processes in ruby