From 0df2126ee144e10cccaad32d550b7a741146aac2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 24 May 2011 21:39:00 -0400 Subject: v3: sysenv, url webserver link (manifest) fix --- lib/sisu/v3/sysenv.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index a35a9eef..944df010 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -2068,15 +2068,20 @@ WOK else "#{http}localhost" end end def webserv #web url for local webserv (localhost, or hostname) - if path.webserv_dir \ + if defined? @rc['webserv']['url_root'] \ + and @rc['webserv']['url_root'] =~/http/ + # needed for alternative output dir structures, fixes manifest url links, check may cause problems elsewhere + @rc['webserv']['url_root'] + elsif path.webserv_dir \ and path.webserv =~ /#{path.webserv_dir}/ #revisit "#{path.webserv}/#{@stub_pwd}".gsub(/#{path.webserv_dir}/,"#{url.hostname}/#{@stub_pwd}") elsif defined? @rc['webserv']['webrick_url'] \ and @rc['webserv']['webrick_url']==false - "file://#{path.webserv}/#{@stub_pwd}" + "file://#{path.webserv}" elsif webserv_port_cgi =~/\S+/ - "#{url.hostname}:#{webserv_port_cgi}/#{@stub_pwd}" - else "#{url.hostname}/#{@stub_pwd}" + "#{url.hostname}:#{webserv_port_cgi}" + else + url.hostname end end def webserv_base #web url for local webserv (localhost, or hostname) @@ -3810,8 +3815,7 @@ WOK "#{@env.path.webserv}/#{@md.opt.f_pth[:pth_stub]}" end def url - "#{@env.url.root}" - #url: "#{@env.url.root}/#{@md.opt.f_pth[:pth_stub]}" + "#{@env.url.webserv}/#{@md.opt.f_pth[:pth_stub]}" end def rel "./#{@md.opt.f_pth[:pth_stub]}" -- cgit v1.2.3