Esempio n. 1
0
 public CssSpriteCreator(ICacheManager cacheManager, IRetryableFileOpener retryableFileOpener, IPathProvider pathProvider, IRetryableFileWriter retryableFileWriter)
 {
     CacheManager        = cacheManager;
     RetryableFileOpener = retryableFileOpener;
     PathProvider        = pathProvider;
     RetryableFileWriter = retryableFileWriter;
 }
Esempio n. 2
0
 public CssCrusher(IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter, ICssPathRewriter cssPathRewriter, IPathProvider pathProvider)
 {
     RetryableFileOpener = retryableFileOpener;
     RetryableFileWriter = retryableFileWriter;
     CssPathRewriter = cssPathRewriter;
     PathProvider = pathProvider;
 }
Esempio n. 3
0
 public CssSpriteCreator(ICacheManager cacheManager, IRetryableFileOpener retryableFileOpener, IPathProvider pathProvider, IRetryableFileWriter retryableFileWriter)
 {
     CacheManager = cacheManager;
     RetryableFileOpener = retryableFileOpener;
     PathProvider = pathProvider;
     RetryableFileWriter = retryableFileWriter;
 }
Esempio n. 4
0
 public CssSpriteCreator(ICacheManager cacheManager, IRetryableFileOpener retryableFileOpener, IPathProvider pathProvider, IRetryableFileWriter retryableFileWriter, IMetaData fileMetaData)
 {
     CacheManager        = cacheManager;
     RetryableFileOpener = retryableFileOpener;
     PathProvider        = pathProvider;
     RetryableFileWriter = retryableFileWriter;
     FileMetaData        = fileMetaData;
 }
Esempio n. 5
0
 public CssSpriteCreator(ICacheManager cacheManager, IRetryableFileOpener retryableFileOpener, IPathProvider pathProvider, IRetryableFileWriter retryableFileWriter, IMetaData fileMetaData)
 {
     CacheManager = cacheManager;
     RetryableFileOpener = retryableFileOpener;
     PathProvider = pathProvider;
     RetryableFileWriter = retryableFileWriter;
     FileMetaData = fileMetaData;
 }
Esempio n. 6
0
 public JsCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter)
 {
     CacheManager                         = cacheManager;
     PathProvider                         = pathProvider;
     RetryableFileOpener                  = retryableFileOpener;
     RetryableFileWriter                  = retryableFileWriter;
     YahooYuiJavaScriptCompressor         = new Lazy <Yahoo.Yui.Compressor.JavaScriptCompressor>();
     MicrosoftAjaxMinJavaScriptCompressor = new Lazy <Microsoft.Ajax.Utilities.Minifier>();
 }
Esempio n. 7
0
 public JsCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter)
 {
     CacheManager        = cacheManager;
     PathProvider        = pathProvider;
     RetryableFileOpener = retryableFileOpener;
     RetryableFileWriter = retryableFileWriter;
     YahooYuiJavaScriptCompressorPool         = new Pool <JavaScriptCompressor>(64, pool => new JavaScriptCompressor(), LoadingMode.LazyExpanding, AccessMode.Circular);
     MicrosoftAjaxMinJavaScriptCompressorPool = new Pool <Minifier>(64, pool => new Minifier(), LoadingMode.LazyExpanding, AccessMode.Circular);
 }
Esempio n. 8
0
 public JsCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter)
 {
     CacheManager = cacheManager;
     PathProvider = pathProvider;
     RetryableFileOpener = retryableFileOpener;
     RetryableFileWriter = retryableFileWriter;
     YahooYuiJavaScriptCompressor = new Lazy<Yahoo.Yui.Compressor.JavaScriptCompressor>();
     MicrosoftAjaxMinJavaScriptCompressor = new Lazy<Microsoft.Ajax.Utilities.Minifier>();
 }
Esempio n. 9
0
 public CssCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter, ICssPathRewriter cssPathRewriter)
 {
     CacheManager = cacheManager;
     PathProvider = pathProvider;
     RetryableFileOpener = retryableFileOpener;
     RetryableFileWriter = retryableFileWriter;
     CssPathRewriter = cssPathRewriter;
     YahooYuiCssCompressor = new Lazy<Yahoo.Yui.Compressor.CssCompressor>();
     MicrosoftAjaxMinCssCompressor = new Lazy<Microsoft.Ajax.Utilities.Minifier>();
 }
