Class: IISSiteBuilder
- Inherits:
-
Object
- Object
- IISSiteBuilder
- Defined in:
- lib/IIS_site_builder.rb
Instance Attribute Summary collapse
-
#webSiteIdentifier ⇒ Object
Returns the value of attribute webSiteIdentifier.
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
-
#initialize(siteName, sitePath, webSiteIdentifier = WebSiteIdentifier.new, iisAppCmd = IISAppCmd.new) ⇒ IISSiteBuilder
constructor
A new instance of IISSiteBuilder.
Constructor Details
#initialize(siteName, sitePath, webSiteIdentifier = WebSiteIdentifier.new, iisAppCmd = IISAppCmd.new) ⇒ IISSiteBuilder
Returns a new instance of IISSiteBuilder.
8 9 10 11 12 13 |
# 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 |
Instance Attribute Details
#webSiteIdentifier ⇒ Object
Returns the value of attribute webSiteIdentifier.
6 7 8 |
# File 'lib/IIS_site_builder.rb', line 6 def webSiteIdentifier @webSiteIdentifier end |
Instance Method Details
#create ⇒ Object
24 25 26 27 28 |
# 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 ⇒ Object
15 16 17 18 19 20 21 22 |
# 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 |