lib/iisconfig/app_pool.rb in iisconfig-0.0.1.pre1 vs lib/iisconfig/app_pool.rb in iisconfig-0.0.1.pre2
- old
+ new
@@ -1,6 +1,7 @@
require 'site'
+require 'ftp_site'
require 'iis_object'
require 'process_model'
module IISConfig
@@ -8,10 +9,11 @@
def initialize
@pipeline_mode = :Classic
@runtime_version = :'v2.0'
@sites = []
+ @ftp_sites = []
@process_model = ProcessModel.new
@enable_32bit_app_on_win64 = false
end
def name(name = nil)
@@ -39,10 +41,14 @@
def site(&block)
add_instance(@sites, IISConfig::Site, block)
end
+ def ftp_site(&block)
+ add_instance(@ftp_sites, IISConfig::FtpSite, block)
+ end
+
def sites
@sites
end
def delete
@@ -57,10 +63,18 @@
args << "/managedRuntimeVersion:#{@runtime_version}"
args << "/managedPipelineMode:#{pipeline_mode}"
args
end
+ def required_paths
+ paths = []
+ @sites.each do |s|
+ paths += s.required_paths
+ end
+ paths
+ end
+
def build_commands
commands = []
commands << delete if exist? :apppool, @name
commands << add
@@ -68,10 +82,16 @@
commands << %W{SET CONFIG /section:applicationPools /[name='#{@name}'].processModel.#{d[:key]}:#{d[:value]}}
end
commands << %W{SET APPPOOL /apppool.name:#{@name} /enable32BitAppOnWin64:#{@enable_32bit_app_on_win64}}
@sites.each do |s|
- commands += s.build_commands @name
+ s.app_pool @name.to_sym
+ commands += s.build_commands
+ end
+
+ @ftp_sites.each do |s|
+ s.app_pool @name.to_sym
+ commands += s.build_commands
end
commands
end
\ No newline at end of file