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(); }
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(); }
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(); }
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; }
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); }