Class: WebSiteIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/web_site_identifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(iisAppCmd = IISAppCmd.new) ⇒ WebSiteIdentifier

Returns a new instance of WebSiteIdentifier.



6
7
8
# File 'lib/web_site_identifier.rb', line 6

def initialize(iisAppCmd = IISAppCmd.new)
	@iisAppCmd = iisAppCmd
end

Instance Method Details

#exists(siteName) ⇒ Object



10
11
12
13
14
15
# File 'lib/web_site_identifier.rb', line 10

def exists(siteName)
	siteInfo = @iisAppCmd.execute("LIST SITE")
	siteExits = siteInfo.include?(siteName)
	puts "checking if site #{siteName} exists : #{siteExits}"
	siteExits
end

#getId(siteName) ⇒ Object



17
18
19
20
# File 'lib/web_site_identifier.rb', line 17

def getId(siteName)
	siteInfo = @iisAppCmd.execute("LIST SITE /site.name:#{siteName}")
	parseId(siteInfo)
end