added ruby and test code