ruby version of composition exercise generator