Skip to content

Commit

Permalink
un.rb: DocumentRoot
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nobu committed Aug 3, 2012
1 parent 5b657b5 commit a580c01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/un.rb
Expand Up @@ -311,9 +311,10 @@ def httpd
[:Port, :MaxClients].each do |name|
opt = options[name] and (options[name] = Integer(opt)) rescue nil
end
unless argv.empty?
options[:DocumentRoot] = argv.shift
unless argv.size == 1
raise ArgumentError, "DocumentRoot is mandatory"
end
options[:DocumentRoot] = argv.shift
s = WEBrick::HTTPServer.new(options)
shut = proc {s.shutdown}
Signal.trap("TERM", shut)
Expand Down

0 comments on commit a580c01

Please sign in to comment.