summaryrefslogtreecommitdiffstats
path: root/sample/wsdl/googleSearch/httpd.rb
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-15 11:50:02 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-15 11:50:02 +0000
commitd69d36a5d9a4287fe8cb7443a404c697cf93bc56 (patch)
treeb467b4cbff9406b584a262797af8a27124727c73 /sample/wsdl/googleSearch/httpd.rb
parentf3f90bf9f9f8a6676fd5bd1517a8c2e1d1e4a6c6 (diff)
downloadruby-d69d36a5d9a4287fe8cb7443a404c697cf93bc56.tar.gz
ruby-d69d36a5d9a4287fe8cb7443a404c697cf93bc56.tar.xz
ruby-d69d36a5d9a4287fe8cb7443a404c697cf93bc56.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@5714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/wsdl/googleSearch/httpd.rb')
-rw-r--r--sample/wsdl/googleSearch/httpd.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/sample/wsdl/googleSearch/httpd.rb b/sample/wsdl/googleSearch/httpd.rb
index ee8ab09f5..bebcff96c 100644
--- a/sample/wsdl/googleSearch/httpd.rb
+++ b/sample/wsdl/googleSearch/httpd.rb
@@ -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 }