Beispiel #1
0
        /// <summary>
        ///   Use this method in automated tests when you need to set up an
        ///   AssetGraph
        /// </summary>
        /// <param name = "configure"></param>
        /// <returns></returns>
        public static AssetGraph Build(Action <AssetGraph> configure)
        {
            var graph = new AssetGraph();

            configure(graph);
            graph.CompileDependencies(new PackageLog());

            return(graph);
        }
Beispiel #2
0
        public void Activate(IEnumerable <IPackageInfo> packages, IPackageLog log)
        {
            _configurationFiles.Clear();

            ReadScriptConfig(FubuMvcPackageFacility.GetApplicationPath(), log);
            packages.Each(p => p.ForFolder(BottleFiles.WebContentFolder, folder => ReadScriptConfig(folder, log)));

            _assets.CompileDependencies(log);
        }
Beispiel #3
0
            public Reader()
            {
                _graph = new AssetGraph();
                _cache = new Lazy <AssetDependencyFinderCache>(() =>
                {
                    _graph.CompileDependencies(new PackageLog());
                    return(new AssetDependencyFinderCache(_graph));
                });

                _dslReader = new AssetDslReader(_graph);

                _action = text =>
                {
                    if (text.StartsWith("if", StringComparison.OrdinalIgnoreCase))
                    {
                        _action = _dslReader.ReadLine;
                    }
                };
            }
        public void using_the_configure_method()
        {
            var graph = new AssetGraph();
            var expression = new AssetsExpression(theRegistry, graph);

            expression.Configure(@"
            crud includes a.js, b.js, c.js
            ");

            graph.CompileDependencies(new PackageLog());

            graph.AssetSetFor("crud").AllFileDependencies()
                .Select(x => x.Name)
                .ShouldHaveTheSameElementsAs("a.js", "b.js", "c.js");
        }
Beispiel #5
0
            public Reader()
            {
                _graph = new AssetGraph();
                _cache = new Lazy<AssetDependencyFinderCache>(() =>
                {
                    _graph.CompileDependencies(new PackageLog());
                    return new AssetDependencyFinderCache(_graph);
                });

                _dslReader = new AssetDslReader(_graph);

                _action = text =>
                {
                    if (text.StartsWith("if", StringComparison.OrdinalIgnoreCase))
                    {
                        _action = _dslReader.ReadLine;
                    }
                };
            }
 public void SetUp()
 {
     graph = new AssetGraph();
     var reader = new AssetDslReader(graph);
     reader.ReadLine("1 includes A,B,C");
     reader.ReadLine("2 includes C,D");
     reader.ReadLine("3 includes 1,E");
     reader.ReadLine("D requires D1,D2");
     reader.ReadLine("3 requires 4");
     reader.ReadLine("4 includes jquery,validation.js");
     reader.ReadLine("Combo includes 1,2");
     reader.ReadLine("C-1 extends C");
     reader.ReadLine("crud includes crudForm.js,validation.js");
     reader.ReadLine("A requires crud");
     graph.CompileDependencies(new PackageLog());
 }