コード例 #1
0
        private IEnumerable <AssetFile> writeBinary(AssetPath asset)
        {
            var file = _pipeline.Find(asset);

            _writer.WriteFile(file.MimeType, file.FullPath, null);

            return(new AssetFile[] { file });
        }
コード例 #2
0
 public void UseAssetIfExists(params string[] names)
 {
     names.Each(name =>
     {
         if (_pipeline.Find(name) != null)
         {
             Require(name);
         }
     });
 }
コード例 #3
0
        // TODO -- would be nice if we could log the provenance of the file dependency.
        // i.e. -- which file had the wrong stuff
        public void VerifyFileDependency(string name)
        {
            var file = _pipeline.Find(name);

            if (file == null)
            {
                // Guard clause to allow automated tests with faked up data work
                if (AssetDeclarationVerificationActivator.Latched)
                {
                    return;
                }
                _log.MarkFailure(GetErrorMessage(name, _assetLogs));
            }
        }
コード例 #4
0
        public string GetFullPath(string path)
        {
            if (CurrentFolder.IsNotEmpty())
            {
                path = string.Concat(CurrentFolder, "/", path);
            }
            var assetFile = _assetPipeline.Find(path);

            if (assetFile == null)
            {
                return(null);
            }
            return(assetFile.FullPath);
        }
コード例 #5
0
 public IEnumerable <IAssetTagSubject> FindSubjects(IEnumerable <string> names)
 {
     foreach (var name in names)
     {
         var file = _pipeline.Find(name);
         if (file != null)
         {
             yield return(file);
         }
         else
         {
             yield return(new MissingAssetTagSubject(name));
         }
     }
 }
コード例 #6
0
ファイル: ContentPlanner.cs プロジェクト: rmueller/fubumvc
        public IEnumerable<AssetFile> FindFiles(string name)
        {
            var combination = _combinations.FindCombination(name);
            if (combination != null)
            {
                return combination.Files;
            }

            var assetFile = _pipeline.Find(name);

            if (assetFile == null)
            {
                throw new ArgumentOutOfRangeException("No combination or asset file exists with the name " + name);
            }


            return new[]{assetFile};
        }
コード例 #7
0
        public IEnumerable <AssetFile> FindFiles(string name)
        {
            var combination = _combinations.FindCombination(name);

            if (combination != null)
            {
                return(combination.Files);
            }

            var assetFile = _pipeline.Find(name);

            if (assetFile == null)
            {
                return(Enumerable.Empty <AssetFile>());
            }


            return(new[] { assetFile });
        }
コード例 #8
0
        public void Activate(IEnumerable <IPackageInfo> packages, IPackageLog log)
        {
            _graph.PolicyTypes.Each(type =>
            {
                if (type.CanBeCastTo <IAssetPolicy>())
                {
                    log.Trace("Registering {0} as an IAssetPolicy", type.FullName);
                    _container.Inject(typeof(IAssetPolicy), type);
                }

                if (type.CanBeCastTo <ICombinationPolicy>())
                {
                    log.Trace("Registering {0} as an ICombinationPolicy", type.FullName);
                    _container.Inject(typeof(ICombinationPolicy), type);
                }
            });

            _graph.ForCombinations((name, assetNames) =>
            {
                var mimeType = MimeType.MimeTypeByFileName(assetNames.First());
                _cache.AddFilesToCandidate(mimeType, name, assetNames.Select(x => _pipeline.Find(x)));
            });
        }