Sha256: fca33952a528ac5505efcb265579943006043f361986b7500a3ca15fcd92875e

Contents?: true

Size: 695 Bytes

Versions: 1

Compression:

Stored size: 695 Bytes

Contents

$:.push File.expand_path(File.dirname(__FILE__))

require 'rexml/document'
require 'app_pool'

module IISConfig

  class IISConfiguration

    def initialize
      @app_pools = []
    end

    def app_pool(&block)
      add_instance @app_pools, IISConfig::AppPool, block
    end
    
    def load(path)
      instance_eval IO.read(path), path
    end

    def run
      @app_pools.each do |p|
        commands = p.build_commands
        Runner.run_commands commands
      end
    end

    private

    def add_instance(collection, type, block)
      instance = type.new
      collection << instance
      block.call instance if block
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iisconfig-0.0.1.pre1 lib/iisconfig/configuration.rb