From 0b9d86f29be8e3d4fa0958bf3db41907e21ad1a0 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 18 Jun 2015 13:58:26 +0000 Subject: un.rb: cwd by default * lib/un.rb (httpd): set DocumentRoot to the current working directory by default. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/un.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/un.rb b/lib/un.rb index aa991288c3..ac1abe8d8b 100644 --- a/lib/un.rb +++ b/lib/un.rb @@ -320,10 +320,7 @@ def httpd opt = options[name] and (options[name] = Integer(opt)) rescue nil end options[:Port] ||= 8080 # HTTP Alternate - unless argv.size == 1 - raise ArgumentError, "DocumentRoot is mandatory" - end - options[:DocumentRoot] = argv.shift + options[:DocumentRoot] = argv.shift || '.' s = WEBrick::HTTPServer.new(options) shut = proc {s.shutdown} siglist = %w"TERM QUIT" -- cgit v1.2.3