class IISSiteBuilder

Attributes

webSiteIdentifier[RW]

Public Class Methods

new(siteName, sitePath, webSiteIdentifier = WebSiteIdentifier.new, iisAppCmd = IISAppCmd.new) click to toggle source
# File lib/IIS_site_builder.rb, line 8
def initialize(siteName, sitePath, webSiteIdentifier = WebSiteIdentifier.new, iisAppCmd = IISAppCmd.new)
        @siteName = siteName
        @sitePath = sitePath
        @webSiteIdentifier = webSiteIdentifier
        @iisAppCmd = iisAppCmd
end

Public Instance Methods

create() click to toggle source
# File lib/IIS_site_builder.rb, line 24
def create
        puts "creating site #{@siteName}"
        @iisAppCmd.execute("ADD SITE /name:#{@siteName} /bindings:http://#{@siteName}:80 /physicalPath:#{@sitePath}")
        self
end
delete() click to toggle source
# File lib/IIS_site_builder.rb, line 15
def delete
        puts "attempting delete of #{@siteName}"
        if @webSiteIdentifier.exists(@siteName)
                @iisAppCmd.execute("DELETE SITE #{@siteName}")
                puts "deleted site #{@siteName}"
        end
        self
end