require"sinatra"defload_signature(index)# Code omitted for brevityenddefsave_signature(signature)# Code omitted for brevityenddefupdate_signature(index,signature)# Code omitted for brevityend# Deletes the line at the given index and re-saves the file.defdelete_signature(index)lines=File.readlines("signatures.txt")index=index.to_ilines.delete_at(index)File.open("signatures.txt","w")do|file|file.putslinesendendget"/signatures/new"do# Code omitted for brevityendget"/signatures/:index"do@index=params[:index]@signature=load_signature(@index)erb'show'.to_symenddelete"/signatures/:index"do@index=params[:index]@signature=delete_signature(@index)redirect"/signatures/new"end