public AssetFileGraph()
        {
            _packages = new Cache<string, PackageAssets>(name =>
            {
                var package = new PackageAssets(name);
                _allPackages.Add(package);

                return package;
            });

            _packages.FillDefault(Application);

            _memoizedFiles = new Cache<string, AssetFile>(path => Find(new AssetPath(path)));
        }
Esempio n. 2
0
        public static bool IsSpecPackage(PackageAssets package)
        {
            if (package.PackageName == "application") return false;

            if (package.PackageName == AssemblyPackageInfo.CreateFor(typeof (SpecificationGraph).Assembly).Name)
                return false;

            return true;
        }
Esempio n. 3
0
 private static void associateHtmlFiles(PackageAssets package, SpecificationFolder packageFolder)
 {
     var htmlFiles = package.AllFiles().Where(x => x.MimeType == MimeType.Html).ToList();
     packageFolder.AllSpecifications.Each(x => x.SelectHtmlFiles(htmlFiles));
 }
Esempio n. 4
0
        public void AddSpecs(PackageAssets package)
        {
            var packageFolder = _packages[package.PackageName];

            var javascriptFiles = package
                .AllFiles()
                .Where(x => x.MimeType == MimeType.Javascript).ToList();

            addSpecs(javascriptFiles, packageFolder);
            associateSpecs(javascriptFiles);

            associateHtmlFiles(package, packageFolder);
        }
Esempio n. 5
0
 public void SetUp()
 {
     thePackageAssets = new PackageAssets("pak1");
     theFiles = new AssetFileDataMother(thePackageAssets.AddFile);
 }
        public static bool IsSpecPackage(PackageAssets package)
        {
            if (package.PackageName == "application") return false;
            if (package.PackageName == typeof(IAssetFileGraph).Assembly.GetName().Name) return false;
            if (package.PackageName == typeof(SpecificationGraph).Assembly.GetName().Name) return false;

            if (package.PackageName == new AssemblyPackageInfo(typeof (SpecificationGraph).Assembly).Name)
                return false;

            return true;
        }