aboutsummaryrefslogtreecommitdiffstats
path: root/lib/un.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-18 13:58:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-18 13:58:26 +0000
commitbb513055b234713f1aa5e712cedcbbd463aa88e7 (patch)
treedfa24a87d829ebc08f0c6684db4a96dc66793bbe /lib/un.rb
parenta34a28148a7a829088dffb8b24dfb9cb8af8fea1 (diff)
downloadruby-bb513055b234713f1aa5e712cedcbbd463aa88e7.tar.gz
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
Diffstat (limited to 'lib/un.rb')
-rw-r--r--lib/un.rb5
1 files changed, 1 insertions, 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"