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