From 5abc572129ac49178aa77ea59cb8e5d611e6374f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 1 Mar 2011 20:46:02 -0500 Subject: v3: sysenv, separate out processing_path method plus consequences --- CHANGELOG_v3 | 3 + data/doc/sisu/v3/CHANGELOG | 3 + lib/sisu/v3/composite.rb | 10 +- lib/sisu/v3/conf.rb | 14 +- lib/sisu/v3/dal.rb | 8 +- lib/sisu/v3/db_import.rb | 6 +- lib/sisu/v3/db_select.rb | 6 +- lib/sisu/v3/epub.rb | 16 +- lib/sisu/v3/epub_concordance.rb | 2 +- lib/sisu/v3/epub_segments.rb | 2 +- lib/sisu/v3/git.rb | 6 +- lib/sisu/v3/help.rb | 26 +-- lib/sisu/v3/html.rb | 2 +- lib/sisu/v3/hub.rb | 8 +- lib/sisu/v3/odf.rb | 14 +- lib/sisu/v3/param.rb | 8 +- lib/sisu/v3/share_src.rb | 2 +- lib/sisu/v3/sisupod_make.rb | 24 +-- lib/sisu/v3/sst_do_inline_footnotes.rb | 2 +- lib/sisu/v3/sysenv.rb | 311 ++++++++++++++++----------------- lib/sisu/v3/texinfo.rb | 6 +- lib/sisu/v3/texpdf.rb | 14 +- lib/sisu/v3/urls.rb | 16 +- 23 files changed, 257 insertions(+), 252 deletions(-) diff --git a/CHANGELOG_v3 b/CHANGELOG_v3 index 81aaab62..165d6665 100644 --- a/CHANGELOG_v3 +++ b/CHANGELOG_v3 @@ -35,6 +35,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.2.orig.tar.gz * use "encoding: utf-8" (instead of coding) + * sysenv, processing_path method (separated from path) and resulting + necessary changes + * urls, param, two unrelated regex fixes, check * hub, minor rearranging diff --git a/data/doc/sisu/v3/CHANGELOG b/data/doc/sisu/v3/CHANGELOG index 34b927af..2a59a40e 100644 --- a/data/doc/sisu/v3/CHANGELOG +++ b/data/doc/sisu/v3/CHANGELOG @@ -35,6 +35,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.0.2.orig.tar.gz * use "encoding: utf-8" (instead of coding) + * sysenv, processing_path method (separated from path) and resulting + necessary changes + * urls, param, two unrelated regex fixes, check * hub, minor rearranging diff --git a/lib/sisu/v3/composite.rb b/lib/sisu/v3/composite.rb index b91e455b..674618f9 100644 --- a/lib/sisu/v3/composite.rb +++ b/lib/sisu/v3/composite.rb @@ -71,7 +71,7 @@ module SiSU_Assemble images end def download_images(download_from,images_array) - path="#{@env.path.processing}/external_document/image" + path="#{@env.processing_path.processing}/external_document/image" mkdir_p(path) unless FileTest.directory?(path) images_array.each do |i| image="#{path}/#{i}" @@ -86,7 +86,7 @@ module SiSU_Assemble SiSU_Env::System_call.new("#{path}/*",output_path,'q').rsync end def download_doc_skin(doc_skin) #first element in array is source url - path="#{@env.path.processing}/external_document/skin/doc" + path="#{@env.processing_path.processing}/external_document/skin/doc" mkdir_p(path) unless FileTest.directory?(path) download_from=doc_skin.shift doc_skin.each do |i| @@ -117,12 +117,12 @@ module SiSU_Assemble end end def write(assembled) - assembled_file=File.new("#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst",'w+') + assembled_file=File.new("#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst",'w+') assembled.each {|a| assembled_file << a } assembled_file.close end def download_images(download_from,images_array) - path="#{@env.path.processing}/external_document/image" + path="#{@env.processing_path.processing}/external_document/image" mkdir_p(path) unless FileTest.directory?(path) images_array.each do |i| image="#{path}/#{i}" @@ -136,7 +136,7 @@ module SiSU_Assemble end end def download_doc_skin(doc_skin) #first element in array is source url - path="#{@env.path.processing}/external_document/skin/doc" + path="#{@env.processing_path.processing}/external_document/skin/doc" mkdir_p(path) unless FileTest.directory?(path) download_from=doc_skin.shift doc_skin.each do |i| diff --git a/lib/sisu/v3/conf.rb b/lib/sisu/v3/conf.rb index ecda22e8..197a04b3 100644 --- a/lib/sisu/v3/conf.rb +++ b/lib/sisu/v3/conf.rb @@ -161,7 +161,7 @@ module SiSU_Initialize end def trang_rnc_model_output_sax s=@suffix - rnc_src=@env.path.dal + '/sax.' + s[:rnc] + rnc_src=@env.processing_path.dal + '/sax.' + s[:rnc] rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_sax rng_file=@path[:rng] + '/' + @rxng.rng_name.output_sax xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_sax @@ -180,7 +180,7 @@ module SiSU_Initialize end def trang_rnc_model_output_dom s=@suffix - rnc_src=@env.path.dal + '/dom.' + s[:rnc] + rnc_src=@env.processing_path.dal + '/dom.' + s[:rnc] rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_dom rng_file=@path[:rng] + '/' + @rxng.rng_name.output_dom xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_dom @@ -199,7 +199,7 @@ module SiSU_Initialize end def trang_rnc_model_output_xhtml s=@suffix - rnc_src=@env.path.dal + '/xhtml.' + s[:rnc] + rnc_src=@env.processing_path.dal + '/xhtml.' + s[:rnc] rnc_file=@path[:rnc] + '/' + @rxng.rnc_name.output_xhtml rng_file=@path[:rng] + '/' + @rxng.rng_name.output_xhtml xsd_file=@path[:xsd] + '/' + @rxng.xsd_name.output_xhtml @@ -217,7 +217,7 @@ module SiSU_Initialize chmod(0644,rnc_file) end def trang_rnc_model_input_sax - rnc_file=@env.path.dal + '/sax.rnc' + rnc_file=@env.processing_path.dal + '/sax.rnc' dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_sax rnc=File.new(rnc_file,'w') rnc << @rxng.rnc_model_output_sax @@ -226,7 +226,7 @@ module SiSU_Initialize schema.relaxng(@opt.cmd) end def trang_rnc_model_input_dom - rnc_file=@env.path.dal + '/dom.rnc' + rnc_file=@env.processing_path.dal + '/dom.rnc' dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_dom rnc=File.new(rnc_file,'w') rnc << @rxng.rnc_model_output_dom @@ -235,8 +235,8 @@ module SiSU_Initialize schema.relaxng(@opt.cmd) end def trang_rnc_model_input_node - rnc_file=@env.path.dal + '/node.rnc' - rng_file=@env.path.dal + '/node.rng' + rnc_file=@env.processing_path.dal + '/node.rnc' + rng_file=@env.processing_path.dal + '/node.rng' dtd_file=@path[:xsd] + '/' + @rxng.rng_name.input_node rnc=File.new(rnc_file,'w') rnc << @rxng.rnc_model_input_node diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index 1e1de19b..13414826 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -408,11 +408,11 @@ module SiSU_DAL end end else - hard="#{@dir.path.dal}/#{@md.fns}.meta" + hard="#{@dir.processing_path.dal}/#{@md.fns}.meta" File.unlink(hard) if FileTest.file?(hard) - hard="#{@dir.path.dal}/#{@md.fns}.txt" + hard="#{@dir.processing_path.dal}/#{@md.fns}.txt" File.unlink(hard) if FileTest.file?(hard) - hard="#{@dir.path.dal}/#{@md.fns}.debug.txt" + hard="#{@dir.processing_path.dal}/#{@md.fns}.debug.txt" File.unlink(hard) if FileTest.file?(hard) end end @@ -433,7 +433,7 @@ module SiSU_DAL @data.each {|s| filename_meta.puts s.strip + "\n" unless s.strip.empty?} end else - hard_idx_html="#{@dir.path.dal}/#{@md.fns}.idx.html" + hard_idx_html="#{@dir.processing_path.dal}/#{@md.fns}.idx.html" File.unlink(hard_idx_html) if FileTest.file?(hard_idx_html) end end diff --git a/lib/sisu/v3/db_import.rb b/lib/sisu/v3/db_import.rb index 62873518..f1e7f064 100644 --- a/lib/sisu/v3/db_import.rb +++ b/lib/sisu/v3/db_import.rb @@ -73,7 +73,7 @@ module SiSU_DB_import @opt,@conn,@file,@sql_type=opt,conn,file,sql_type @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX @env=SiSU_Env::Info_env.new(@opt.fns) - @dal="#{@env.path.dal}" + @dal="#{@env.processing_path.dal}" if @opt.fns.empty? or @opt.cmd.empty?; @fnb='' else @md=SiSU_Param::Parameters.new(@opt).get @@ -162,7 +162,7 @@ module SiSU_DB_import puts "Error message: #{e.errstr}" puts "Error SQLSTATE: #{e.state}" SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - sqlfn="#{@env.path.sql}/#{@md.fnb}.sql" + sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" sql=File.new(sqlfn,'w') t_d.each {|i| sql.puts i} p sqlfn @@ -173,7 +173,7 @@ module SiSU_DB_import end rescue SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - sqlfn="#{@env.path.sql}/#{@md.fnb}.sql" + sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" sql=File.new(sqlfn,'w') t_d.each {|i| sql.puts i} p sqlfn diff --git a/lib/sisu/v3/db_select.rb b/lib/sisu/v3/db_select.rb index cd0f38e7..9bf8acbc 100644 --- a/lib/sisu/v3/db_select.rb +++ b/lib/sisu/v3/db_select.rb @@ -91,10 +91,10 @@ module SiSU_DB_select file=if @opt.inspect =~/M/ x=if @opt.fns and not @opt.fns.empty? @env=SiSU_Env::Info_env.new(@opt.fns) if @opt.fns - puts "\n#{@env.path.sqlite}/#{@opt.fns}.sql" if @sql_type =~/sqlite/ and @opt.cmd =~/M/ + puts "\n#{@env.processing_path.sqlite}/#{@opt.fns}.sql" if @sql_type =~/sqlite/ and @opt.cmd =~/M/ @db=SiSU_Env::Info_db.new - @job="sqlite3 #{@db.sqlite.db} < #{@env.path.sqlite}/#{@opt.fns}.sql" - File.new("#{@env.path.sqlite}/#{@opt.fns}.sql",'w+') + @job="sqlite3 #{@db.sqlite.db} < #{@env.processing_path.sqlite}/#{@opt.fns}.sql" + File.new("#{@env.processing_path.sqlite}/#{@opt.fns}.sql",'w+') elsif @opt.fns and @opt.fns.inspect =~/create/; nil #sort variations later else nil end diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index c39b7800..b76beb17 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -93,9 +93,9 @@ module SiSU_EPUB : SiSU_Screen::Ansi.new(@opt.cmd,'EPUB',tool).green_title_hi SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.file.output_path.epub}/#{@md.file.base_filename.epub}").flow if @opt.cmd =~/[MV]/ end - @env.path.epub_bld #(@md) - @env.path.epub_cp_images(@md) - dir_epub=@env.path.epub + @env.processing_path.epub_bld #(@md) + @env.processing_path.epub_cp_images(@md) + dir_epub=@env.processing_path.epub SiSU_Env::Info_skin.new(@md).select data=nil SiSU_Env::SiSU_file.new(@md).mkdir.output.epub @@ -110,7 +110,7 @@ module SiSU_EPUB rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure unless @opt.cmd =~/[MV]/ #check maintenance flag - texfiles=Dir["#{@env.path.tune}/#{@opt.fns}*"] + texfiles=Dir["#{@env.processing_path.tune}/#{@opt.fns}*"] texfiles.each do |f| if FileTest.file?(f) File.unlink(f) @@ -629,9 +629,9 @@ module SiSU_EPUB def images img_pth=@md.env.path.image_source_include @md.ec[:image].each do |x| - if FileTest.directory?("#{@md.env.path.epub}/OPS/image") \ + if FileTest.directory?("#{@md.env.processing_path.epub}/OPS/image") \ and FileTest.file?("#{img_pth}/#{x}") - cp("#{img_pth}/#{x}","#{@md.env.path.epub}/OPS/image") + cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/OPS/image") end end end @@ -641,13 +641,13 @@ module SiSU_EPUB def output_zip mkdir_p(@md.file.output_path.epub) unless FileTest.directory?(@md.file.output_path.epub) system(" - cd #{@md.env.path.epub} + cd #{@md.env.processing_path.epub} zip -qXr9D #{@epub_doc} * mv #{@epub_doc} #{@md.file.place_file.epub} cd #{Dir.pwd} ") unless @md.cmd.inspect =~/M/ - system("rm -r #{@md.env.path.epub}") + system("rm -r #{@md.env.processing_path.epub}") end end def segtoc diff --git a/lib/sisu/v3/epub_concordance.rb b/lib/sisu/v3/epub_concordance.rb index 7ced16f0..e03034dc 100644 --- a/lib/sisu/v3/epub_concordance.rb +++ b/lib/sisu/v3/epub_concordance.rb @@ -156,7 +156,7 @@ WOK begin @vz=SiSU_Env::Get_init.instance.skin @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array - @path="#{@env.path.epub}" + @path="#{@env.processing_path.epub}" @freq=Hash.new(0) @rxp_lv1=/^#{Mx[:lv_o]}1:/ #fix Mx[:lv_o] @rxp_lv2=/^#{Mx[:lv_o]}2:/ #fix Mx[:lv_o] diff --git a/lib/sisu/v3/epub_segments.rb b/lib/sisu/v3/epub_segments.rb index 61e65544..c06f11f2 100644 --- a/lib/sisu/v3/epub_segments.rb +++ b/lib/sisu/v3/epub_segments.rb @@ -223,7 +223,7 @@ WOK end end if @@is4==1 - dir_epub_cont="#{@md.env.path.epub}/OPS" + dir_epub_cont="#{@md.env.processing_path.epub}/OPS" if newfile==1 \ or dob.obj =~/^#{Mx[:br_endnotes]}|^#{Mx[:br_eof]}/ newfile=0 diff --git a/lib/sisu/v3/git.rb b/lib/sisu/v3/git.rb index f5fae44b..9d1d9332 100644 --- a/lib/sisu/v3/git.rb +++ b/lib/sisu/v3/git.rb @@ -78,7 +78,7 @@ module SiSU_Git fnb=@fnn=@opt.fns[m,1] fnt=@opt.fns[m,2] end - git_path_fnb=@env.path.processing_path_git + '/' + fnb + git_path_fnb=@env.processing_path.git + '/' + fnb #unless @opt.cmd =~/q/ # @opt.cmd=~/[MVvz]/ \ # ? SiSU_Screen::Ansi.new(@opt.cmd,'Git path',@git_path[:fnb]).green_hi_blue \ @@ -185,9 +185,9 @@ module SiSU_Git and @opt.cmd.inspect !~/m/ ##SiSU_Assemble::Composite.new(@opt).read #SiSU_DAL::Source.new(@opt).read # -m - "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" elsif composite_src - "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" else "#{@env.path.pwd}/#{@opt.fns}" end end diff --git a/lib/sisu/v3/help.rb b/lib/sisu/v3/help.rb index 9d293979..a0d62644 100644 --- a/lib/sisu/v3/help.rb +++ b/lib/sisu/v3/help.rb @@ -766,16 +766,16 @@ If you have problems check permissions (and if in home directory ownership). #{@cX.green}directory paths as currently set#{@cX.off}: output docs: #{@cX.blue}#{@env.path.webserv}#{@cX.off} cgi scripts: #{@cX.blue}#{@env.path.cgi}#{@cX.off} - processing: #{@cX.blue}#{@env.path.processing}#{@cX.off} - sisu meta markup: #{@cX.blue}#{@env.path.dal}#{@cX.off} - html tuning: #{@cX.blue}#{@env.path.tune}#{@cX.off} - latex: #{@cX.blue}#{@env.path.tex}#{@cX.off} - texinfo: #{@cX.blue}#{@env.path.texi}#{@cX.off} + processing: #{@cX.blue}#{@env.processing_path.processing}#{@cX.off} + sisu meta markup: #{@cX.blue}#{@env.processing_path.dal}#{@cX.off} + html tuning: #{@cX.blue}#{@env.processing_path.tune}#{@cX.off} + latex: #{@cX.blue}#{@env.processing_path.tex}#{@cX.off} + texinfo: #{@cX.blue}#{@env.processing_path.texi}#{@cX.off} images: source: #{@cX.blue}#{@env.path.image_source}#{@cX.off} latex source: #{@cX.blue}#{@env.path.image_source_include}#{@cX.off} note images are also sourced from within your pwd - #{@cX.blue}#{Dir.pwd}/_sisu/image#{@cX.off} if it exists - #{@cX.grey}[ texinfo: #{@env.path.texinfo} - check duplication ]#{@cX.off} + #{@cX.grey}[ texinfo: #{@env.processing_path.texinfo} - check duplication ]#{@cX.off} #{@cX.green}resource configuraton files#{@cX.off} to change the paths specified above, are searched for in the following order: under the current SiSU markup data directory: #{@cX.blue}#{Dir.pwd}/_sisu/sisurc.yml#{@cX.off} @@ -854,11 +854,11 @@ WOK (d) #{@cX.green}processing directories#{@cX.off} sisu creates a number of processing directories, where these should be located can be modified in #{@cX.green}~/.sisu/sisurc.yml#{@cX.off} work directories include the following: - root working directory #{@cX.blue}#{@env.path.processing}#{@cX.off} - metaverse intermediate markup #{@cX.blue}#{@env.path.dal}#{@cX.off} - tune html (for special html/navigation pages) #{@cX.blue}#{@env.path.tune}#{@cX.off} - tex for latex and pdf #{@cX.blue}#{@env.path.tex}#{@cX.off} - texinfo for texinfo and info files #{@cX.blue}#{@env.path.texi}#{@cX.off} + root working directory #{@cX.blue}#{@env.processing_path.processing}#{@cX.off} + metaverse intermediate markup #{@cX.blue}#{@env.processing_path.dal}#{@cX.off} + tune html (for special html/navigation pages) #{@cX.blue}#{@env.processing_path.tune}#{@cX.off} + tex for latex and pdf #{@cX.blue}#{@env.processing_path.tex}#{@cX.off} + texinfo for texinfo and info files #{@cX.blue}#{@env.processing_path.texi}#{@cX.off} These files are usually used only for processing and removed. There is a maintenance flag to keep them. @@ -992,7 +992,7 @@ WOK papersize set (LaTeX/pdf): #{@cX.blue}#{@env.papersize}#{@cX.off} (digest and papersize can be changed in sisurc.yml under default:) #{@cX.green}intermediate processing#{@cX.off} - processing directory: #{@cX.blue}#{@env.path.processing}#{@cX.off} + processing directory: #{@cX.blue}#{@env.processing_path.processing}#{@cX.off} (to keep processing output, use -M flag) #{@cX.green}programs selected for viewing output#{@cX.off} text editor: #{@cX.blue}#{@env.program.text_editor}#{@cX.off} @@ -1314,7 +1314,7 @@ WOK lib (site-ruby): #{@cX.blue}#{Config::CONFIG['rubylibdir']}/#{SiSU_lib}#{@cX.off} or #{@cX.blue}#{Config::CONFIG['sitelibdir']}/#{SiSU_lib}#{@cX.off} conf [etc]: #{@cX.blue}#{@env.path.etc}/sisu#{@cX.off} data (document samples, images, README): #{@cX.blue}#{@env.path.sample_data}#{@cX.off} - processing: #{@cX.blue}#{@env.path.processing}#{@cX.off} + processing: #{@cX.blue}#{@env.processing_path.processing}#{@cX.off} output www: #{@cX.blue}#{@env.path.output}#{@cX.off} Output files, are currently set to be produced in: diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb index 2ee031a5..47988cba 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -112,7 +112,7 @@ module SiSU_HTML rescue; SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error ensure unless @opt.cmd =~/[MV]/ #check maintenance flag - texfiles=Dir["#{@env.path.tune}/#{@opt.fns}*"] + texfiles=Dir["#{@env.processing_path.tune}/#{@opt.fns}*"] texfiles.each do |f| if FileTest.file?(f) File.unlink(f) diff --git a/lib/sisu/v3/hub.rb b/lib/sisu/v3/hub.rb index 4fdbdf89..7794c08c 100644 --- a/lib/sisu/v3/hub.rb +++ b/lib/sisu/v3/hub.rb @@ -504,11 +504,11 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ op('urls','urls') @msg,@msgs="\tsisu -W [to start ruby web-server on output directory]\n",nil unless @opt.cmd =~/q/ @tell.call.print_brown if @opt.cmd =~/[uUvVM]/ unless @opt.files.join.empty? - if defined? @@env.path.processing \ + if defined? @@env.processing_path.processing \ and @@env.user \ - and FileTest.directory?(@@env.path.processing) \ - and @@env.path.processing =~/#{@@env.user}$/ #clean temporary processing directory of content as is located in public area - cd(@@env.path.processing_base_tmp) do + and FileTest.directory?(@@env.processing_path.processing) \ + and @@env.processing_path.processing =~/#{@@env.user}$/ #clean temporary processing directory of content as is located in public area + cd(@@env.processing_path.processing_base_tmp) do rm_rf(@@env.user) unless @opt.cmd =~/M/ end end elsif @opt.mod.inspect =~/--query/ diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index f5a11bea..204f0e50 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -207,7 +207,7 @@ module SiSU_ODF w=/([0-9]+\.\d{0,3})/.match(w).captures.join image_source=image_src(i) pwd=Dir.pwd - cp("#{image_source}/#{i}","#{@env.path.processing_odf}/Pictures/#{i}") if image_source + cp("#{image_source}/#{i}","#{@env.processing_path.odf}/Pictures/#{i}") if image_source img=if i.to_s =~/jpg|png|gif/ \ and h.to_s =~/\d/ \ and w.to_s =~/\d/ @@ -506,7 +506,7 @@ module SiSU_ODF odf_tail #($1,$2) fix=[] bullet=image_src('bullet_09.png') - cp("#{bullet}/bullet_09.png","#{@env.path.processing_odf}/Pictures/.") #if image_src('bullet_09.png') + cp("#{bullet}/bullet_09.png","#{@env.processing_path.odf}/Pictures/.") #if image_src('bullet_09.png') odf_metadata data.each do |dob| #p dob.obj if dob.obj =~safe_characters and @md.cmd =~/V/ #KEEP @@ -686,9 +686,9 @@ module SiSU_ODF def odf #%odf output env=SiSU_Env::SiSU_file.new(@md) env.mkdir - env.make_path(@env.path.processing_odf) + env.make_path(@env.processing_path.odf) env.make_path(@md.file.output_path.odt) - filename="#{@env.path.processing_odf}/content.xml" + filename="#{@env.processing_path.odf}/content.xml" od=File.new(filename,'w+') @content.each do |para| # this is a hack od.puts para unless para =~/\A\s*\Z/ @@ -697,7 +697,7 @@ module SiSU_ODF opendoc=@md.fn[:odf] mkdir_p(@md.file.output_path.odt) unless FileTest.directory?(@md.file.output_path.odt) system(" - cd #{@env.path.processing_odf} + cd #{@env.processing_path.odf} zip -qr #{opendoc} * mv #{opendoc} #{@md.file.place_file.odt} cd #{Dir.pwd} @@ -730,9 +730,9 @@ page break notes?? [you could add a note number for every object/paragraph!] - cd(@env.path.processing_odf) + cd(@env.processing_path.odf) structure=[] - Find.find(@env.path.processing_odf) do |f| + Find.find(@env.processing_path.odf) do |f| structure << puts f end open(opendoc,'wb') do |f| diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb index 67716685..9dfbc70f 100644 --- a/lib/sisu/v3/param.rb +++ b/lib/sisu/v3/param.rb @@ -84,7 +84,7 @@ module SiSU_Param end Instantiate.new.param_instantiate @env=SiSU_Env::Info_env.new(@fns) - @pstorefile="#{@env.path.dal}/#{@fns}.pstore" + @pstorefile="#{@env.processing_path.dal}/#{@fns}.pstore" end def get if @opt.f_pth[:pth] != Dir.pwd #BUG check @@ -905,8 +905,8 @@ module SiSU_Param and not @opt.cmd =~/P/ #watch @env_out_root=@env.path.output @dir_out="#{@env.path.output}/#{@fnb}" - @dir_tex=@env.path.processing_tex - @dir_lout=@env.path.lout + @dir_tex=@env.processing_path.tex + @dir_lout=@env.processing_path.lout @@publisher='SiSU http://www.jus.uio.no/sisu' end @txt_path=@txt_path ||= @env.path.output @@ -1369,7 +1369,7 @@ module SiSU_Param class Store def initialize(md,env) @md=md - @pstorefile="#{env.path.dal}/#{md.fns}.pstore" + @pstorefile="#{env.processing_path.dal}/#{md.fns}.pstore" end def store File.unlink(@pstorefile) if FileTest.file?(@pstorefile) diff --git a/lib/sisu/v3/share_src.rb b/lib/sisu/v3/share_src.rb index 7232f9db..5a31f368 100644 --- a/lib/sisu/v3/share_src.rb +++ b/lib/sisu/v3/share_src.rb @@ -82,7 +82,7 @@ module SiSU_Markup unless @opt.fns =~/\.ssm$/; cp(@opt.fns,@file.output_path.src) else req=@opt.fns.gsub(/(.+?\.ssm)$/,'\1.sst') - file="#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" + file="#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" if FileTest.file?(file); cp(file,"#{@file.output_path.src}/#{req}") else print "did not find #{file} to copy" end diff --git a/lib/sisu/v3/sisupod_make.rb b/lib/sisu/v3/sisupod_make.rb index 4e3da06c..21255bb7 100644 --- a/lib/sisu/v3/sisupod_make.rb +++ b/lib/sisu/v3/sisupod_make.rb @@ -71,7 +71,7 @@ module SiSU_Doc @env=SiSU_Env::Info_env.new(@opt.fns) @ver=SiSU_Env::Info_version.instance.get_version @ans=SiSU_Response::Response.new - pod_path="#{@env.path.processing}/sisupod" + pod_path="#{@env.processing_path.processing}/sisupod" @v=if @opt.cmd =~/[VM]/; 'v' else '' end @@ -82,7 +82,7 @@ module SiSU_Doc else @opt.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1') end mkdir_p(pod_path) unless FileTest.directory?(pod_path) - rm_rf("#{@env.path.processing}sisupod/*") if FileTest.directory?("#{@env.path.processing}sisupod") + rm_rf("#{@env.processing_path.processing}sisupod/*") if FileTest.directory?("#{@env.processing_path.processing}sisupod") end def read unless @opt.cmd =~/q/ @@ -146,7 +146,7 @@ module SiSU_Doc "#{@env.path.pwd}/_sisu/skin", "#{@env.path.home}/.sisu/skin", '/etc/sisu/skin', - "#{@env.path.processing}/external_document/skin" + "#{@env.processing_path.processing}/external_document/skin" ] sk_doc,sk_dir="doc/#{skin}.rb","dir/skin_#{@env.stub_pwd}.rb" skin_path.each do |v| #document skin priority 1 @@ -171,7 +171,7 @@ module SiSU_Doc @rgx_skin=/^\s+:skin:\s+(\S+)/ @rgx_doc_import=/^%\s\s*\|(\S+?\.ss[ti])\|@\|\^\|>>ok/ use_file=@opt.fns =~/(?:\.ssm|\.ssm\.sst)$/ \ - ? "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst" \ + ? "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" \ : @opt.fns file_array=IO.readlines(use_file,'') skin,images,doc_import=[],[],[] @@ -195,7 +195,7 @@ module SiSU_Doc else skin_source=select end - docskin_place="#{@env.path.processing}/sisupod/_sisu/skin/#{skin_source[:type]}" + docskin_place="#{@env.processing_path.processing}/sisupod/_sisu/skin/#{skin_source[:type]}" if skin_source[:type] =~/dir/ docskin_with_path="#{docskin_place}/skin_#{@env.stub_pwd}.rb" docskin=[docskin_with_path.gsub(/.+?\/(skin_\S+?)\.rb/,'\1')] @@ -225,7 +225,7 @@ module SiSU_Doc images.delete_if {|x| x =~/https?:\/\// } #images.sort! image_path_pwd='_sisu/image' - path_pod_conf="#{@env.path.processing}/sisupod/_sisu" + path_pod_conf="#{@env.processing_path.processing}/sisupod/_sisu" images_path_pod="#{path_pod_conf}/image" #unattractive hard coding ... ! images_pwd="#{@env.path.pwd}/#{image_path_pwd}" @@ -251,24 +251,24 @@ module SiSU_Doc if doc_import.flatten.length > 0 \ and @opt.fns =~/\.ssm\.sst$/ doc_import.flatten.each do |f| - cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}") + cp_r("#{@env.path.pwd}/#{f}","#{@env.processing_path.processing}/sisupod/#{f}") end end if x[:f] \ and x[:f].length > 1 #store multiple document language versions, sisupod x[:f].each do |f| - cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}") + cp_r("#{@env.path.pwd}/#{f}","#{@env.processing_path.processing}/sisupod/#{f}") end elsif @opt.fns =~/\.ssm\.sst/ ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm') - cp_r("#{@env.path.pwd}/#{ssm}","#{@env.path.processing}/sisupod/#{ssm}") - else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.path.processing}/sisupod/#{@opt.fns}") + cp_r("#{@env.path.pwd}/#{ssm}","#{@env.processing_path.processing}/sisupod/#{ssm}") + else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.processing_path.processing}/sisupod/#{@opt.fns}") end #NB not all possibilies met, revisit, also in case of composite file may wish to add README end def sisupod_7zip #look at later mkdir_p(@file.output_path.sisupod) unless FileTest.directory?(@file.output_path.sisupod) system(%{ - cd #{@env.path.processing} + cd #{@env.processing_path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt #7zip -qz #{@opt.fns}.7z sisu_zip.txt < sisu_zip.txt 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@zipfile}.7z sisu_zip.txt @@ -282,7 +282,7 @@ module SiSU_Doc def sisupod_zip mkdir_p(@file.output_path.sisupod) unless FileTest.directory?(@file.output_path.sisupod) system(%{ - cd #{@env.path.processing} + cd #{@env.processing_path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt zip -qz #{@zipfile}.zip sisu_zip.txt < sisu_zip.txt zip -qr #{@zipfile}.zip sisupod diff --git a/lib/sisu/v3/sst_do_inline_footnotes.rb b/lib/sisu/v3/sst_do_inline_footnotes.rb index 254283d7..18252515 100644 --- a/lib/sisu/v3/sst_do_inline_footnotes.rb +++ b/lib/sisu/v3/sst_do_inline_footnotes.rb @@ -184,7 +184,7 @@ module SiSU_Convert_footnotes def song reset data=@data - @metafile="#{@env.path.dal}/#{@md.fns}.meta" + @metafile="#{@env.processing_path.dal}/#{@md.fns}.meta" my_make_source_file=SiSU_Env::Create_file.new(@md.fns) data=data.join.split("\n\n") data_new=[] diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 1383b728..d4d0f16d 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -114,7 +114,7 @@ module SiSU_Env "#{@@home}/#{prcss_dir_stub}" else prcss_dir_stub end - processing_path=tmp_processing_individual + processing_pth=tmp_processing_individual processing_dir=prcss_dir processing_git="#{Dir.pwd}/#{Gt[:grotto]}" user=ENV['USER'] @@ -184,9 +184,9 @@ module SiSU_Env WEBSERV_SQLITE => out + '/www/sqlite', OUTPUT_LOCAL => @@home + '/sisu_www', PROCESSING_DIR => processing_dir, - PROCESSING_PATH => processing_path, + PROCESSING_PATH => processing_pth, PROCESSING_DIR_TMP_ROOT => prcss_dir_tmp_root, - PROCESSING_PATH_TMP_BASE => processing_path, + PROCESSING_PATH_TMP_BASE => processing_pth, PROCESSING_DAL => 'dal', PROCESSING_TUNE => 'tune', PROCESSING_LATEX => 'tex', @@ -979,7 +979,7 @@ module SiSU_Env @stub_pod end def sisupod - #path.processing + #processing_path.processing # sisupod # sisu # content.sst [file content] @@ -989,13 +989,13 @@ module SiSU_Env # skin/ # doc [relevant skin if any other than default] # image [all images for specific document gathered here] - sisupod_processing_path="#{path.processing}/sisupod" + sisupod_processing_path="#{processing_path.processing}/sisupod" if FileTest.directory?(sisupod_processing_path) \ or FileTest.file?(sisupod_processing_path) rm_rf(sisupod_processing_path) end paths=[] - paths=["#{path.processing}/sisupod/_sisu/skin/doc","#{path.processing}/sisupod/_sisu/skin/dir","#{path.processing}/sisupod/_sisu/skin/site","#{path.processing}/sisupod/_sisu/image"] + paths=["#{processing_path.processing}/sisupod/_sisu/skin/doc","#{processing_path.processing}/sisupod/_sisu/skin/dir","#{processing_path.processing}/sisupod/_sisu/skin/site","#{processing_path.processing}/sisupod/_sisu/image"] paths.each {|x| mkdir_p(x) unless FileTest.directory?(x) } end def defaults #multiple default directories @@ -1328,7 +1328,7 @@ WOK def source_file_path file=@fns.gsub(/\.ssm(?:\.sst)?/,'.ssm.sst') pth=unless file =~/\.ssm\.sst$/; "#{Dir.pwd}" - else "#{path.composite_file}" + else "#{processing_path.composite_file}" end end def source_file_with_path @@ -1339,12 +1339,12 @@ WOK fns_array=if RUBY_VERSION < '1.9' x=unless fns =~/\.ssm.sst$/ IO.readlines(fns,'') - else IO.readlines("#{path.composite_file}/#{fns}",'') + else IO.readlines("#{processing_path.composite_file}/#{fns}",'') end else #ruby version >= '1.9' x=unless fns =~/\.ssm.sst$/ IO.readlines(fns,'r:utf-8') - else IO.readlines("#{path.composite_file}/#{fns}",'r:utf-8') + else IO.readlines("#{processing_path.composite_file}/#{fns}",'r:utf-8') end end end @@ -1478,19 +1478,80 @@ WOK def output #web/webserv output directory... subdirectory into which further subdirectories are made based on file names "#{path.webserv}/#{@stub_pwd}" end + def feed + (defined? @rc['webserv']['feed']) \ + ? ("#{public_output}/#{@rc['webserv']['feed']}") \ + : (defaults[:webserv_feed]) + end + def feed_home + "#{public_output}/#{@rc['webserv']['feed_home']}" + end + def scripts #used previously only to include tla version info + if defined? @rc['project']['path']; "#{home}/#{@rc['project']['path']}" + end + end + def cgi + (defined? @rc['webserv']['cgi']) \ + ? "#{@rc['webserv']['cgi']}" \ + : (defaults[:webserv_cgi]) + end + def php + (defined? @rc['webserv']['php']) \ + ? "#{public_output}/#{@rc['webserv']['php']}" \ + : (defaults[:webserv_php]) + end + # programs + def output_tell + url.webserv_map_pwd + end + def image_source #image repository source directory + image_path=if defined? @rc['image']['path'] \ + and defined? @rc['image']['public'] + pth="#{@rc['image']['path']}" + "#{pth}/#{@rc['image']['public']}" + else "#{share}/image" + end + end + def image_source_sisu_includes + "#{share}/image" + end + def image_source_include #image repository source directory + image_path=if defined? @rc['image']['path'] \ + and defined? @rc['image']['public'] \ + and FileTest.directory?("#{@rc['image']['path']}/#{@rc['image']['public']}")==true + "#{@rc['image']['path']}/#{@rc['image']['public']}" + elsif FileTest.directory?("#{@@pwd}/#{defaults[:image_stub]}")==true + "#{@@pwd}/#{defaults[:image_stub]}" + else + "#{share}/image" + end + end + def image_external + "#{processing}/external_document/image" + end + def image_source_include_local + if FileTest.directory?(defaults[:image_local]); defaults[:image_local] + end + end + def image_source_include_remote + if FileTest.directory?(image_external); image_external + end + end + self + end + def processing_path def encoding pth="#{processing}/#{defaults[:processing_encoding]}" mkdir_p(pth) unless FileTest.directory?(pth) pth end -#def processing def processing_base_tmp defaults[:processing_path_tmp_base] end - def processing_dir_tmp_root + def tmp_root_dir defaults[:processing_dir_tmp_root] end - def processing_path_root + def root_dir proposed_path_base=if defined? @rc['processing']['path'] \ and not @rc['processing']['path'].nil? \ and not @rc['processing']['path'].empty? @@ -1517,30 +1578,30 @@ WOK else defaults[:processing_dir_tmp_root] end end - def processing_path_usr? - case processing_path_root + def usr_dir? + case root_dir when /^\/home/; false else true end end - def processing_path - (processing_path_usr?) \ - ? ("#{processing_path_root}/#{user}/#{stub_pwd}") \ - : ("#{processing_path_root}/#{stub_pwd}") # see defaults[:processing_path] + def stub_dir + (usr_dir?) \ + ? ("#{root_dir}/#{user}/#{stub_pwd}") \ + : ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path] end def processing #processing directory, used/needed for sisu work files, has sub-directories (dal,tex etc) - unless FileTest.directory?(processing_path_root) - mkdir_p(processing_path_root) - File.chmod(0777,processing_path_root) + unless FileTest.directory?(root_dir) + mkdir_p(root_dir) + File.chmod(0777,root_dir) end - if processing_path_usr? - processing_path_usr="#{processing_path_root}/#{user}" + if usr_dir? + processing_path_usr="#{root_dir}/#{user}" mkdir_p(processing_path_usr) unless FileTest.directory?(processing_path_usr) File.chmod(0700,processing_path_usr) end - mkdir_p(processing_path) unless FileTest.directory?(processing_path) - File.chmod(0700,processing_path) - path_processing=[processing_path,defaults[:processing_path],defaults[:processing_path_home]] + mkdir_p(stub_dir) unless FileTest.directory?(stub_dir) + File.chmod(0700,stub_dir) + path_processing=[stub_dir,defaults[:processing_path],defaults[:processing_path_home]] processing=nil path_processing.each do |v| # processing=v @@ -1553,36 +1614,6 @@ WOK end processing end - def processing_path_git - proposed_dir=if defined? @rc['git']['dir'] \ - and not @rc['git']['dir'].nil? \ - and not @rc['git']['dir'].empty? - x=(@rc['git']['dir'] =~/^(?:~|home)$/) \ - ? home + '/' + 'sisu:' \ - : @rc['git']['dir'] + '/' + 'sisu:' - else defaults[:processing_git] - end - end - def processing_git - unless FileTest.directory?(processing_path_git) - mkdir_p(processing_path_git) - File.chmod(0700,processing_path_git) - end - processing_path_git - end - def epub - "#{processing}/epub/#{@fnb}" - end - def sql - pth="#{processing}/sql" - mkdir_p(pth) unless FileTest.directory?(pth) - pth - end - def composite_file - pth=path.dal #"#{processing}/composite" - mkdir_p(pth) unless FileTest.directory?(pth) - pth - end def dal pth=if defined? @rc['processing']['dal'] \ and not @rc['processing']['dal'].nil? \ @@ -1603,21 +1634,44 @@ WOK mkdir_p(pth) unless FileTest.directory?(pth) pth end - def processing_odf + def composite_file + pth=processing_path.dal #"#{processing}/composite" + mkdir_p(pth) unless FileTest.directory?(pth) + pth + end + def git + pth=if defined? @rc['git']['dir'] \ + and not @rc['git']['dir'].nil? \ + and not @rc['git']['dir'].empty? + x=(@rc['git']['dir'] =~/^(?:~|home)$/) \ + ? home + '/' + 'sisu:' \ + : @rc['git']['dir'] + '/' + 'sisu:' + else defaults[:processing_git] + end + unless FileTest.directory?(pth) + mkdir_p(git) + File.chmod(0700,git) + end + pth + end + def odf pth="#{processing}/odf" mkdir_p(pth) unless FileTest.directory?(pth) pth end + def epub + "#{processing}/epub/#{@fnb}" + end def epub_bld #(md) - mkdir_p(path.epub) unless FileTest.directory?(path.epub) - mkdir_p("#{path.epub}/META-INF") unless FileTest.directory?("#{path.epub}/META-INF") - mkdir_p("#{path.epub}/OPS/image") unless FileTest.directory?("#{path.epub}/OPS/image") - mkdir_p("#{path.epub}/OPS/css") unless FileTest.directory?("#{path.epub}/OPS/css") + mkdir_p(processing_path.epub) unless FileTest.directory?(processing_path.epub) + mkdir_p("#{processing_path.epub}/META-INF") unless FileTest.directory?("#{processing_path.epub}/META-INF") + mkdir_p("#{processing_path.epub}/OPS/image") unless FileTest.directory?("#{processing_path.epub}/OPS/image") + mkdir_p("#{processing_path.epub}/OPS/css") unless FileTest.directory?("#{processing_path.epub}/OPS/css") images=%W[bullet_09.png arrow_next_red.png arrow_prev_red.png arrow_up_red.png] - path.epub + processing_path.epub end def epub_cp_images(md) - pth="#{path.epub}/OPS/image" + pth="#{processing_path.epub}/OPS/image" mkdir_p(pth) unless FileTest.directory?(pth) src="#{path.share}/image" images=%W[bullet_09.png arrow_next_red.png arrow_prev_red.png arrow_up_red.png] @@ -1626,7 +1680,7 @@ WOK end pth end - def processing_tex + def tex pth=if defined? @rc['processing']['latex'] \ and not @rc['processing']['latex'].nil? \ and not @rc['processing']['latex'].empty? @@ -1662,6 +1716,11 @@ WOK mkdir_p(pth) unless FileTest.directory?(pth) pth end + def sql + pth="#{processing}/sql" + mkdir_p(pth) unless FileTest.directory?(pth) + pth + end def sqlite pth=if defined? @rc['processing']['sqlite'] \ and not @rc['processing']['sqlite'].nil? \ @@ -1682,66 +1741,6 @@ WOK mkdir_p(pth) unless FileTest.directory?(pth) pth end -#end - def feed - (defined? @rc['webserv']['feed']) \ - ? ("#{public_output}/#{@rc['webserv']['feed']}") \ - : (defaults[:webserv_feed]) - end - def feed_home - "#{public_output}/#{@rc['webserv']['feed_home']}" - end - def scripts #used previously only to include tla version info - if defined? @rc['project']['path']; "#{home}/#{@rc['project']['path']}" - end - end - def cgi - (defined? @rc['webserv']['cgi']) \ - ? "#{@rc['webserv']['cgi']}" \ - : (defaults[:webserv_cgi]) - end - def php - (defined? @rc['webserv']['php']) \ - ? "#{public_output}/#{@rc['webserv']['php']}" \ - : (defaults[:webserv_php]) - end - # programs - def output_tell - url.webserv_map_pwd - end - def image_source #image repository source directory - image_path=if defined? @rc['image']['path'] \ - and defined? @rc['image']['public'] - pth="#{@rc['image']['path']}" - "#{pth}/#{@rc['image']['public']}" - else "#{share}/image" - end - end - def image_source_sisu_includes - "#{share}/image" - end - def image_source_include #image repository source directory - image_path=if defined? @rc['image']['path'] \ - and defined? @rc['image']['public'] \ - and FileTest.directory?("#{@rc['image']['path']}/#{@rc['image']['public']}")==true - "#{@rc['image']['path']}/#{@rc['image']['public']}" - elsif FileTest.directory?("#{@@pwd}/#{defaults[:image_stub]}")==true - "#{@@pwd}/#{defaults[:image_stub]}" - else - "#{share}/image" - end - end - def image_external - "#{processing}/external_document/image" - end - def image_source_include_local - if FileTest.directory?(defaults[:image_local]); defaults[:image_local] - end - end - def image_source_include_remote - if FileTest.directory?(image_external); image_external - end - end self end def url @@ -2197,12 +2196,12 @@ WOK : (defaults[:papersize].downcase) end def odf_structure - rm_rf("#{path.processing}/odf") - system("unzip -q #{path.share}/#{SiSU_version_dir}/odf/odt.zip -d #{path.processing}") + rm_rf("#{processing_path.processing}/odf") + system("unzip -q #{path.share}/#{SiSU_version_dir}/odf/odt.zip -d #{processing_path.processing}") end def sisupod_gen(fns_pod) pwd=Dir.pwd - sisupod_processing_path="#{path.processing}/sisupod" + sisupod_processing_path="#{processing_path.processing}/sisupod" if FileTest.directory?(sisupod_processing_path) \ or FileTest.file?(sisupod_processing_path) rm_rf(sisupod_processing_path) @@ -2211,7 +2210,7 @@ WOK mkdir_p(sisupod_processing_path) end if FileTest.file?("#{Dir.pwd}/#{fns_pod}") - system("unzip -q #{Dir.pwd}/#{fns_pod} -d #{path.processing}") + system("unzip -q #{Dir.pwd}/#{fns_pod} -d #{processing_path.processing}") else SiSU_Screen::Ansi.new('',"file not found: #{fns_pod}").warn unless @cmd=~/q/ end @@ -2840,37 +2839,37 @@ WOK end def marshal def dal_content - "#{@env.path.dal}/#{@fns}.content.rbm" + "#{@env.processing_path.dal}/#{@fns}.content.rbm" end def dal_idx_sst_rel_html_seg - "#{@env.path.dal}/#{@fns}.idx_sst.rbm" + "#{@env.processing_path.dal}/#{@fns}.idx_sst.rbm" end def dal_idx_sst_rel - "#{@env.path.dal}/#{@fns}.idx_tex.rbm" + "#{@env.processing_path.dal}/#{@fns}.idx_tex.rbm" end def dal_idx_html - "#{@env.path.dal}/#{@fns}.idx_html.rbm" + "#{@env.processing_path.dal}/#{@fns}.idx_html.rbm" end def dal_idx_xhtml - "#{@env.path.dal}/#{@fns}.idx_xhtml.rbm" + "#{@env.processing_path.dal}/#{@fns}.idx_xhtml.rbm" end def dal_metadata - "#{@env.path.dal}/#{@fns}.metadata.rbm" + "#{@env.processing_path.dal}/#{@fns}.metadata.rbm" end def dal_map_nametags - "#{@env.path.dal}/#{@fns}.map_name_tags.rbm" + "#{@env.processing_path.dal}/#{@fns}.map_name_tags.rbm" end def dal_map_ocn_htmlseg - "#{@env.path.dal}/#{@fns}.map_ocn_htmlseg.rbm" + "#{@env.processing_path.dal}/#{@fns}.map_ocn_htmlseg.rbm" end def html_tune - "#{@env.path.tune}/#{@fns}.marshal_tune" + "#{@env.processing_path.tune}/#{@fns}.marshal_tune" end self end def write_file_processing def html_tune - File.new("#{@env.path.tune}/#{@fns}.tune",'w+') + File.new("#{@env.processing_path.tune}/#{@fns}.tune",'w+') end self end @@ -2952,10 +2951,10 @@ WOK def mkdir #check moved from SiSU_file, existing mkdir def processing def dal - mkdir_p(@env.path.dal) unless FileTest.directory?(@env.path.dal) + mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal) end def tune - mkdir_p(@env.path.tune) unless FileTest.directory?(@env.path.tune) + mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune) end self end @@ -2990,8 +2989,8 @@ WOK mkdir_p(output_path.base) unless FileTest.directory?(output_path.base) mkdir_p("#{output_path.base}/#{@md.fnb}") unless FileTest.directory?("#{output_path.base}/#{@md.fnb}") mkdir_p("#{output_path.base}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base}/#{@env.path.style}") - mkdir_p(@env.path.dal) unless FileTest.directory?(@env.path.dal) - mkdir_p(@env.path.tune) unless FileTest.directory?(@env.path.tune) + mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal) + mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune) end def mkdir txt_path="#{output_path.base}/#{@md.fnb}" @@ -3409,13 +3408,13 @@ WOK end def po_git ft=Gt[:po] - pth=@env.path.processing_path_git + '/' + @md.fnb + '/' + ft + '/' + lang_part + pth=@env.processing_path.git + '/' + @md.fnb + '/' + ft + '/' + lang_part mkdir_p(pth) unless FileTest.directory?(pth) pth end def pot_git ft=Gt[:pot] - @env.path.processing_path_git + '/' + @md.fnb + '/' + ft + @env.processing_path.git + '/' + @md.fnb + '/' + ft end def md_harvest "#{output_path.base}/sisu_site_metadata" @@ -3501,7 +3500,7 @@ WOK #@env.path.output end def mkdir_pdf - Dir.mkdir(@env.path.tex) unless FileTest.directory?(@env.path.tex) + Dir.mkdir(@env.processing_path.tex) unless FileTest.directory?(@env.processing_path.tex) end def file_generic(output_file='') filename="#{@env.path.output}/#{@fnb}/#{output_file}" @@ -3511,17 +3510,17 @@ WOK File.new('/tmp/errorlog.sisu','w+') end def file_txt - File.new("#{@env.path.dal}/#{@fns}.txt",'w+') + File.new("#{@env.processing_path.dal}/#{@fns}.txt",'w+') end def file_debug - File.new("#{@env.path.dal}/#{@fns}.debug.txt",'w+') + File.new("#{@env.processing_path.dal}/#{@fns}.debug.txt",'w+') end def metaverse def file_meta - File.new("#{@env.path.dal}/#{@fns}.meta",'w+') + File.new("#{@env.processing_path.dal}/#{@fns}.meta",'w+') end def file_meta_idx_html - File.new("#{@env.path.dal}/#{@fns}.idx.html",'w+') + File.new("#{@env.processing_path.dal}/#{@fns}.idx.html",'w+') end self end @@ -3529,7 +3528,7 @@ WOK File.new("#{Dir.pwd}/#{@fns}.fn",'w+') end def meta - "#{@env.path.dal}/#{@fns}.meta" + "#{@env.processing_path.dal}/#{@fns}.meta" end def file_semantic filename_semantic="./semantic.yaml" @@ -3540,7 +3539,7 @@ WOK @@filename_rss=File.new(filename_rss,'w+') end def epub - @pth=@env.path.epub + @pth=@env.processing_path.epub def xhtml_index filename_index="#{@pth}/OPS/index.xhtml" File.new(filename_index,'w+') @@ -3567,7 +3566,7 @@ WOK self end def file_texinfo - File.new("#{@env.path.texinfo}/#{@fnb}.texinfo",'w+') + File.new("#{@env.processing_path.texinfo}/#{@fnb}.texinfo",'w+') end end class Clear