aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/se_info_env.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v6/se_info_env.rb')
-rw-r--r--lib/sisu/v6/se_info_env.rb31
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/sisu/v6/se_info_env.rb b/lib/sisu/v6/se_info_env.rb
index bda773ff..0ce6f63a 100644
--- a/lib/sisu/v6/se_info_env.rb
+++ b/lib/sisu/v6/se_info_env.rb
@@ -1634,7 +1634,7 @@ WOK
http=http.strip
end
def webserv_base_cgi(opt=nil) #web url for local webserv (localhost, or hostname)
- http=if opt.selections.str =~/--webserv-(?:cgi|db|search)[=-]["']?(\S+)["']+/
+ http_cgi=if opt.selections.str =~/--webserv-(?:cgi|db|search)[=-]["']?(\S+)["']+/
m=$1
(m=~/http\/\/:/) ? m : %{http://#{m}}
elsif defined? @rc['webserv_cgi']['host'] \
@@ -1642,7 +1642,7 @@ WOK
http=((@rc['webserv_cgi']['host'] =~ /https?:\/\//) ? '' : 'http://')
if port.webserv_port_cgi(opt)
http + @rc['webserv_cgi']['host'] + ':' \
- + port.webserv_port_cgi(opt)
+ + port.webserv_port_cgi(opt).to_s
else
http + @rc['webserv_cgi']['host']
end
@@ -1650,11 +1650,11 @@ WOK
http=((webserv_host_base=~/https?:\/\//) ? '' : 'http://')
if port.webserv_port_cgi(opt)
http + webserv_host_base + ':' \
- + port.webserv_port_cgi(opt)
- else "#{http}#{webserv_host_base}"
+ + port.webserv_port_cgi(opt).to_s
+ else http + webserv_host_base
end
end
- http=http.strip
+ http_cgi=http_cgi.strip
#%q{http://#{ENV['HTTP_HOST']}}
end
def webrick #must have a port #REMOVE
@@ -1666,12 +1666,13 @@ WOK
'https://'
else defaults
end
- "#{http}#{@rc['webserv_cgi']['host']}"
+ http + @rc['webserv_cgi']['host']
elsif webserv_host_base \
and webserv_host_base.is_a?(String)
- http + webserv_host_base
+ webserv_host_base
else
- http + 'localhost'
+ #http + 'localhost'
+ 'localhost'
end
end
def webserv #web url for local webserv (localhost, or hostname)
@@ -1833,8 +1834,7 @@ WOK
else
if defined? @rc['webserv_cgi']['port']
if @rc['webserv_cgi']['port'].nil? \
- and (defined? @md.opt.mod \
- and not @md.opt.mod.nil? \
+ and (defined? @md.opt.selections \
and @md.opt.selections.str=~/webrick/)
defaults[:webserv_port_cgi]
elsif not @rc['webserv_cgi']['port'].nil?
@@ -1847,14 +1847,13 @@ WOK
end
def webserv_port_cgi(opt=nil)
port=if opt \
- and @md.opt.act[:sample_search_form][:set]==:on \
- and opt.selections.str=~/port=(\d+)/
+ and opt.act[:sample_search_form][:set]==:on \
+ and opt.selections.str=~/port[=-](\d+)/
$1
else
port=if defined? @rc['webserv_cgi']['port']
if @rc['webserv_cgi']['port'].nil? \
- and (defined? opt.mod \
- and not opt.mod.nil? \
+ and (defined? opt.selections \
and opt.selections.str=~/webrick/)
defaults[:webserv_port_cgi]
elsif not @rc['webserv_cgi']['port'].nil?
@@ -1862,14 +1861,14 @@ WOK
else nil
end
else
- if (defined? opt.mod \
- and not opt.mod.nil? \
+ if (defined? opt.selections \
and opt.selections.str=~/webrick/)
defaults[:webserv_port_cgi]
else nil
end
end
end
+ port.to_s
end
self
end