Exemple #1
0
 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;
 }
Exemple #2
0
 public RequestHandler(Tacker t, HttpListenerContext ctx)
 {
     context = ctx;
     tacker = t;
 }
Exemple #3
0
        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 ();
            }
        }
Exemple #4
0
 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)));
 }