Esempio n. 10
0
 public CssCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter, ICssPathRewriter cssPathRewriter)
 {
     CacheManager                      = cacheManager;
     PathProvider                      = pathProvider;
     RetryableFileOpener               = retryableFileOpener;
     RetryableFileWriter               = retryableFileWriter;
     CssPathRewriter                   = cssPathRewriter;
     YahooYuiCssCompressorPool         = new Pool <Yahoo.Yui.Compressor.CssCompressor>(64, pool => new Yahoo.Yui.Compressor.CssCompressor(), LoadingMode.LazyExpanding, AccessMode.Circular);
     MicrosoftAjaxMinCssCompressorPool = new Pool <Microsoft.Ajax.Utilities.Minifier>(64, pool => new Microsoft.Ajax.Utilities.Minifier(), LoadingMode.LazyExpanding, AccessMode.Circular);
 }
Esempio n. 11
0
 public CssCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter, ICssPathRewriter cssPathRewriter)
 {
     CacheManager                  = cacheManager;
     PathProvider                  = pathProvider;
     RetryableFileOpener           = retryableFileOpener;
     RetryableFileWriter           = retryableFileWriter;
     CssPathRewriter               = cssPathRewriter;
     YahooYuiCssCompressor         = new Lazy <Yahoo.Yui.Compressor.CssCompressor>();
     MicrosoftAjaxMinCssCompressor = new Lazy <Microsoft.Ajax.Utilities.Minifier>();
 }
Esempio n. 12
0
 public JsCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter, IMetaData fileMetaData)
 {
     CacheManager = cacheManager;
     PathProvider = pathProvider;
     RetryableFileOpener = retryableFileOpener;
     RetryableFileWriter = retryableFileWriter;
     FileMetaData = fileMetaData;
     YahooYuiJavaScriptCompressorPool = new Pool<JavaScriptCompressor>(64, pool => new JavaScriptCompressor(), LoadingMode.LazyExpanding, AccessMode.Circular);
     MicrosoftAjaxMinJavaScriptCompressorPool = new Pool<Minifier>(64, pool => new Minifier(), LoadingMode.LazyExpanding, AccessMode.Circular);
 }
Esempio n. 13
0
 public CssCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter, ICssPathRewriter cssPathRewriter, IMetaData fileMetaData, bool watchAssets)
 {
     CacheManager = cacheManager;
     PathProvider = pathProvider;
     RetryableFileOpener = retryableFileOpener;
     RetryableFileWriter = retryableFileWriter;
     CssPathRewriter = cssPathRewriter;
     FileMetaData = fileMetaData;
     WatchAssets = watchAssets;
     YahooYuiCssCompressorPool = new Pool<Yahoo.Yui.Compressor.CssCompressor>(64, pool => new Yahoo.Yui.Compressor.CssCompressor(), LoadingMode.LazyExpanding, AccessMode.Circular);
     MicrosoftAjaxMinCssCompressorPool = new Pool<Microsoft.Ajax.Utilities.Minifier>(64, pool => new Microsoft.Ajax.Utilities.Minifier(), LoadingMode.LazyExpanding, AccessMode.Circular);
 }
Esempio n. 14
0
        public CrusherMsBuildCommand(string applicationPath, string binDirectoryPath, string configPath, Action <string> logMessage, Action <string> logError)
        {
            if (string.IsNullOrEmpty(applicationPath))
            {
                throw new ArgumentNullException("applicationPath");
            }

            if (string.IsNullOrEmpty(binDirectoryPath))
            {
                throw new ArgumentNullException("binDirectoryPath");
            }

            if (string.IsNullOrEmpty(configPath))
            {
                throw new ArgumentNullException("configPath");
            }

            if (logMessage == null)
            {
                throw new ArgumentNullException("logMessage");
            }

            if (logError == null)
            {
                throw new ArgumentNullException("logError");
            }

            _applicationPath  = applicationPath;
            _binDirectoryPath = binDirectoryPath;
            _configPath       = configPath;
            _logMessage       = logMessage;
            _logError         = logError;

            _retryableFileOpener = new RetryableFileOpener();
            _hasher = new Hasher(_retryableFileOpener);
            _retryableFileWriter = new RetryableFileWriter(BufferSize, Encoding, _retryableFileOpener, _hasher);
            _fileMetaData        = new MultiFileMetaData(_retryableFileOpener, _retryableFileWriter);

            _cssSpriteConfiguration = GetCssSpriteSection(_configPath, CssSpriteSectionName);
            _crusherConfiguration   = GetCrusherSection(_configPath, CrusherSectionName);

            var configUri = new Uri(_configPath, UriKind.RelativeOrAbsolute);

            if (!configUri.IsAbsoluteUri)
            {
                configUri = new Uri(Path.Combine(Environment.CurrentDirectory, configUri.ToString()));
            }

            var physicalApplicationPath = new FileInfo(configUri.LocalPath).DirectoryName;

            _pathProvider = new PathProvider(_applicationPath, physicalApplicationPath);
            _cacheManager = new HttpCacheManager();
        }
        public CrusherMsBuildCommand(string applicationPath, string binDirectoryPath, string configPath, Action<string> logMessage, Action<string> logError)
        {
            if (string.IsNullOrEmpty(applicationPath))
            {
                throw new ArgumentNullException("applicationPath");
            }

            if (string.IsNullOrEmpty(binDirectoryPath))
            {
                throw new ArgumentNullException("binDirectoryPath");
            }

            if (string.IsNullOrEmpty(configPath))
            {
                throw new ArgumentNullException("configPath");
            }

            if (logMessage == null)
            {
                throw new ArgumentNullException("logMessage");
            }

            if (logError == null)
            {
                throw new ArgumentNullException("logError");
            }

            _applicationPath = applicationPath;
            _binDirectoryPath = binDirectoryPath;
            _configPath = configPath;
            _logMessage = logMessage;
            _logError = logError;

            _retryableFileOpener = new RetryableFileOpener();
            _hasher = new Hasher(_retryableFileOpener);
            _retryableFileWriter = new RetryableFileWriter(BufferSize, Encoding, _retryableFileOpener, _hasher);
            _fileMetaData = new MultiFileMetaData(_retryableFileOpener, _retryableFileWriter);

            _cssSpriteConfiguration = GetCssSpriteSection(_configPath, CssSpriteSectionName);
            _crusherConfiguration = GetCrusherSection(_configPath, CrusherSectionName);

            var configUri = new Uri(_configPath, UriKind.RelativeOrAbsolute);
            if (!configUri.IsAbsoluteUri)
            {
                configUri = new Uri(Path.Combine(Environment.CurrentDirectory, configUri.ToString()));
            }

            var physicalApplicationPath = new FileInfo(configUri.LocalPath).DirectoryName;
            _pathProvider = new PathProvider(_applicationPath, physicalApplicationPath);
            _cacheManager = new HttpCacheManager();
        }
