adding patterns ruby script