コード例 #1
0
        public void Init(HttpApplication context)
        {
            var coffeeEngine = new CoffeeScriptCompiler();

            var compilers = new ISimpleFileCompiler[] {
                new ConcatenationFileHandler(this),
                new MinifyingFileCompiler(coffeeEngine),
                new CoffeeScriptFileCompiler(coffeeEngine),
                new SassFileCompiler(),
                new JavascriptPassthroughCompiler(),
            };

            _handlers = new Dictionary<ISimpleFileCompiler, IHttpHandler>();
            foreach (var compiler in compilers) {
                compiler.Init(context);
                _handlers[compiler] = new CompilableFileHandler(compiler);
            }

            context.PostResolveRequestCache += (o, e) => {
                var app = o as HttpApplication;
                var compiler = MapPathToCompiler(app.Request.PhysicalPath);

                if (compiler == null) {
                    return;
                }

                app.Context.RemapHandler(_handlers[compiler]);
            };
        }
コード例 #2
0
 public void Init(HttpApplication context)
 {
     _engine = new CoffeeScriptCompiler();
 }
コード例 #3
0
 public MinifyingFileCompiler(CoffeeScriptCompiler coffeeScriptEngine)
 {
     _coffeeEngine = coffeeScriptEngine;
 }
コード例 #4
0
 public CoffeeScriptFileCompiler(CoffeeScriptCompiler engine = null)
 {
     _engine = engine;
 }
コード例 #5
0
 public MinifyingFileCompiler(CoffeeScriptCompiler coffeeScriptEngine)
 {
     _coffeeEngine = new TrashStack<CoffeeScriptCompiler>(() => new CoffeeScriptCompiler());
     _engine = new TrashStack<MinifyingCompiler>(() => new MinifyingCompiler());
 }