Esempio n. 16
0
        private CrusherManager()
        {
            _crusherConfiguration = CurrentCrusherConfiguration.Current;

            _retryableFileOpener = new RetryableFileOpener();
            _hasher = new Md5Hasher(_retryableFileOpener);
			_retryableFileWriter = new RetryableFileWriter(BufferSize, _encoding, _retryableFileOpener, _hasher);
            _pathProvider = new PathProvider();

            _cacheManager = new HttpCacheManager();
            _fileMetaData = new MultiFileMetaData(_retryableFileOpener, _retryableFileWriter);
 
            InitManager();
        }
Esempio n. 17
0
        private CrusherManager()
        {
            _crusherConfiguration = CurrentCrusherConfiguration.Current;

            _retryableFileOpener = new RetryableFileOpener();
            _hasher = new Md5Hasher(_retryableFileOpener);
            _retryableFileWriter = new RetryableFileWriter(BufferSize, _encoding, _retryableFileOpener, _hasher);
            _pathProvider        = new PathProvider();

            _cacheManager = new HttpCacheManager();
            _fileMetaData = new MultiFileMetaData(_retryableFileOpener, _retryableFileWriter);

            InitManager();
        }
Esempio n. 18
0
 public JsCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter, IMetaData fileMetaData)
 {
     CacheManager        = cacheManager;
     PathProvider        = pathProvider;
     RetryableFileOpener = retryableFileOpener;
     RetryableFileWriter = retryableFileWriter;
     FileMetaData        = fileMetaData;
     YahooYuiJavaScriptCompressorPool         = new Pool <Yahoo.Yui.Compressor.JavaScriptCompressor>(4, pool => new Yahoo.Yui.Compressor.JavaScriptCompressor(), LoadingMode.LazyExpanding, AccessMode.Circular);
     MicrosoftAjaxMinJavaScriptCompressorPool = new Pool <Microsoft.Ajax.Utilities.Minifier>(44, pool => new Microsoft.Ajax.Utilities.Minifier(), LoadingMode.LazyExpanding, AccessMode.Circular);
     CoffeeCompilerPool     = new Pool <Coffee.CoffeeCompiler>(4, pool => new Coffee.CoffeeCompiler(new EmbeddedResourceLoader()), LoadingMode.LazyExpanding, AccessMode.Circular);
     IcedCoffeeCompilerPool = new Pool <IcedCoffee.IcedCoffeeCompiler>(4, pool => new IcedCoffee.IcedCoffeeCompiler(new EmbeddedResourceLoader()), LoadingMode.LazyExpanding, AccessMode.Circular);
     LiveScriptCompilerPool = new Pool <LiveScript.LiveScriptCompiler>(4, pool => new LiveScript.LiveScriptCompiler(new EmbeddedResourceLoader()), LoadingMode.LazyExpanding, AccessMode.Circular);
     HoganCompilerPool      = new Pool <Hogan.HoganCompiler>(4, pool => new Hogan.HoganCompiler(new EmbeddedResourceLoader()), LoadingMode.LazyExpanding, AccessMode.Circular);
 }
