ruby-changes:24557
From: nobu <ko1@a...>
Date: Fri, 3 Aug 2012 17:22:59 +0900 (JST)
Subject: [ruby-changes:24557] nobu:r36608 (trunk): un.rb: DocumentRoot
nobu 2012-08-03 17:22:45 +0900 (Fri, 03 Aug 2012) New Revision: 36608 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36608 Log: un.rb: DocumentRoot * lib/un.rb (httpd): document root is mandatory. Modified files: trunk/lib/un.rb Index: lib/un.rb =================================================================== --- lib/un.rb (revision 36607) +++ lib/un.rb (revision 36608) @@ -311,9 +311,10 @@ [: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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/