예제 #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)));
        }
예제 #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)));
        }
예제 #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"));
        }
예제 #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());
        }
예제 #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());
        }
예제 #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);
        }
예제 #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);
        }
예제 #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());
        }
예제 #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);
        }