mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* sample/soap/calc/httpd.rb, sample/soap/exchange/httpd.rb,
sample/soap/sampleStruct/httpd.rb, sample/wsdl/googleSearch/httpd.rb:
use soap/property instead of getopts for configuring DocumentRoot
and port# of httpd. see samplehttpd.conf below.
* sample/soap/calc/samplehttpd.conf,
sample/soap/exchange/samplehttpd.conf,
sample/soap/sampleStruct/samplehttpd.conf,
sample/wsdl/googleSearch/samplehttpd.conf: added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c0f53ebf6d
commit
3fd10dc40c
10 changed files with 60 additions and 16 deletions
|
|
@ -1,14 +1,19 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'webrick'
|
||||
require 'getopts'
|
||||
require 'soap/property'
|
||||
|
||||
getopts "", 'r:', 'p:8808'
|
||||
docroot = "."
|
||||
port = 8808
|
||||
if opt = SOAP::Property.loadproperty("samplehttpd.conf")
|
||||
docroot = opt["docroot"]
|
||||
port = Integer(opt["port"])
|
||||
end
|
||||
|
||||
s = WEBrick::HTTPServer.new(
|
||||
:BindAddress => "0.0.0.0",
|
||||
:Port => $OPT_p.to_i,
|
||||
:DocumentRoot => $OPT_r || ".",
|
||||
:Port => port,
|
||||
:DocumentRoot => docroot,
|
||||
:CGIPathEnv => ENV['PATH']
|
||||
)
|
||||
trap(:INT){ s.shutdown }
|
||||
|
|
|
|||
2
sample/soap/calc/samplehttpd.conf
Normal file
2
sample/soap/calc/samplehttpd.conf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
docroot = .
|
||||
port = 8808
|
||||
Loading…
Add table
Add a link
Reference in a new issue