Esempio n. 19
0
 public JsCrusher(ICacheManager cacheManager, IPathProvider pathProvider, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter, IMetaData fileMetaData)
 {
     CacheManager = cacheManager;
     PathProvider = pathProvider;
     RetryableFileOpener = retryableFileOpener;
     RetryableFileWriter = retryableFileWriter;
     FileMetaData = fileMetaData;
     YahooYuiJavaScriptCompressorPool = new Pool<Yahoo.Yui.Compressor.JavaScriptCompressor>(4, pool => new Yahoo.Yui.Compressor.JavaScriptCompressor(), LoadingMode.LazyExpanding, AccessMode.Circular);
     MicrosoftAjaxMinJavaScriptCompressorPool = new Pool<Microsoft.Ajax.Utilities.Minifier>(44, pool => new Microsoft.Ajax.Utilities.Minifier(), LoadingMode.LazyExpanding, AccessMode.Circular);
     CoffeeCompilerPool = new Pool<Coffee.CoffeeCompiler>(4, pool => new Coffee.CoffeeCompiler(new EmbeddedResourceLoader()), LoadingMode.LazyExpanding, AccessMode.Circular);
     IcedCoffeeCompilerPool = new Pool<IcedCoffee.IcedCoffeeCompiler>(4, pool => new IcedCoffee.IcedCoffeeCompiler(new EmbeddedResourceLoader()), LoadingMode.LazyExpanding, AccessMode.Circular);
     LiveScriptCompilerPool = new Pool<LiveScript.LiveScriptCompiler>(4, pool => new LiveScript.LiveScriptCompiler(new EmbeddedResourceLoader()), LoadingMode.LazyExpanding, AccessMode.Circular);
     HoganCompilerPool = new Pool<Hogan.HoganCompiler>(4, pool => new Hogan.HoganCompiler(new EmbeddedResourceLoader()), LoadingMode.LazyExpanding, AccessMode.Circular);
 }
Esempio n. 20
0
        public SingleFileMetaData(FileInfo metaDataFile, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter)
        {
            _timer           = new System.Timers.Timer();
            _timer.Elapsed  += OnTimerElapsed;
            _timer.Interval  = PollTime;
            _timer.Enabled   = false;
            _timer.AutoReset = false;

            _metaDataFile        = metaDataFile;
            _retryableFileWriter = retryableFileWriter;

            if (metaDataFile.Exists)
            {
                _metaDataForFiles = retryableFileOpener.ReadAllText(_metaDataFile)
                                    .Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)
                                    .ToDictionary(k => k.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries)[0], v => v.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries)[1]);
            }
            else
            {
                _metaDataForFiles = new Dictionary <string, string>();
            }
        }
Esempio n. 21
0
        public SingleFileMetaData(FileInfo metaDataFile, IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter)
        {
            _timer = new System.Timers.Timer();
            _timer.Elapsed += OnTimerElapsed;
            _timer.Interval = PollTime;
            _timer.Enabled = false;
            _timer.AutoReset = false;

            _metaDataFile = metaDataFile;
            _retryableFileWriter = retryableFileWriter;

            if (metaDataFile.Exists)
            {

                _metaDataForFiles = retryableFileOpener.ReadAllText(_metaDataFile)
                    .Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)
                    .ToDictionary(k => k.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries)[0], v => v.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries)[1]);
            }
            else
            {
                _metaDataForFiles = new Dictionary<string, string>();
            }
        }
Esempio n. 22
0
 public JsCrusher(IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter, IPathProvider pathProvider)
 {
     RetryableFileOpener = retryableFileOpener;
     RetryableFileWriter = retryableFileWriter;
     PathProvider = pathProvider;
 }
Esempio n. 23
0
 public MultiFileMetaData(IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter)
 {
     _retryableFileOpener = retryableFileOpener;
     _retryableFileWriter = retryableFileWriter;
 }
 public CssSpriteCreator()
 {
     RetryableFileOpener = new RetryableFileOpener();
     Hasher = new Hasher(RetryableFileOpener);
     RetryableFileWriter = new RetryableFileWriter(BufferSize, RetryableFileOpener, Hasher);
 }
Esempio n. 25
0
 public MultiFileMetaData(IRetryableFileOpener retryableFileOpener, IRetryableFileWriter retryableFileWriter)
 {
     _retryableFileOpener = retryableFileOpener;
     _retryableFileWriter = retryableFileWriter;
 }
Esempio n. 26
0
 public CssSpriteCreator(IRetryableFileOpener retryableFileOpener, IHasher hasher, IRetryableFileWriter retryableFileWriter)
 {
     RetryableFileOpener = retryableFileOpener;
     Hasher = hasher;
     RetryableFileWriter = retryableFileWriter;
 }