From a580c01dc0b40a4c69d016113f2761e6e88de924 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 3 Aug 2012 08:22:45 +0000 Subject: 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 --- lib/un.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/un.rb') diff --git a/lib/un.rb b/lib/un.rb index 0a2e37277a..a07454135c 100644 --- a/lib/un.rb +++ b/lib/un.rb @@ -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) -- cgit v1.2.3