add ruby test task
fix missing end on if..else block