예제 #1
0
        private LinkTag linkTagForFolder(SpecificationFolder folder)
        {
            var specPath = folder.Path();
            var url      = _urls.UrlFor(specPath);

            return(new LinkTag(specPath.Parts.Last(), url));
        }
        public void find_child_folder()
        {
            var folder = new SpecificationFolder("pak1");
            var child = folder.ChildFolderFor("f1/f2/f3");

            child.FullName.ShouldEqual("pak1/f1/f2/f3");
            child.Parent.FullName.ShouldEqual("pak1/f1/f2");
            child.Parent.Parent.FullName.ShouldEqual("pak1/f1");
            child.Parent.Parent.Parent.FullName.ShouldEqual("pak1");
        }
예제 #3
0
        public HtmlTag BuildFolderTag(SpecificationFolder folder)
        {
            var folderTag = new HtmlTag("li");
            var link = linkTagForFolder(folder);

            folderTag.Add("span").AddClass("folder").Append(link);

            var ul = folderTag.Add("ul");

            var builder = new ChildTagBuilder(this, ul);
            folder.ImmediateChildren.Each(x => x.AcceptVisitor(builder));

            return folderTag;
        }
예제 #4
0
        public HtmlTag BuildFolderTag(SpecificationFolder folder)
        {
            var folderTag = new HtmlTag("li");
            var link      = linkTagForFolder(folder);

            folderTag.Add("span").AddClass("folder").Append(link);

            var ul = folderTag.Add("ul");

            var builder = new ChildTagBuilder(this, ul);

            folder.ImmediateChildren.Each(x => x.AcceptVisitor(builder));


            return(folderTag);
        }
예제 #5
0
        private static void addSpecs(IEnumerable <AssetFile> javascriptFiles, SpecificationFolder packageFolder)
        {
            javascriptFiles
            .Where(Specification.IsSpecification)
            .GroupBy(DetermineSpecContentFolder)
            .Each(group =>
            {
                var folder = packageFolder;

                if (!group.Key.IsEmpty())
                {
                    folder = packageFolder.ChildFolderFor(new SpecPath(group.Key));
                }

                folder.AddSpecs(group);
            });
        }
예제 #6
0
            public void Folder(SpecificationFolder folder)
            {
                var tag = _builder.BuildFolderTag(folder);

                _parent.Append(tag);
            }
예제 #7
0
 public SpecificationFolder(string name, SpecificationFolder parent) : this(name)
 {
     _parent = parent;
 }
예제 #8
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));
 }
예제 #9
0
        private static void addSpecs(IEnumerable<AssetFile> javascriptFiles, SpecificationFolder packageFolder)
        {
            javascriptFiles
                .Where(Specification.IsSpecification)
                .GroupBy(DetermineSpecContentFolder)
                .Each(group =>
                {
                    var folder = packageFolder;

                    if (!group.Key.IsEmpty())
                    {
                        folder = packageFolder.ChildFolderFor(new SpecPath(group.Key));
                    }

                    folder.AddSpecs(group);
                });
        }
예제 #10
0
 public void Folder(SpecificationFolder folder)
 {
     var tag = _builder.BuildFolderTag(folder);
     _parent.Append(tag);
 }
예제 #11
0
 private LinkTag linkTagForFolder(SpecificationFolder folder)
 {
     var specPath = folder.Path();
     var url = _urls.UrlFor(specPath);
     return new LinkTag(specPath.Parts.Last(), url);
 }
예제 #12
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));
        }
예제 #13
0
 public SpecificationFolder(string name, SpecificationFolder parent)
     : this(name)
 {
     _parent = parent;
 }