iisconfig 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +1,30 @@
1
- require 'iis_object'
2
-
3
- module IISConfig
4
-
5
- class VirtualDirectory < IISObject
6
-
7
- def name(name)
8
- @name = name
9
- @app_pool = nil
10
- end
11
-
12
- def path(path)
13
- @path = path
14
- end
15
-
16
- def physical_path(path)
17
- @physical_path = path
18
- end
19
-
20
- def build_commands(application)
21
- commands = []
22
-
23
- commands << %W{ADD VDIR /app.name:#{application} /path:#{@path} /physicalPath:#{@physical_path.gsub(/\//, '\\')}}
24
-
25
- commands
26
- end
27
-
28
- end
29
-
1
+ require 'iis_object'
2
+
3
+ module IISConfig
4
+
5
+ class VirtualDirectory < IISObject
6
+
7
+ def name(name)
8
+ @name = name
9
+ @app_pool = nil
10
+ end
11
+
12
+ def path(path)
13
+ @path = path
14
+ end
15
+
16
+ def physical_path(path)
17
+ @physical_path = path
18
+ end
19
+
20
+ def build_commands(application)
21
+ commands = []
22
+
23
+ commands << %W{ADD VDIR /app.name:#{application} /path:#{@path} /physicalPath:#{@physical_path.gsub(/\//, '\\')}}
24
+
25
+ commands
26
+ end
27
+
28
+ end
29
+
30
30
  end
data/lib/iisconfig.rb CHANGED
@@ -1,42 +1,43 @@
1
- $:.push File.expand_path(File.dirname(__FILE__))
2
-
3
- require 'rainbow'
4
- require 'gli'
5
- require 'gli_version'
6
- require 'iisconfig/version'
7
- require 'iisconfig/configuration'
8
-
9
- include GLI
10
-
11
- program_desc 'Configures IIS on Windows'
12
-
13
- version IISConfig::VERSION
14
-
15
- desc 'executes the configuration file'
16
- command :execute, :e do |c|
17
- c.desc 'Only recycle the application pools'
18
- c.switch :'recycle-apppools'
19
-
20
- c.desc 'Dry run'
21
- c.switch :'dry-run'
22
-
23
- c.action do |global_options, options, args|
24
- opts = {}
25
- opts[:recycle_apppools] = true if options[:'recycle-apppools']
26
-
27
- IISConfig::IISConfiguration.dry_run = true if options[:'dry-run']
28
-
29
- config = IISConfig::IISConfiguration.new opts
30
-
31
- file = args[0]
32
- if file.nil?
33
- puts 'No file specified to execute'
34
- else
35
- config.load file
36
- config.run
37
- end
38
- end
39
- end
40
-
41
-
42
-
1
+ $:.push File.expand_path(File.dirname(__FILE__))
2
+
3
+ require 'rainbow'
4
+ require 'gli'
5
+ require 'gli_version'
6
+ require 'iisconfig/version'
7
+ require 'iisconfig/configuration'
8
+
9
+ include GLI
10
+
11
+ program_desc 'Configures IIS on Windows'
12
+
13
+ version IISConfig::VERSION
14
+
15
+ desc 'executes the configuration file'
16
+ command :execute, :e do |c|
17
+ c.desc 'Only recycle the application pools'
18
+ c.switch :'recycle-apppools'
19
+
20
+ c.desc 'Dry run'
21
+ c.switch :'dry-run'
22
+
23
+ c.desc 'Verbose'
24
+ c.switch :'verbose'
25
+
26
+ c.action do |global_options, options, args|
27
+ opts = {}
28
+ opts[:recycle_apppools] = true if options[:'recycle-apppools']
29
+
30
+ IISConfig::IISConfiguration.dry_run = true if options[:'dry-run']
31
+ IISConfig::IISConfiguration.verbose = true if options[:'verbose']
32
+
33
+ config = IISConfig::IISConfiguration.new opts
34
+
35
+ file = args[0]
36
+ if file.nil?
37
+ puts 'No file specified to execute'
38
+ else
39
+ config.load file
40
+ config.run
41
+ end
42
+ end
43
+ end
data/test/example.rb CHANGED
@@ -1,54 +1,55 @@
1
- before do
2
- puts 'before'
3
- end
4
-
5
- app_pool do |p|
6
- p.name :MyAppPool
7
- p.runtime_version :'v2.0'
8
- p.start_mode 'AlwaysRunning'
9
- p.process_model do |m|
10
- m.identity_type :NetworkService
11
- m.idle_timeout '0.00:30:00'
12
- end
13
-
14
- p.site do |s|
15
- s.name :MySite
16
- s.path '/'
17
- s.binding 'http/*:8090:localhost'
18
- s.binding 'http/*:8090:test.local'
19
- s.binding "net.tcp/808:*"
20
- s.binding "net.pipe/*"
21
- s.physical_path 'c:\\temp\\MySite'
22
-
23
- s.application do |a|
24
- a.name :MyApp
25
- a.path '/MyApp'
26
- a.physical_path 'c:\\temp\\MySite\\MyApp'
27
-
28
- a.virtual_directory do |v|
29
- v.name :MyAppVirtualDirectory
30
- v.path '/AppVDir'
31
- v.physical_path 'c:\\temp\\MySite\MyVDir'
32
- end
33
- end
34
-
35
- s.virtual_directory do |v|
36
- v.name :MySiteVirtualDirectory
37
- v.path '/SiteVDir'
38
- v.physical_path 'c:\\temp\\MySite\MyVDir'
39
- end
40
- end
41
- end
42
-
43
- ftp_site do |s|
44
- s.name :MyFtp
45
- s.binding 'ftp://*:21'
46
- s.physical_path 'c:\\temp\\MyFtp'
47
- s.enable_authentication :anonymous
48
- s.allow_authorization [:read, :write], { :users => '*', :roles => '' }
49
- s.allow_ssl
50
- end
51
-
52
- after do
53
- puts "done"
54
- end
1
+ before do
2
+ puts 'before'
3
+ end
4
+
5
+ app_pool do |p|
6
+ p.name :MyAppPool
7
+ p.runtime_version :'v2.0'
8
+ p.start_mode 'AlwaysRunning'
9
+ p.process_model do |m|
10
+ m.identity_type :NetworkService
11
+ m.idle_timeout '0.00:30:00'
12
+ end
13
+
14
+ p.site do |s|
15
+ s.name :MySite
16
+ s.path '/'
17
+ s.binding 'http/*:8090:localhost'
18
+ s.binding 'http/*:8090:test.local'
19
+ s.binding "net.tcp/808:*"
20
+ s.binding "net.pipe/*"
21
+ s.physical_path 'c:\\temp\\MySite'
22
+
23
+ s.application do |a|
24
+ a.name :MyApp
25
+ a.path '/MyApp'
26
+ a.physical_path 'c:\\temp\\MySite\\MyApp'
27
+ a.auto_start_provider "example", "Example.Class, Example"
28
+
29
+ a.virtual_directory do |v|
30
+ v.name :MyAppVirtualDirectory
31
+ v.path '/AppVDir'
32
+ v.physical_path 'c:\\temp\\MySite\MyVDir'
33
+ end
34
+ end
35
+
36
+ s.virtual_directory do |v|
37
+ v.name :MySiteVirtualDirectory
38
+ v.path '/SiteVDir'
39
+ v.physical_path 'c:\\temp\\MySite\MyVDir'
40
+ end
41
+ end
42
+ end
43
+
44
+ ftp_site do |s|
45
+ s.name :MyFtp
46
+ s.binding 'ftp://*:21'
47
+ s.physical_path 'c:\\temp\\MyFtp'
48
+ s.enable_authentication :anonymous
49
+ s.allow_authorization [:read, :write], { :users => '*', :roles => '' }
50
+ s.allow_ssl
51
+ end
52
+
53
+ after do
54
+ puts "done"
55
+ end
metadata CHANGED
@@ -1,43 +1,63 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iisconfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-10 00:00:00.000000000 Z
11
+ date: 2015-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: !binary |-
20
+ MS42LjA=
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: !binary |-
24
+ MS42LjA=
20
25
  type: :runtime
21
26
  prerelease: false
22
27
  version_requirements: !ruby/object:Gem::Requirement
23
28
  requirements:
24
- - - ">="
29
+ - - ~>
30
+ - !ruby/object:Gem::Version
31
+ version: !binary |-
32
+ MS42LjA=
33
+ - - ! '>='
25
34
  - !ruby/object:Gem::Version
26
- version: '0'
35
+ version: !binary |-
36
+ MS42LjA=
27
37
  - !ruby/object:Gem::Dependency
28
38
  name: rainbow
29
39
  requirement: !ruby/object:Gem::Requirement
30
40
  requirements:
31
- - - ">="
41
+ - - ~>
32
42
  - !ruby/object:Gem::Version
33
- version: '0'
43
+ version: !binary |-
44
+ Mi4wLjA=
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: !binary |-
48
+ Mi4wLjA=
34
49
  type: :runtime
35
50
  prerelease: false
36
51
  version_requirements: !ruby/object:Gem::Requirement
37
52
  requirements:
38
- - - ">="
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: !binary |-
56
+ Mi4wLjA=
57
+ - - ! '>='
39
58
  - !ruby/object:Gem::Version
40
- version: '0'
59
+ version: !binary |-
60
+ Mi4wLjA=
41
61
  description: IIS Configuration
42
62
  email:
43
63
  - stuff@lukesmith.net
@@ -70,17 +90,17 @@ require_paths:
70
90
  - lib
71
91
  required_ruby_version: !ruby/object:Gem::Requirement
72
92
  requirements:
73
- - - ">="
93
+ - - ! '>='
74
94
  - !ruby/object:Gem::Version
75
95
  version: '0'
76
96
  required_rubygems_version: !ruby/object:Gem::Requirement
77
97
  requirements:
78
- - - ">="
98
+ - - ! '>='
79
99
  - !ruby/object:Gem::Version
80
100
  version: '0'
81
101
  requirements: []
82
102
  rubyforge_project: iisconfig
83
- rubygems_version: 2.2.2
103
+ rubygems_version: 2.4.8
84
104
  signing_key:
85
105
  specification_version: 4
86
106
  summary: IIS Config