Converted to Ruby gem