示例#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));
 }