diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-08-08 00:32:27 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-08-08 00:32:27 -0400 |
commit | 809034240a1be22cc00cb3b4c1df1dd2facdc8f8 (patch) | |
tree | 89f9301644b85ff0ff3e0b7c82cca13c5b6389a2 /lib/sisu/v5/se_info_env.rb | |
parent | v5 v6: version & changelog (& rakefile) (diff) |
v5: merged v6 libraries
* commandline, --act0 to --act9, rc-config with flag:act[0-9]
* configurable command line options increased to 0 - 9 (instead of 0 - 5)
* use --act0 to --act9 (previous flags -1 to -5; -0 to -9 now available)
* default --act0
* rc config with flag:act0 to flag:act9 (previously roman numerals)
* legacy roman numeral configuration works (for now)
* use opt.act, code internals (simplify, cleaner; remove opt.cmd
& opt.mod)
* hub, further changes related to use of opt.act; hub file split
Diffstat (limited to 'lib/sisu/v5/se_info_env.rb')
-rw-r--r-- | lib/sisu/v5/se_info_env.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/sisu/v5/se_info_env.rb b/lib/sisu/v5/se_info_env.rb index df3d0216..5d91e433 100644 --- a/lib/sisu/v5/se_info_env.rb +++ b/lib/sisu/v5/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.mod.inspect =~/--webserv-(?:cgi|db|search)[=-]["']?(\S+)["']+/ + http=if opt.selections.str =~/--webserv-(?:cgi|db|search)[=-]["']?(\S+)["']+/ m=$1 (m=~/http\/\/:/) ? m : %{http://#{m}} elsif defined? @rc['webserv_cgi']['host'] \ @@ -1708,7 +1708,7 @@ WOK end end def webserv_files_from_db(opt=nil) #sort this out, messy - if opt.mod.inspect =~/--webserv-output[=-]["']?(\S+)["']+/ + if opt.selections.str =~/--webserv-output[=-]["']?(\S+)["']+/ m=$1 (m=~/(?:http|file\/)\/\/:/) ? m : %{http://#{m}} else @@ -1729,10 +1729,10 @@ WOK #%q{http://#{ENV['HTTP_HOST']}/cgi-bin} end def cgi_sample_search_form_name(opt=nil) - if opt.mod.inspect \ + if opt.selections.str \ =~/--(?:cgi-)?search-form-name[=-]["']?(\S+?\.cgi)/ $1 - elsif not opt.mod.inspect =~/--db[=-]["']?sqlite/ \ + elsif not opt.selections.str =~/--db[=-]["']?sqlite/ \ and defined? @rc['search'] \ and defined? @rc['search']['sisu'] \ and defined? @rc['search']['sisu']['action'] \ @@ -1740,7 +1740,7 @@ WOK /(?:https?:\/\/\S+?)\/([^\/]+?\.cgi)$/. match(@rc['search']['sisu']['action'])[1] else - (opt.mod.inspect =~/--db[=-]["']?sqlite/) \ + (opt.selections.str =~/--db[=-]["']?sqlite/) \ ? "#{Db[:name_prefix_db]}sqlite.cgi" \ : "#{Db[:name_prefix_db]}pg.cgi" end @@ -1783,12 +1783,12 @@ WOK path.image_source_include else if @@local_image==true - cmd=@cmd ? @cmd : '' + cmd=@selections.str ? @selections.str : '' SiSU_Screen::Ansi.new( cmd, "WARNING - no local image directory or images:", defaults[:image_local] - ).warn unless cmd =~/q/ + ).warn unless @md.opt.act[:quiet][:set]==:on @@local_image=false end url.images @@ -1813,7 +1813,7 @@ WOK @cmd, 'WARNING - image directory for external images or no such images:', :image_external - ).warn unless @cmd =~/q/ + ).warn unless @md.opt.act[:quiet][:set]==:on @@local_image=false end url.images_external @@ -1827,15 +1827,15 @@ WOK def port def webrick_port if @md \ - and @md.opt.cmd.inspect=~/-F/ \ - and @md.opt.mod.inspect=~/port=(\d+)/ + and @md.opt.act[:sample_search_form][:set]==:on \ + and @md.opt.selections.str=~/port=(\d+)/ $1 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 @md.opt.mod.inspect=~/webrick/) + and @md.opt.selections.str=~/webrick/) defaults[:webserv_port_cgi] elsif not @rc['webserv_cgi']['port'].nil? @rc['webserv_cgi']['port'] @@ -1847,15 +1847,15 @@ WOK end def webserv_port_cgi(opt=nil) port=if opt \ - and opt.cmd.inspect=~/-F/ \ - and opt.mod.inspect=~/port=(\d+)/ + and @md.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 opt.mod.inspect=~/webrick/) + and opt.selections.str=~/webrick/) defaults[:webserv_port_cgi] elsif not @rc['webserv_cgi']['port'].nil? @rc['webserv_cgi']['port'] @@ -1864,7 +1864,7 @@ WOK else if (defined? opt.mod \ and not opt.mod.nil? \ - and opt.mod.inspect=~/webrick/) + and opt.selections.str=~/webrick/) defaults[:webserv_port_cgi] else nil end @@ -2145,7 +2145,7 @@ WOK SiSU_Screen::Ansi.new( '', '*WARN* file not found: ' + fns_pod - ).warn unless @cmd=~/q/ + ).warn unless @md.opt.act[:quiet][:set]==:on end sisupod_processing_path end @@ -2164,7 +2164,7 @@ WOK : (SiSU_Screen::Ansi.new( '', "*WARN* file not found: #{fns_pod}" - ).warn unless @cmd=~/q/) + ).warn unless @md.opt.act[:quiet][:set]==:on) sisupod_processing_path end end |