зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
82c290983f
Коммит
0b9d86f29b
|
@ -320,10 +320,7 @@ def httpd
|
||||||
opt = options[name] and (options[name] = Integer(opt)) rescue nil
|
opt = options[name] and (options[name] = Integer(opt)) rescue nil
|
||||||
end
|
end
|
||||||
options[:Port] ||= 8080 # HTTP Alternate
|
options[:Port] ||= 8080 # HTTP Alternate
|
||||||
unless argv.size == 1
|
options[:DocumentRoot] = argv.shift || '.'
|
||||||
raise ArgumentError, "DocumentRoot is mandatory"
|
|
||||||
end
|
|
||||||
options[:DocumentRoot] = argv.shift
|
|
||||||
s = WEBrick::HTTPServer.new(options)
|
s = WEBrick::HTTPServer.new(options)
|
||||||
shut = proc {s.shutdown}
|
shut = proc {s.shutdown}
|
||||||
siglist = %w"TERM QUIT"
|
siglist = %w"TERM QUIT"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче