apache-config-generator 0.1.2 → 0.2
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.
- data/CHANGELOG +2 -0
- data/apache-config-generator.gemspec +1 -1
- data/lib/apache/master.rb +6 -0
- data/lib/apache/mpm_prefork.rb +2 -2
- data/lib/apache/rewrites.rb +7 -10
- data/lib/apache/ssl.rb +5 -4
- metadata +1 -2
data/CHANGELOG
CHANGED
data/lib/apache/master.rb
CHANGED
|
@@ -113,5 +113,11 @@ module Apache
|
|
|
113
113
|
opts.each { |o| server_alias o } if !opts.empty?
|
|
114
114
|
end
|
|
115
115
|
end
|
|
116
|
+
|
|
117
|
+
def document_root(*opts)
|
|
118
|
+
directory? opts.first
|
|
119
|
+
self << "DocumentRoot #{quoteize(opts.first)}"
|
|
120
|
+
end
|
|
121
|
+
alias :document_root! :document_root
|
|
116
122
|
end
|
|
117
123
|
end
|
data/lib/apache/mpm_prefork.rb
CHANGED
data/lib/apache/rewrites.rb
CHANGED
|
@@ -170,7 +170,7 @@ module Apache
|
|
|
170
170
|
module RegularExpressionMatcher
|
|
171
171
|
# Test this rewritable thing
|
|
172
172
|
def test(from, opts = {})
|
|
173
|
-
from = from.gsub(@from, @to.gsub(/\$([0-9])/) { |
|
|
173
|
+
from = from.gsub(@from, @to.gsub(/\$([0-9])/) { |match| '\\' + $1 })
|
|
174
174
|
replace_placeholders(from, opts)
|
|
175
175
|
end
|
|
176
176
|
|
|
@@ -179,14 +179,14 @@ module Apache
|
|
|
179
179
|
end
|
|
180
180
|
|
|
181
181
|
# Replace the placeholders in this rewritable thing
|
|
182
|
-
def replace_placeholders(
|
|
182
|
+
def replace_placeholders(string, opts)
|
|
183
183
|
opts.each do |opt, value|
|
|
184
184
|
case value
|
|
185
185
|
when String
|
|
186
|
-
|
|
186
|
+
string = string.gsub('%{' + opt.to_s.upcase + '}', value)
|
|
187
187
|
end
|
|
188
188
|
end
|
|
189
|
-
|
|
189
|
+
string.gsub(%r{%\{[^\}]+\}}, '')
|
|
190
190
|
end
|
|
191
191
|
end
|
|
192
192
|
|
|
@@ -387,12 +387,9 @@ module Apache
|
|
|
387
387
|
end
|
|
388
388
|
|
|
389
389
|
result = false
|
|
390
|
-
case to
|
|
391
|
-
when '-'
|
|
392
|
-
|
|
393
|
-
when '-f'
|
|
394
|
-
result = opts[:files].include? source if opts[:files]
|
|
395
|
-
end
|
|
390
|
+
case to
|
|
391
|
+
when '-f'
|
|
392
|
+
result = opts[:files].include?(source) if opts[:files]
|
|
396
393
|
else
|
|
397
394
|
result = source[Regexp.new(to)]
|
|
398
395
|
end
|
data/lib/apache/ssl.rb
CHANGED
|
@@ -3,12 +3,13 @@ module Apache
|
|
|
3
3
|
def enable_ssl_engine(options = {})
|
|
4
4
|
self << ""
|
|
5
5
|
self << "SSLEngine on"
|
|
6
|
-
options.each do |
|
|
7
|
-
|
|
6
|
+
options.each do |key, value|
|
|
7
|
+
value = quoteize(value).first
|
|
8
|
+
case key
|
|
8
9
|
when :certificate_file, :certificate_key_file
|
|
9
|
-
self << "SSL#{apachify(
|
|
10
|
+
self << "SSL#{apachify(key)} #{value}"
|
|
10
11
|
when :ca_certificate_file
|
|
11
|
-
self << "SSLCACertificateFile #{
|
|
12
|
+
self << "SSLCACertificateFile #{value}"
|
|
12
13
|
end
|
|
13
14
|
end
|
|
14
15
|
self << ""
|