Пример #1
0
        private static JasperServiceConfiguration serviceConfiguration()
        {
            var directory  = FubuRuntime.DefaultApplicationPath();
            var fileSystem = new FileSystem();

            return(fileSystem.LoadFromFile <JasperServiceConfiguration>(directory, JasperServiceConfiguration.FILE));
        }
Пример #2
0
        public void ignores_excluded_folders()
        {
            var faf = new FubuApplicationFiles(FubuRuntime.DefaultApplicationPath().AppendPath("Views", "Razor"));

            ClassUnderTest.Search.AppendExclude("*A3.cshtml");
            ClassUnderTest.Search.AppendExclude("Templates/*.*");

            var path = System.Reflection.Assembly.GetExecutingAssembly().Location;

            var ex  = ClassUnderTest.Search.ExcludedFilesFor(faf.RootPath);
            var inc = ClassUnderTest.Search.IncludedFilesFor(faf.RootPath);

            var files = faf.FindFiles(ClassUnderTest.Search);

            files.ShouldNotContain(f => f.Path.EndsWith("A3.cshtml"));
            files.ShouldNotContain(f => f.Path.EndsWith("A4.cshtml"));
        }
Пример #3
0
        public IEnumerable <T> ReadFile(string fileName)
        {
            _list.Clear();

            var file = FileLocation.RootPath.AppendPath(fileName);

            if (!File.Exists(file))
            {
                file = FubuRuntime.DefaultApplicationPath().AppendPath("bin", fileName);
            }
            if (!File.Exists(file))
            {
                file = FubuRuntime.DefaultApplicationPath().AppendPath("bin\\release", fileName);
            }

            using (var stream = File.OpenRead(file))
            {
                Load(stream);
            }

            return(_list);
        }
Пример #4
0
        public void UseParallelServiceDirectory(string directory)
        {
            var path = FubuRuntime.DefaultApplicationPath();

            ServiceDirectory = path.ParentDirectory().AppendPath(directory);
        }
Пример #5
0
 public static IFubuApplicationFiles ForDefault()
 {
     return(new FubuApplicationFiles(FubuRuntime.DefaultApplicationPath()));
 }
Пример #6
0
 public static IFubuFile Load(string relativePath)
 {
     return(new FubuApplicationFiles(FubuRuntime.DefaultApplicationPath()).Find(relativePath));
 }