Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of the <see cref="RewriteManager" /> class.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <param name="log">The log.</param>
        /// <param name="server">The <see cref="ServerManager" /> to connect to.</param>
        /// <returns>a new instance of the <see cref="RewriteManager" />.</returns>
        public static RewriteManager Using(ICakeEnvironment environment, ICakeLog log, ServerManager server)
        {
            RewriteManager manager = new RewriteManager(environment, log);

            manager.SetServer(server);

            return(manager);
        }
Ejemplo n.º 2
0
 public static bool RuleExists(this ICakeContext context, string server, string name)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         return(RewriteManager
                .Using(context.Environment, context.Log, manager)
                .Exists(name));
     }
 }
Ejemplo n.º 3
0
 public static void CreateRewriteRule(this ICakeContext context, string server, RewriteRuleSettings settings)
 {
     using (ServerManager manager = BaseManager.Connect(server))
     {
         RewriteManager
         .Using(context.Environment, context.Log, manager)
         .CreateRule(settings);
     }
 }