Add the worst Mustache parser in the world

This commit is contained in:
Paul Betts
2015-10-14 13:07:20 -07:00
parent 3b9b638342
commit 8bb02941bd
2 changed files with 24 additions and 0 deletions

23
src/Update/CopStache.cs Normal file
View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
namespace Squirrel.Update
{
public static class CopStache
{
public static string Render(string template, Dictionary<string, string> identifiers)
{
var buf = new StringBuilder(template);
foreach (var key in identifiers.Keys) {
buf.Replace("{{" + key + "}}", SecurityElement.Escape(identifiers[key]));
}
return buf.ToString();
}
}
}

View File

@@ -75,6 +75,7 @@
<Link>Properties\SolutionAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AnimatedGifWindow.cs" />
<Compile Include="CopStache.cs" />
<Compile Include="Mono.Options\Options.cs" />
<Compile Include="NativeMethods.cs" />
<Compile Include="Program.cs" />