From 0770dd950f674b97820b0a5839d0929b96b32762 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 26 Sep 2007 11:14:57 +0100 Subject: sysenv, sisurc.yml allow use of relative output paths, expand to absolute --- lib/sisu/v0/sysenv.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/sisu/v0') diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index 15dbeba5..bf474f64 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -734,7 +734,8 @@ module SiSU_Env include FileUtils attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:webserv_host_cgi,:webserv_port_cgi,:processing,:etc,:yamlrc_dir @@image_flag,@@local_image=true,true #warning on @@image_flag - @@fb=nil + @@fb=@@man_path=nil,nil + #@@fb=nil def initialize(fns='',md=nil) super() #you may not want to re-execute this tatic info so frequently! @fns,@md=fns,md @@ -1141,14 +1142,12 @@ WOK @webserv_path end def webserv #separation required for webrick which cannot use path.output (different requirements as no file is passed) - man_path=if defined? @rc['webserv']['path'] and @rc['webserv']['path'] =~/\S\S+/ - man_path=case @rc['webserv']['path'] - when /^\/\S+/; @rc['webserv']['path'] - when /^\.\/(\S+)/; "#{pwd}/#{$1}" - when /^~\/(\S+)/; "#{home}/#{$1}" - else "#{home}/#{@rc['webserv']['path']}" + man_path=if @@man_path.nil? + man_path=if defined? @rc['webserv']['path'] and @rc['webserv']['path'] =~/\S\S+/ + man_path=@@man_path=File.expand_path(@rc['webserv']['path']) + else nil end - else nil + else manpath=@@man_path end @webserv_path=if defined? man_path and File.writable?("#{man_path}/."); man_path #web server path as configured in rc file elsif FileTest.directory?(defaults[:webserv_path]) and File.writable?("#{defaults[:webserv_path]}/.") #web server path default -- cgit v1.2.3