require "bibtex" module BibtexMunge def save_and_backup(path) if path == @filepath File.rename(@filepath, @filepath+".bak") end f = File.open(path, "w") f.write(to_s) f.close end end