Convert to Ruby gem