aboutsummaryrefslogtreecommitdiffstats
path: root/lib/un.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/un.rb')
-rw-r--r--lib/un.rb5
1 files changed, 3 insertions, 2 deletions
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)