Ruby and JSON file magic