mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
un.rb: DocumentRoot
* lib/un.rb (httpd): document root is mandatory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5b657b5dcb
commit
a580c01dc0
1 changed files with 3 additions and 2 deletions
|
@ -311,9 +311,10 @@ def httpd
|
||||||
[:Port, :MaxClients].each do |name|
|
[:Port, :MaxClients].each do |name|
|
||||||
opt = options[name] and (options[name] = Integer(opt)) rescue nil
|
opt = options[name] and (options[name] = Integer(opt)) rescue nil
|
||||||
end
|
end
|
||||||
unless argv.empty?
|
unless argv.size == 1
|
||||||
options[:DocumentRoot] = argv.shift
|
raise ArgumentError, "DocumentRoot is mandatory"
|
||||||
end
|
end
|
||||||
|
options[:DocumentRoot] = argv.shift
|
||||||
s = WEBrick::HTTPServer.new(options)
|
s = WEBrick::HTTPServer.new(options)
|
||||||
shut = proc {s.shutdown}
|
shut = proc {s.shutdown}
|
||||||
Signal.trap("TERM", shut)
|
Signal.trap("TERM", shut)
|
||||||
|
|
Loading…
Add table
Reference in a new issue