Esempio n. 1
0
        public void before_all()
        {
            // setup
            _command = new NewCommand();
            _fileSystem = new FileSystem();
            _zipService = new ZipFileService(_fileSystem);
            _commandInput = new NewCommandInput();

            tmpDir = FileSystem.Combine("Templating", Guid.NewGuid().ToString());
            repoZip = FileSystem.Combine("Templating", "repo.zip");
            _zipService.ExtractTo(repoZip, tmpDir, ExplodeOptions.DeleteDestination);

            solutionFile = FileSystem.Combine("Templating", "sample", "myproject.txt");
            oldContents = _fileSystem.ReadStringFromFile(solutionFile);
            solutionDir = _fileSystem.GetDirectory(solutionFile);

            _commandInput.GitFlag = "file:///{0}".ToFormat(_fileSystem.GetFullPath(tmpDir).Replace("\\", "/"));
            _commandInput.ProjectName = "MyProject";
            _commandInput.SolutionFlag = solutionFile;
            _commandInput.OutputFlag = solutionDir;
            _commandInput.RakeFlag = "init.rb";

            _commandResult = _command.Execute(_commandInput);

            newSolutionContents = _fileSystem.ReadStringFromFile(solutionFile);
        }
Esempio n. 2
0
 public void Start()
 {
     //TODO: how to find the services dir
     //TODO: how to get the bottles dir
     //TODO: do we need a custom config?
     string baseDir = ConfigurationManager.AppSettings["BottlesDirectory"]
                      ?? Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Bottles");
     _fs = new DotNetFileSystem();
     Magnum.FileSystem.Directory bottlesDir = _fs.GetDirectory(baseDir);
     _watcher = new BottleWatcher();
     _cleanup = _watcher.Watch(bottlesDir.Name.GetPath(), CopyToServices);
 }