Class: IISAppPoolBuilder

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

Overview

Used to manage IIS App Pool

Instance Method Summary collapse

Constructor Details

#initialize(siteName, iisAppCmd = IISAppCmd.new) ⇒ IISAppPoolBuilder

Params:

siteName

siteName string used to identify site (e.g)



9
10
11
12
# File 'lib/IIS_apppool_builder.rb', line 9

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

Instance Method Details

#assignObject



26
27
28
29
30
# File 'lib/IIS_apppool_builder.rb', line 26

def assign
	puts "assigning app pool : #{@siteName} to site #{@siteName}"
	@iisAppCmd.execute("SET SITE /site.name:#{@siteName} /applicationDefaults.applicationPool:#{@siteName}")
	self
end

#createObject



14
15
16
17
18
# File 'lib/IIS_apppool_builder.rb', line 14

def create
	puts "creating app pool : #{@siteName}"
	@iisAppCmd.execute("ADD APPPOOL /name:#{@siteName} /managedRuntimeVersion:v4.0")
	self
end

#deleteObject



20
21
22
23
24
# File 'lib/IIS_apppool_builder.rb', line 20

def delete
	puts "deleting app pool : #{@siteName}"
	@iisAppCmd.execute("DELETE APPPOOL #{@siteName}")
	self
end