trimming to needed ruby code and combining files