예제 #1
0
        private CrusherManager()
        {
            var crusherConfiguration = CurrentCrusherConfiguration.Current;

            _hashQueryStringKeyName = crusherConfiguration.QuerystringKeyName;
            _cssGroups = crusherConfiguration.CssGroups;
            _jsGroups  = crusherConfiguration.JsGroups;

            var retryableFileOpener = new RetryableFileOpener();
            var hasher = new Hasher(retryableFileOpener);
            var retryableFileWriter = new RetryableFileWriter(BufferSize, _encoding, retryableFileOpener, hasher);

            _pathProvider = new PathProvider();
            var cssAssetsFileHasher = new CssAssetsFileHasher(_hashQueryStringKeyName, hasher, _pathProvider);
            var cssPathRewriter     = new CssPathRewriter(cssAssetsFileHasher, _pathProvider);

            var cacheManager = new HttpCacheManager();

            var jsSpriteMetaDataFileInfo = new FileInfo("js.metadata");
            var jsMetaData = new SingleFileMetaData(jsSpriteMetaDataFileInfo, retryableFileOpener, retryableFileWriter);

            var cssSpriteMetaDataFileInfo = new FileInfo("css.metadata");
            var cssMetaData = new SingleFileMetaData(cssSpriteMetaDataFileInfo, retryableFileOpener, retryableFileWriter);

            _cssCrusher = new CssCrusher(cacheManager, _pathProvider, retryableFileOpener, retryableFileWriter, cssPathRewriter, cssMetaData, crusherConfiguration.WatchAssets);
            _jsCrusher  = new JsCrusher(cacheManager, _pathProvider, retryableFileOpener, retryableFileWriter, jsMetaData);

            InitManager();
        }
예제 #2
0
        private CrusherManager()
        {
            var crusherConfiguration = CurrentCrusherConfiguration.Current;
            _hashQueryStringKeyName = crusherConfiguration.QuerystringKeyName;
            _cssGroups = crusherConfiguration.CssGroups;
            _jsGroups = crusherConfiguration.JsGroups;

            var retryableFileOpener = new RetryableFileOpener();
            var hasher = new Hasher(retryableFileOpener);
            var retryableFileWriter = new RetryableFileWriter(BufferSize, _encoding, retryableFileOpener, hasher);
            _pathProvider = new PathProvider();
            var cssAssetsFileHasher = new CssAssetsFileHasher(_hashQueryStringKeyName, hasher, _pathProvider);
            var cssPathRewriter = new CssPathRewriter(cssAssetsFileHasher, _pathProvider);

            var cacheManager = new HttpCacheManager();

            var jsSpriteMetaDataFileInfo = new FileInfo("js.metadata");
            var jsMetaData = new SingleFileMetaData(jsSpriteMetaDataFileInfo, retryableFileOpener, retryableFileWriter);

            var cssSpriteMetaDataFileInfo = new FileInfo("css.metadata");
            var cssMetaData = new SingleFileMetaData(cssSpriteMetaDataFileInfo, retryableFileOpener, retryableFileWriter);

            _cssCrusher = new CssCrusher(cacheManager, _pathProvider, retryableFileOpener, retryableFileWriter, cssPathRewriter, cssMetaData, crusherConfiguration.WatchAssets);
            _jsCrusher = new JsCrusher(cacheManager, _pathProvider, retryableFileOpener, retryableFileWriter, jsMetaData);

            InitManager();
        }
예제 #3
0
 private CrusherManager()
 {
     var retryableFileOpener = new RetryableFileOpener();
     var hasher = new Hasher(retryableFileOpener);
     var retryableFileWriter = new RetryableFileWriter(BufferSize, retryableFileOpener, hasher);
     _pathProvider = new PathProvider();
     var cssAssetsFileHasher = new CssAssetsFileHasher(_hashQueryStringKeyName, hasher, _pathProvider);
     var cssPathRewriter = new CssPathRewriter(cssAssetsFileHasher, _pathProvider);
     _cssCrusher = new CssCrusher(retryableFileOpener, retryableFileWriter, cssPathRewriter, _pathProvider);
     _jsCrusher = new JsCrusher(retryableFileOpener, retryableFileWriter, _pathProvider);
     InitManager();
 }
