public Page(Tacker tacker, string realpath) { Tacker = tacker; DiskPath = realpath; var fn = Path.GetFileName (realpath); Name = Regex.Replace (fn, "^[0-9]+\\.", ""); IsFloating = !Regex.Match (fn, "^[0-9]+\\.").Success; }
public RequestHandler(Tacker t, HttpListenerContext ctx) { context = ctx; tacker = t; }
public override void Execute(IList<string> parameters) { tacker = new Tacker (Directory.GetCurrentDirectory ()); tacker.Tack (); new Thread (WatchForChanges).Start (); HttpListener listener = new HttpListener(); listener.Prefixes.Add ("http://*:8080/"); listener.Start (); Console.WriteLine ("Serving from {0}, listening on port 8080 …", tacker.TargetDir); for(;;) { HttpListenerContext ctx = listener.GetContext(); new Thread (new RequestHandler (tacker, ctx).ProcessRequest).Start (); } }
public void Filter(Tacker tacker, string src) { var dir = Path.GetDirectoryName (src.Replace (tacker.AssetDir, tacker.TargetDir)); var dest = Path.Combine (dir, Path.GetFileNameWithoutExtension (src) + ".css"); File.WriteAllText (dest, Less.Parse (File.ReadAllText (src))); }