Class: Specinfra::Command::Windows::Base::IisWebsite

Inherits:
Specinfra::Command::Windows::Base show all
Defined in:
lib/specinfra/command/windows/base/iis_website.rb

Class Method Summary collapse

Methods inherited from Specinfra::Command::Windows::Base

create

Class Method Details

.check_has_physical_path(name, path) ⇒ Object



31
32
33
34
35
36
# File 'lib/specinfra/command/windows/base/iis_website.rb', line 31

def check_has_physical_path(name, path)
  Backend::PowerShell::Command.new do
    using 'find_iis_component.ps1'
    exec "[System.Environment]::ExpandEnvironmentVariables( ( FindIISWebsite -name '#{name}' ).physicalPath ).replace('\\', '/' ) -eq ('#{path}'.trimEnd('/').replace('\\', '/'))"
  end
end

.check_has_site_application(name, app, pool, physical_path) ⇒ Object



52
53
54
55
56
57
# File 'lib/specinfra/command/windows/base/iis_website.rb', line 52

def check_has_site_application(name, app, pool, physical_path)
  Backend::PowerShell::Command.new do
    using 'find_iis_component.ps1'
    exec "(FindSiteApplication -name '#{name}' -app '#{app}' -pool '#{pool}' -physicalPath '#{physical_path}') -eq $true"
  end
end

.check_has_site_bindings(name, port, protocol, ipaddress, host_header) ⇒ Object



38
39
40
41
42
43
# File 'lib/specinfra/command/windows/base/iis_website.rb', line 38

def check_has_site_bindings(name, port, protocol, ipaddress, host_header)
  Backend::PowerShell::Command.new do
    using 'find_iis_component.ps1'
    exec "(FindSiteBindings -name '#{name}' -protocol '#{protocol}' -hostHeader '#{host_header}' -port #{port} -ipAddress '#{ipaddress}').count -gt 0"
  end
end

.check_has_virtual_dir(name, vdir, path) ⇒ Object



45
46
47
48
49
50
# File 'lib/specinfra/command/windows/base/iis_website.rb', line 45

def check_has_virtual_dir(name, vdir, path)
  Backend::PowerShell::Command.new do
    using 'find_iis_component.ps1'
    exec "(FindSiteVirtualDir -name '#{name}' -vdir '#{vdir}' -path '#{path}') -eq $true"
  end
end

.check_is_enabled(name) ⇒ Object



3
4
5
6
7
8
# File 'lib/specinfra/command/windows/base/iis_website.rb', line 3

def check_is_enabled(name)
  Backend::PowerShell::Command.new do
    using 'find_iis_component.ps1'
    exec "(FindIISWebsite -name '#{name}').serverAutoStart -eq $true"
  end
end

.check_is_in_app_pool(name, app_pool) ⇒ Object



24
25
26
27
28
29
# File 'lib/specinfra/command/windows/base/iis_website.rb', line 24

def check_is_in_app_pool(name, app_pool)
  Backend::PowerShell::Command.new do
    using 'find_iis_component.ps1'
    exec "(FindIISWebsite -name '#{name}').applicationPool -match '#{app_pool}'"
  end
end

.check_is_installed(name) ⇒ Object



10
11
12
13
14
15
# File 'lib/specinfra/command/windows/base/iis_website.rb', line 10

def check_is_installed(name)
  Backend::PowerShell::Command.new do
    using 'find_iis_component.ps1'
    exec "@(FindIISWebsite -name '#{name}').count -gt 0"
  end
end

.check_is_running(name) ⇒ Object



17
18
19
20
21
22
# File 'lib/specinfra/command/windows/base/iis_website.rb', line 17

def check_is_running(name)
  Backend::PowerShell::Command.new do
    using 'find_iis_component.ps1'
    exec "(FindIISWebsite -name '#{name}').state -eq 'Started'"
  end
end