예제 #4
0
        private CrusherManager()
        {
            var crusherConfiguration = CurrentCrusherConfiguration.Current;
            _hashQueryStringKeyName = crusherConfiguration.QuerystringKeyName;
            _cssGroups = crusherConfiguration.CssGroups;
            _jsGroups = crusherConfiguration.JsGroups;

            var retryableFileOpener = new RetryableFileOpener();
            var hasher = new Hasher(retryableFileOpener);
            var retryableFileWriter = new RetryableFileWriter(BufferSize, retryableFileOpener, hasher);
            _pathProvider = new PathProvider();
            var cssAssetsFileHasher = new CssAssetsFileHasher(_hashQueryStringKeyName, hasher, _pathProvider);
            var cssPathRewriter = new CssPathRewriter(cssAssetsFileHasher, _pathProvider);

            _cacheManager = new HttpCacheManager();
            _cssCrusher = new CssCrusher(_cacheManager, _pathProvider, retryableFileOpener, retryableFileWriter, cssPathRewriter);
            _jsCrusher = new JsCrusher(_cacheManager, _pathProvider, retryableFileOpener, retryableFileWriter);

            InitManager();
        }
예제 #5
0
        private CrusherManager()
        {
            var crusherConfiguration = CurrentCrusherConfiguration.Current;

            _hashQueryStringKeyName = crusherConfiguration.QuerystringKeyName;
            _cssGroups = crusherConfiguration.CssGroups;
            _jsGroups  = crusherConfiguration.JsGroups;

            var retryableFileOpener = new RetryableFileOpener();
            var hasher = new Hasher(retryableFileOpener);
            var retryableFileWriter = new RetryableFileWriter(BufferSize, retryableFileOpener, hasher);

            _pathProvider = new PathProvider();
            var cssAssetsFileHasher = new CssAssetsFileHasher(_hashQueryStringKeyName, hasher, _pathProvider);
            var cssPathRewriter     = new CssPathRewriter(cssAssetsFileHasher, _pathProvider);

            _cacheManager = new HttpCacheManager();
            _cssCrusher   = new CssCrusher(_cacheManager, _pathProvider, retryableFileOpener, retryableFileWriter, cssPathRewriter);
            _jsCrusher    = new JsCrusher(_cacheManager, _pathProvider, retryableFileOpener, retryableFileWriter);

            InitManager();
        }
예제 #6
0
        public StringBuilder ProcessGroups(IPathProvider pathProvider, ICssCrusher cssCrusher, CssGroupElementCollection cssGroups)
        {
            var output = new StringBuilder("Css Files created:\r\n");

            Action<CssGroupToProcess> processGroupConfiguration = ProcessGroup;
            var cssGroupsToProcess = cssGroups.Cast<CssGroupElement>()
                .Select(group => new CssGroupToProcess
                {
                    Crusher = cssCrusher,
                    PathProvider = pathProvider,
                    Group = group,
                    Output = output
                }).ToList();

            if (cssGroupsToProcess.Any())
            {
                ParallelExecute.EachParallel(cssGroupsToProcess, processGroupConfiguration);
            }
            else
            {
                output.AppendFormat("No files to process");
            }
            return output;
        }
예제 #7
0
        public StringBuilder ProcessGroups(IPathProvider pathProvider, ICssCrusher cssCrusher, CssGroupElementCollection cssGroups)
        {
            var output = new StringBuilder("Css Files created:\r\n");

            Action <CssGroupToProcess> processGroupConfiguration = ProcessGroup;
            var cssGroupsToProcess = cssGroups.Cast <CssGroupElement>()
                                     .Select(group => new CssGroupToProcess
            {
                Crusher      = cssCrusher,
                PathProvider = pathProvider,
                Group        = group,
                Output       = output
            }).ToList();

            if (cssGroupsToProcess.Any())
            {
                ParallelExecute.EachParallel(cssGroupsToProcess, processGroupConfiguration);
            }
            else
            {
                output.AppendFormat("No files to process");
            }
            return(output);
        }