PHP trim to Ruby