Ejemplo n.º 1
0
        /// <summary>
        /// <para>
        /// Enable SassAndCoffee support in the application.
        /// </para>
        /// <para>
        /// SassAndCoffee supports on the fly compilation and caching of CoffeeScript and Sass,
        /// along with concatenation and minification.
        /// </para>
        /// </summary>
        /// <param name="pipelines">Application pipelines to hook into</param>
        /// <param name="cache">Cache provider to use</param>
        /// <param name="rootPathProvider">Root path provider</param>
        public static void Enable(IApplicationPipelines pipelines, ICompiledCache cache, IRootPathProvider rootPathProvider)
        {
            var host = new NancyCompilerHost(rootPathProvider);

            var compiler = new ContentCompiler(host, cache);

            pipelines.BeforeRequest.AddItemToStartOfPipeline(GetPipelineHook(compiler));
        }
Ejemplo n.º 2
0
        public ContentCompiler(ICompilerHost host, ICompiledCache cache, IEnumerable<ISimpleFileCompiler> compilers)
        {
            _host = host;
            _cache = cache;
            _compilers = compilers;

            Init();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// <para>
        /// Enable SassAndCoffee support in the application.
        /// </para>
        /// <para>
        /// SassAndCoffee supports on the fly compilation and caching of CoffeeScript and Sass,
        /// along with concatenation and minification.
        /// </para>
        /// </summary>
        /// <param name="pipelines">Application pipelines to hook into</param>
        /// <param name="cache">Cache provider to use</param>
        /// <param name="rootPathProvider">Root path provider</param>
        public static void Enable(IPipelines pipelines, ICompiledCache cache, IRootPathProvider rootPathProvider)
        {
            var host = new NancyCompilerHost(rootPathProvider);

            var compiler = new ContentCompiler(host, cache);

            pipelines.BeforeRequest.AddItemToStartOfPipeline(GetPipelineHook(compiler));
        }
Ejemplo n.º 4
0
        public ContentCompiler(ICompiledCache cache)
        {
            _cache = cache;

            _compilers = new ISimpleFileCompiler[] {
                new FileConcatenationCompiler(this),
                new MinifyingFileCompiler(),
                new CoffeeScriptFileCompiler(),
                new SassFileCompiler(),
                new JavascriptPassthroughCompiler(),
            };
        }
Ejemplo n.º 5
0
 public ContentCompiler(ICompiledCache cache, IEnumerable<ISimpleFileCompiler> compilers)
 {
     _cache = cache;
     _compilers = compilers;
 }