diff options
Diffstat (limited to 'lib/sisu/v3/cgi_sql_common.rb')
-rw-r--r-- | lib/sisu/v3/cgi_sql_common.rb | 74 |
1 files changed, 40 insertions, 34 deletions
diff --git a/lib/sisu/v3/cgi_sql_common.rb b/lib/sisu/v3/cgi_sql_common.rb index 1174be6e..0f56f77f 100644 --- a/lib/sisu/v3/cgi_sql_common.rb +++ b/lib/sisu/v3/cgi_sql_common.rb @@ -58,8 +58,9 @@ =end module SiSU_CGI_sql class SiSU_CGI_common - def initialize(webserv,cmd,image_src,dir) - @webserv,@cmd,@image_src,@env=webserv,cmd,image_src,dir + def initialize(webserv,opt,image_src,dir) + @webserv,@opt,@image_src,@env=webserv,opt,image_src,dir + @cmd=opt.cmd end def about <<-'WOK_SQL' @@ -829,45 +830,50 @@ module SiSU_CGI_sql end @hostpath="#{@hosturl_files}/#{@stub}" @ln='en' - def output_dir_structure - def by_language_code? - true - end - def by_filetype? - false - end - def by_filename? - false - end - self + WOK_SQL + end + def dir_structure + case @opt.dir_structure_by + when /language/ + <<-'WOK_SQL' + def path_manifest(fn,ln=nil) + "#{@hostpath}/#{ln}/manifest/#{fn}.manifest.html" end + def path_html_seg(fn,ln=nil) + "#{@hostpath}/#{ln}/html/#{fn}" + end + def path_html_doc(fn,ln=nil) + "#{@hostpath}/#{ln}/html/#{fn}.html" + end + WOK_SQL + when /filetype/ + <<-'WOK_SQL' def path_manifest(fn,ln=nil) - if output_dir_structure.by_language_code? - manifest_at="#{@hostpath}/#{ln}/manifest/#{fn}.manifest.html" - elsif output_dir_structure.by_filetype? - manifest_at="#{@hostpath}/manifest/#{fn}.manifest.html" - elsif output_dir_structure.by_filename? - manifest_at="#{@hostpath}/#{fn}/manifest.html" - end + "#{@hostpath}/manifest/#{fn}.manifest.html" end def path_html_seg(fn,ln=nil) - if output_dir_structure.by_language_code? - html_at="#{@hostpath}/#{ln}/html/#{fn}" - elsif output_dir_structure.by_filetype? - html_at="#{@hostpath}/html/#{fn}" - elsif output_dir_structure.by_filename? - html_at="#{@hostpath}/#{fn}" - end + "#{@hostpath}/html/#{fn}" end def path_html_doc(fn,ln=nil) - if output_dir_structure.by_language_code? - html_at="#{@hostpath}/#{ln}/html/#{fn}.html" - elsif output_dir_structure.by_filetype? - html_at="#{@hostpath}/html/#{fn}.html" - elsif output_dir_structure.by_filename? - html_at="#{@hostpath}/#{fn}/doc.html" - end + "#{@hostpath}/html/#{fn}.html" + end + WOK_SQL + else + <<-'WOK_SQL' + def path_manifest(fn,ln=nil) + "#{@hostpath}/#{fn}/manifest.html" + end + def path_html_seg(fn,ln=nil) + "#{@hostpath}/#{fn}" end + def path_html_doc(fn,ln=nil) + "#{@hostpath}/#{fn}/doc.html" + end + WOK_SQL + end + end + def main3 + <<-'WOK_SQL' #% text_objects_body s_contents.each do |c| #% text body location=c['src_filename'][/(.+?)\.(?:ssm\.sst|sst)$/,1] |