示例#1
0
        public void WriteTo(string recipeName, HostDefinition host, DeploymentSettings settings)
        {
            var fileName = settings.GetHost(recipeName, host.Name);

            host.References.Each(WriteReference);
            host.Values.Each(WritePropertyValue);
            host.Directives.Each(WriteDirective);

            _fileSystem.WriteStringToFile(fileName, ToText());
        }
示例#2
0
        public void WriteTo(string recipeName, HostDefinition host, DeploymentSettings settings)
        {
            var fileName = settings.GetHost(recipeName, host.Name);

            host.References.Each(WriteReference);
            host.Values.Each(WritePropertyValue);
            host.Directives.Each(WriteDirective);

            _fileSystem.WriteStringToFile(fileName, ToText());
        }
示例#3
0
        public void Execute(AddReferenceCommandInput input, EnvironmentSettings settings, IFileSystem fileSystem, DeploymentSettings deploymentSettings)
        {
            string bottleText = "bottle:{0}".ToFormat(input.Bottle);


            var hostPath = deploymentSettings.GetHost(input.Recipe, input.Host);

            Console.WriteLine("Analyzing the host file at " + input.Host);
            fileSystem.AlterFlatFile(hostPath, list =>
            {
                list.Fill(bottleText);
                list.Sort();

                Console.WriteLine("Contents of file " + hostPath);
                list.Each(x => Console.WriteLine("  " + x));
            });
        }
示例#4
0
        public void build_the_default_ctor()
        {
            setupValidDeploymentFolderAt("dir");

            //review there is a check inside of here
            var settings = new DeploymentSettings("dir");

            settings.BottlesDirectory.ShouldEqual("dir\\bottles");
            settings.RecipesDirectory.ShouldEqual("dir\\recipes");
            settings.EnvironmentFile.ShouldEqual("dir\\environment.settings");
            settings.TargetDirectory.ShouldEqual("dir\\target");
            settings.DeploymentDirectory.ShouldEqual("dir");
            settings.BottleManifestFile.ShouldEqual("dir\\bottles.manifest");

            settings.ProfilesDirectory.ShouldEqual(FileSystem.Combine("dir", ProfileFiles.ProfilesDirectory));
            settings.EnvironmentsDirectory.ShouldEqual(FileSystem.Combine("dir", ProfileFiles.EnvironmentsDirectory));

            settings.GetHost("x", "z").ShouldEqual("dir\\recipes\\x\\z.host");
            settings.GetRecipeDirectory("a").ShouldEqual("dir\\recipes\\a");
        }