inetmgr 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +159 -0
- data/RELEASE-NOTES.rdoc +35 -0
- data/doc/Application.html +177 -0
- data/doc/ApplicationPool.html +177 -0
- data/doc/AutoStartProvider.html +177 -0
- data/doc/BindingInformation.html +349 -0
- data/doc/Configuration.html +283 -0
- data/doc/IisConfiguration.html +383 -0
- data/doc/IisObject.html +484 -0
- data/doc/IisObjectCollection.html +534 -0
- data/doc/Inetmgr.html +179 -0
- data/doc/Inetmgr/InetmgrTask.html +338 -0
- data/doc/Object.html +254 -0
- data/doc/PeriodicRestart.html +177 -0
- data/doc/ProcessModel.html +192 -0
- data/doc/README_rdoc.html +114 -0
- data/doc/RSpecExtensions.html +257 -0
- data/doc/Recycling.html +177 -0
- data/doc/Site.html +228 -0
- data/doc/SiteConfiguration.html +269 -0
- data/doc/SiteLimit.html +177 -0
- data/doc/VirtualDirectory.html +177 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +166 -0
- data/doc/js/darkfish.js +116 -0
- data/doc/js/jquery.js +32 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/rdoc.css +706 -0
- data/inetmgr.gemspec +21 -0
- data/lib/inetmgr.rb +30 -0
- data/lib/inetmgr/configuration.rb +23 -0
- data/lib/inetmgr/iis_configuration.rb +36 -0
- data/lib/inetmgr/iis_object.rb +85 -0
- data/lib/inetmgr/iis_object/application.rb +11 -0
- data/lib/inetmgr/iis_object/application_pool.rb +19 -0
- data/lib/inetmgr/iis_object/auto_start_provider.rb +3 -0
- data/lib/inetmgr/iis_object/binding_information.rb +26 -0
- data/lib/inetmgr/iis_object/periodic_restart.rb +3 -0
- data/lib/inetmgr/iis_object/process_model.rb +18 -0
- data/lib/inetmgr/iis_object/recycling.rb +5 -0
- data/lib/inetmgr/iis_object/site.rb +24 -0
- data/lib/inetmgr/iis_object/site_limit.rb +7 -0
- data/lib/inetmgr/iis_object/virtual_directory.rb +5 -0
- data/lib/inetmgr/iis_object_collection.rb +51 -0
- data/lib/inetmgr/site_configuration.rb +34 -0
- data/lib/rake/inetmgrtask.rb +74 -0
- data/lib/string.rb +5 -0
- data/nbproject/private/config.properties +0 -0
- data/nbproject/private/private.properties +4 -0
- data/nbproject/private/private.xml +4 -0
- data/nbproject/private/rake-d.txt +2 -0
- data/nbproject/project.properties +10 -0
- data/nbproject/project.xml +16 -0
- data/spec/application_pool_spec.rb +120 -0
- data/spec/application_spec.rb +38 -0
- data/spec/auto_start_provider_spec.rb +25 -0
- data/spec/bingin_information_spec.rb +21 -0
- data/spec/iis_configuration_spec.rb +35 -0
- data/spec/site_app_settings_spec.rb +61 -0
- data/spec/site_configuration_spec.rb +24 -0
- data/spec/site_connection_strings_spec.rb +17 -0
- data/spec/site_spec.rb +34 -0
- data/spec/site_validation_settings_spec.rb +18 -0
- data/spec/spec_env.rb +22 -0
- data/spec/string_spec.rb +16 -0
- data/spec/virtual_directory_spec.rb +1 -0
- data/test/create_site.rb +26 -0
- data/test/print_iis_config.rb +56 -0
- data/test/rakefile.rb +27 -0
- metadata +156 -0
data/lib/string.rb
ADDED
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
file.reference.inetmgr-lib=lib
|
2
|
+
file.reference.inetmgr-spec=spec
|
3
|
+
file.reference.inetmgr-test=test
|
4
|
+
javac.classpath=
|
5
|
+
main.file=create_site.rb
|
6
|
+
platform.active=Ruby
|
7
|
+
source.encoding=UTF-8
|
8
|
+
src.dir=${file.reference.inetmgr-lib}
|
9
|
+
test.spec.dir=spec
|
10
|
+
test.src.dir=${file.reference.inetmgr-test}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project xmlns="http://www.netbeans.org/ns/project/1">
|
3
|
+
<type>org.netbeans.modules.ruby.rubyproject</type>
|
4
|
+
<configuration>
|
5
|
+
<data xmlns="http://www.netbeans.org/ns/ruby-project/1">
|
6
|
+
<name>inetmgr</name>
|
7
|
+
<source-roots>
|
8
|
+
<root id="src.dir"/>
|
9
|
+
</source-roots>
|
10
|
+
<test-roots>
|
11
|
+
<root id="test.spec.dir"/>
|
12
|
+
<root id="test.src.dir"/>
|
13
|
+
</test-roots>
|
14
|
+
</data>
|
15
|
+
</configuration>
|
16
|
+
</project>
|
@@ -0,0 +1,120 @@
|
|
1
|
+
require 'spec_env'
|
2
|
+
|
3
|
+
describe "When adding a new application pool" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
@pools = IisConfiguration.new.get_application_pools
|
7
|
+
@before_count = @pools.size
|
8
|
+
@pool = @pools.add do |p|
|
9
|
+
p.name = "tralala"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "it should be present in the application pool collection" do
|
14
|
+
@pools.size.should == @before_count + 1
|
15
|
+
end
|
16
|
+
|
17
|
+
it "the auto_start value should default to false" do
|
18
|
+
@pool.auto_start.should == false
|
19
|
+
end
|
20
|
+
|
21
|
+
# TODO: fix this -> it depends on the defaults in the config
|
22
|
+
it "the managed_runtime_version value should default to 'v2.0'" do
|
23
|
+
@pool.managed_runtime_version.should == "v2.0"
|
24
|
+
end
|
25
|
+
|
26
|
+
it "the classic_pipeline value should default to false" do
|
27
|
+
@pool.classic_pipeline.should == false
|
28
|
+
end
|
29
|
+
|
30
|
+
it "the enable_32bit value should default to false" do
|
31
|
+
@pool.enable_32bit.should == false
|
32
|
+
end
|
33
|
+
|
34
|
+
it "the always_running value should default to false" do
|
35
|
+
@pool.always_running.should == false
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "When updating application pool" do
|
40
|
+
|
41
|
+
before(:all) do
|
42
|
+
|
43
|
+
@name = generate_random_name()
|
44
|
+
|
45
|
+
configure do |cfg|
|
46
|
+
|
47
|
+
pool = cfg.get_application_pools.add { |p| p.name = @name } # defaults
|
48
|
+
|
49
|
+
pool.auto_start = true
|
50
|
+
pool.managed_runtime_version = "v4.0"
|
51
|
+
pool.classic_pipeline = true
|
52
|
+
pool.enable_32bit = true
|
53
|
+
pool.always_running = true
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
configure do |cfg|
|
58
|
+
@pool = cfg.get_application_pools.find { |p| p.name == @name }
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
it "the name should be changed" do
|
64
|
+
@pool.name.should == @name
|
65
|
+
end
|
66
|
+
|
67
|
+
it "the auto_start value should be changed" do
|
68
|
+
@pool.auto_start.should == false
|
69
|
+
end
|
70
|
+
|
71
|
+
it "the managed_runtime_version value should be changed" do
|
72
|
+
@pool.managed_runtime_version.should == "v4.0"
|
73
|
+
end
|
74
|
+
|
75
|
+
it "the classic_pipeline value should be changed" do
|
76
|
+
@pool.classic_pipeline.should == true
|
77
|
+
end
|
78
|
+
|
79
|
+
it "the enable_32bit value should be changed" do
|
80
|
+
@pool.enable_32bit.should == true
|
81
|
+
end
|
82
|
+
|
83
|
+
it "the always_running value should be changed" do
|
84
|
+
puts @pool.startMode
|
85
|
+
@pool.always_running.should == true
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "When updating an application pool's proces model" do
|
91
|
+
|
92
|
+
before(:all) do
|
93
|
+
|
94
|
+
@name = generate_random_name()
|
95
|
+
|
96
|
+
configure do |cfg|
|
97
|
+
|
98
|
+
pool = cfg.get_application_pools.add { |p| p.name = @name } # defaults
|
99
|
+
|
100
|
+
m = pool.process_model
|
101
|
+
m.logon_type = :service
|
102
|
+
m.identity_type = :network_service
|
103
|
+
end
|
104
|
+
|
105
|
+
configure do |cfg|
|
106
|
+
pool = cfg.get_application_pools.find { |p| p.name == @name }
|
107
|
+
@proces_model = pool.process_model
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
112
|
+
it "the logon type should be changed" do
|
113
|
+
@proces_model.logon_type.should == :service
|
114
|
+
end
|
115
|
+
|
116
|
+
it "the identity type should be changed" do
|
117
|
+
@proces_model.identity_type.should == :network_service
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_env'
|
2
|
+
|
3
|
+
describe "When adding an Application to a site" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
|
7
|
+
configure do |cfg|
|
8
|
+
site = cfg.get_sites[0]
|
9
|
+
@app_name = "/#{generate_random_name}"
|
10
|
+
site.applications.add do|a|
|
11
|
+
a.path = @app_name
|
12
|
+
a.virtual_directories.add do |vd|
|
13
|
+
vd.path = @app_name
|
14
|
+
vd.physicalPath = "D:\\"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
configure do |cfg|
|
20
|
+
@site = cfg.get_sites[0]
|
21
|
+
@app = @site.applications.find {|a| a.path == @app_name}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
it "the app should be added" do
|
26
|
+
@app.should_not be_nil
|
27
|
+
end
|
28
|
+
|
29
|
+
it "the app should contain the associated virtual directory" do
|
30
|
+
@app.virtual_directories.size.should == 1
|
31
|
+
end
|
32
|
+
|
33
|
+
it "the virtual directory physical path should be set" do
|
34
|
+
@app.virtual_directories[0].physicalPath.should == "D:\\"
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_env'
|
2
|
+
|
3
|
+
describe "When adding an auto start provider" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
configure do |cfg|
|
7
|
+
@name = generate_random_name
|
8
|
+
@type = generate_random_name
|
9
|
+
@provider = cfg.get_auto_start_providers.add { |p| p.name = @name; p.type = @type }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "the provider should not be nil" do
|
14
|
+
@provider.should_not be_nil
|
15
|
+
end
|
16
|
+
|
17
|
+
it "the provider name should be set" do
|
18
|
+
@provider.name.should == @name
|
19
|
+
end
|
20
|
+
|
21
|
+
it "the provider type should be set" do
|
22
|
+
@provider.type.should == @type
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_env'
|
2
|
+
|
3
|
+
describe "When adding an SSL certificate" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
configure false do |cfg|
|
7
|
+
@binding = cfg.get_sites[0].bindings[0]
|
8
|
+
@binding.add_ssl_certificate "e2564766bad7ebec8cf6899caa2a27c6391c4f19", "MY"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "the cert hash should be set" do
|
13
|
+
@binding.certificateHash.downcase.should == "e2564766bad7ebec8cf6899caa2a27c6391c4f19"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "the cert store name should be set" do
|
17
|
+
@binding.certificateStoreName.should == "MY"
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_env'
|
2
|
+
|
3
|
+
describe "When getting the configured application pools" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
configure do |cfg|
|
7
|
+
@pools = cfg.get_application_pools
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it "at least one item should be returned" do
|
12
|
+
@pools.size > 1
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "When rolling back configuration changes" do
|
18
|
+
|
19
|
+
before(:all) do
|
20
|
+
configure false do |cfg|
|
21
|
+
cfg.get_application_pools.add do |p|
|
22
|
+
p.name = "foobar"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
configure false do |cfg|
|
26
|
+
@non_existing_pool = cfg.get_application_pools.find { |p| p.name == "foobar" }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
it "the changes should not be applied" do
|
31
|
+
@non_existing_pool.should be_nil
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require './spec_env.rb'
|
2
|
+
|
3
|
+
describe "When getting a sites connection strings" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
iis_cfg = IisConfiguration.new
|
7
|
+
site = iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
|
8
|
+
site.configure do |site_cfg|
|
9
|
+
@app_settings = site_cfg.get_connection_strings
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "the settings should be returned" do
|
14
|
+
@app_settings.size.should == 1
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "When changing an app setting" do
|
20
|
+
|
21
|
+
before(:all) do
|
22
|
+
@iis_cfg = IisConfiguration.new
|
23
|
+
site = @iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
|
24
|
+
site.configure do |site_cfg|
|
25
|
+
@previous = site_cfg.get_app_settings[0].value
|
26
|
+
site_cfg.get_app_settings[0].value = "foo"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
it "the settings should be persisted" do
|
31
|
+
site = @iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
|
32
|
+
site.configure do |site_cfg|
|
33
|
+
site_cfg.get_app_settings[0].value.should == "foo"
|
34
|
+
site_cfg.get_app_settings[0].value = @previous
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "When adding an app setting" do
|
41
|
+
|
42
|
+
before(:all) do
|
43
|
+
@iis_cfg = IisConfiguration.new
|
44
|
+
site = @iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
|
45
|
+
site.configure do |site_cfg|
|
46
|
+
@previous = site_cfg.get_app_settings.size
|
47
|
+
site_cfg.get_app_settings.add do |setting|
|
48
|
+
setting.key = generate_random_name()
|
49
|
+
setting.value = "bar"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
it "the settings should be persisted" do
|
55
|
+
site = @iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
|
56
|
+
site.configure do |site_cfg|
|
57
|
+
site_cfg.get_app_settings.size.should == (@previous + 1)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require './spec_env.rb'
|
2
|
+
|
3
|
+
describe "When getting a sites connection strings" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
iis_cfg = IisConfiguration.new
|
7
|
+
site = iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
|
8
|
+
site.configure do |site_cfg|
|
9
|
+
@validation_settings = site_cfg.get_validation_settings
|
10
|
+
@static_content_settings = site_cfg.get_static_content_settings
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it "the validation settings should be returned" do
|
16
|
+
@validation_settings.should_not == nil
|
17
|
+
end
|
18
|
+
|
19
|
+
it "the static content settings should be returned" do
|
20
|
+
@static_content_settings.should_not == nil
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require './spec_env.rb'
|
2
|
+
|
3
|
+
describe "When getting a sites app settings" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
iis_cfg = IisConfiguration.new
|
7
|
+
site = iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
|
8
|
+
site.configure do |site_cfg|
|
9
|
+
@connection_strings = site_cfg.get_connection_strings
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "the settings should be returned" do
|
14
|
+
@connection_strings.size.should == 1
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/spec/site_spec.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require './spec_env.rb'
|
2
|
+
|
3
|
+
describe "When getting the configured sites" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
configure do |cfg|
|
7
|
+
@sites = cfg.get_sites
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it "at least one item should be returned" do
|
12
|
+
@sites.size.should > 1
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "When adding a new site" do
|
18
|
+
|
19
|
+
before(:all) do
|
20
|
+
configure do |cfg|
|
21
|
+
@sites = cfg.get_sites
|
22
|
+
@site = @sites.add { |s| s.name = generate_random_name }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "the site should be created" do
|
27
|
+
@site.should_not be_nil
|
28
|
+
end
|
29
|
+
|
30
|
+
it "the site should have the highest id" do
|
31
|
+
@site.id.should == @sites.size
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require './spec_env.rb'
|
2
|
+
|
3
|
+
describe "When getting a sites connection strings" do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
iis_cfg = IisConfiguration.new
|
7
|
+
site = iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
|
8
|
+
site.configure do |site_cfg|
|
9
|
+
@validation_settings = site_cfg.get_validation_settings
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it "the settings should be returned" do
|
14
|
+
puts @validation_settings.validate_integrated_mode_configuration
|
15
|
+
@validation_settings.validate_integrated_mode_configuration.should_not == nil
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|