public void Configure(ModuleConfiguration modules, ICassetteApplication application) { modules.Add( new PerSubDirectorySource<ScriptModule>("Scripts") { FilePattern = "*.js", Exclude = new Regex("-vsdoc\\.js$") }, new ExternalScriptModule("twitter", "http://platform.twitter.com/widgets.js") { Location = "body" } ); modules.Add(new DirectorySource<StylesheetModule>("Styles") { FilePattern = "*.css;*.less", CustomizeModule = module => module.Processor = new StylesheetPipeline { CompileLess = true, ConvertImageUrlsToDataUris = true } }); modules.Add(new PerSubDirectorySource<HtmlTemplateModule>("HtmlTemplates") { CustomizeModule = module => module.Processor = new KnockoutJQueryTmplPipeline() }); }
public void Configure(ModuleConfiguration moduleConfiguration, ICassetteApplication application) { moduleConfiguration.Add(new DirectorySource<StylesheetModule>("assets/styles") { FilePattern = "*.css" }); }
public BundleConfiguration(ICassetteApplication application, IDirectory cacheDirectory, IDirectory sourceDirectory, Dictionary <Type, object> bundleFactories, string version) { this.application = application; this.cacheDirectory = cacheDirectory; this.sourceDirectory = sourceDirectory; this.bundleFactories = bundleFactories; this.version = version; }
public ModuleSourceTestBase() { root = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); Directory.CreateDirectory(root); application = StubApplication(); moduleFactory = StubModuleFactory(); }
public IEnumerable <T> GetBundles(IBundleFactory <T> bundleFactory, ICassetteApplication application) { var directory = GetDirectoryForBasePath(application); var filenames = GetFilenames(directory); return(from filename in filenames select CreateBundle(filename, bundleFactory, directory)); }
public BundleRequestHandler(ICassetteApplication application, RequestContext requestContext) { this.application = application; routeData = requestContext.RouteData; response = requestContext.HttpContext.Response; request = requestContext.HttpContext.Request; httpContext = requestContext.HttpContext; }
public void Configure(ModuleConfiguration moduleConfiguration, ICassetteApplication application) { moduleConfiguration.Add(new ExternalScriptModule("jquery", "//ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js")); moduleConfiguration.Add(new PerSubDirectorySource<ScriptModule>("assets/scripts")); moduleConfiguration.Add(new DirectorySource<StylesheetModule>("assets/styles") { FilePattern = "*.css" }); }
public IEnumerable <T> GetBundles(IBundleFactory <T> bundleFactory, ICassetteApplication application) { var root = application.RootDirectory; var bundles = ( from subDirectoryName in GetBundleDirectoryPaths(application) where IsNotHidden(root, subDirectoryName) select CreateBundle( subDirectoryName, root.GetDirectory(subDirectoryName.Substring(2), false), bundleFactory ) ).ToArray(); CustomizeBundles(bundles); return(bundles); }
protected override IEnumerable <string> GetBundleDirectoryPaths(ICassetteApplication application) { return(application.RootDirectory.GetDirectoryPaths(baseDirectory).Select(EnsureApplicationRelativePath)); }
public override IHtmlString Render(ICassetteApplication application) { return Renderer.Render(this); }
public override void Process(ICassetteApplication application) { Processor.Process(this, application); }
IDirectory GetDirectoryForBasePath(ICassetteApplication application) { return(basePath.Length == 1 ? application.RootDirectory : application.RootDirectory.GetDirectory(basePath.Substring(2), false)); }
public ReferenceBuilder_Render_Tests() { bundleContainer = new Mock<IBundleContainer>(); placeholderTracker = new Mock<IPlaceholderTracker>(); application = Mock.Of<ICassetteApplication>(); bundleFactories = new Dictionary<Type, IBundleFactory<Bundle>>(); bundleContainer.Setup(c => c.IncludeReferencesAndSortBundles(It.IsAny<IEnumerable<Bundle>>())) .Returns<IEnumerable<Bundle>>(ms => ms); placeholderTracker.Setup(t => t.InsertPlaceholder(It.IsAny<Func<string>>())) .Returns(("output")); referenceBuilder = new ReferenceBuilder(bundleContainer.Object, bundleFactories, placeholderTracker.Object, new CassetteSettings()); }
protected abstract IEnumerable <string> GetBundleDirectoryPaths(ICassetteApplication application);
public ReferenceBuilder_Render_Tests() { moduleContainer = new Mock<IModuleContainer<Module>>(); moduleFactory = new Mock<IModuleFactory<Module>>(); placeholderTracker = new Mock<IPlaceholderTracker>(); application = Mock.Of<ICassetteApplication>(); referenceBuilder = new ReferenceBuilder<Module>(moduleContainer.Object, moduleFactory.Object, placeholderTracker.Object, application); moduleContainer.Setup(c => c.IncludeReferencesAndSortModules(It.IsAny<IEnumerable<Module>>())) .Returns<IEnumerable<Module>>(ms => ms); placeholderTracker.Setup(t => t.InsertPlaceholder(It.IsAny<Func<IHtmlString>>())) .Returns(new HtmlString("output")); }
public void Configure(ModuleConfiguration moduleConfiguration, ICassetteApplication application) { moduleConfiguration.Add(Mock.Of<IModuleSource<ScriptModule>>()); moduleConfiguration.Add(Mock.Of<IModuleSource<StylesheetModule>>()); moduleConfiguration.Add(Mock.Of<IModuleSource<HtmlTemplateModule>>()); }
protected override IEnumerable <string> GetBundleDirectoryPaths(ICassetteApplication application) { return(relativeDirectoryPaths); }
public ExpandCssUrlsAssetTransformer(ICassetteApplication application) { this.application = application; }