Ejemplo n.º 1
0
        private IEnumerable <IFubuFile> findFiles(string filename)
        {
            if (_settings.Mode == SearchMode.PublicFolderOnly)
            {
                var publicFolder = _settings.DeterminePublicFolder();
                var appFolder    = FubuMvcPackageFacility.GetApplicationPath();

                return(new FileSystem().FindFiles(publicFolder, FileSet.Deep(filename))
                       .Select(x =>
                {
                    return new FubuFile(x, ContentFolder.Application)
                    {
                        RelativePath = x.PathRelativeTo(appFolder).Replace('\\', '/')
                    };
                }));
            }


            return(_files.FindFiles(FileSet.Deep(filename, _settings.Exclusions)));
        }
Ejemplo n.º 2
0
        private IEnumerable <IFubuFile> findFiles(string filename)
        {
            if (_settings.Mode == SearchMode.PublicFolderOnly)
            {
                var publicFolder = _settings.DeterminePublicFolder(_files);
                var appFolder    = _files.RootPath;

                return(new FileSystem().FindFiles(publicFolder, FileSet.Deep(filename))
                       .Select(x =>
                {
                    return new FubuFile(x)
                    {
                        RelativePath = x.PathRelativeTo(appFolder).Replace('\\', '/')
                    };
                }));
            }


            return(_files.FindFiles(FileSet.Deep(filename, _settings.Exclusions)));
        }
Ejemplo n.º 3
0
        public void determine_the_public_folder_with_no_version()
        {
            new FileSystem().CreateDirectory(
                FubuMvcPackageFacility.GetApplicationPath().AppendPath("public").ToFullPath());

            var settings = new AssetSettings
            {
                Version = null
            };

            settings.DeterminePublicFolder()
                .ShouldEqual(FubuMvcPackageFacility.GetApplicationPath().AppendPath("public"));
        }
Ejemplo n.º 4
0
        public void determine_the_public_folder_with_a_non_null_but_nonexistent_version()
        {
            new FileSystem().CreateDirectory(
                FubuMvcPackageFacility.GetApplicationPath().AppendPath("public").ToFullPath());

            var settings = new AssetSettings
            {
                Version = Guid.NewGuid().ToString()
            };

            settings.DeterminePublicFolder()
                .ShouldEqual(FubuMvcPackageFacility.GetApplicationPath().AppendPath("public").ToFullPath());
        }
Ejemplo n.º 5
0
        public void determine_the_public_folder_when_the_version_does_exist()
        {
            new FileSystem().CreateDirectory(
                FubuMvcPackageFacility.GetApplicationPath().AppendPath("public").ToFullPath());
            new FileSystem().CreateDirectory(
                FubuMvcPackageFacility.GetApplicationPath().AppendPath("public", "1.0.1").ToFullPath());

            var settings = new AssetSettings
            {
                Version = "1.0.1"
            };

            settings.DeterminePublicFolder()
                .ShouldEqual(FubuMvcPackageFacility.GetApplicationPath().AppendPath("public", "1.0.1").ToFullPath());
        }
Ejemplo n.º 6
0
        private static IEnumerable<IFubuFile> findAssetFiles(BehaviorGraph behaviorGraph, AssetSettings settings)
        {
            var search = settings.CreateAssetSearch();

            if (settings.Mode == SearchMode.PublicFolderOnly)
            {
                var publicFolder = settings.DeterminePublicFolder();
                var appFolder = FubuMvcPackageFacility.GetApplicationPath();

                return new FileSystem().FindFiles(publicFolder, search)
                    .Select(x => {
                        return new FubuFile(x, ContentFolder.Application)
                        {
                            RelativePath = x.PathRelativeTo(appFolder)
                        };
                    });
            }

            return behaviorGraph.Files.FindFiles(search);
        }
Ejemplo n.º 7
0
        public void determine_the_public_folder_with_no_version()
        {
            new FileSystem().CreateDirectory(
                PublicFolder.ToFullPath());

            var settings = new AssetSettings
            {
                Version = null
            };

            settings.DeterminePublicFolder(FubuApplicationFiles.ForDefault())
                .ShouldBe(PublicFolder);
        }
Ejemplo n.º 8
0
        public void determine_the_public_folder_with_a_non_null_but_nonexistent_version()
        {
            new FileSystem().CreateDirectory(
                PublicFolder.ToFullPath());

            var settings = new AssetSettings
            {
                Version = Guid.NewGuid().ToString()
            };

            settings.DeterminePublicFolder(FubuApplicationFiles.ForDefault())
                .ShouldBe(PublicFolder.ToFullPath());
        }
Ejemplo n.º 9
0
        public void determine_the_public_folder_when_the_version_does_exist()
        {
            new FileSystem().CreateDirectory(
                PublicFolder.ToFullPath());
            var expectedPath = AppDomain.CurrentDomain.BaseDirectory
                .ParentDirectory().ParentDirectory().AppendPath("public", "1.0.1").ToFullPath();

            new FileSystem().CreateDirectory(
                expectedPath);

            var settings = new AssetSettings
            {
                Version = "1.0.1"
            };

            settings.DeterminePublicFolder(FubuApplicationFiles.ForDefault())
                .ShouldBe(expectedPath);
        }