Check if Rubies dir is empty and extract to function.