diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-03-02 22:54:28 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-03-02 22:54:28 -0500 |
commit | 0569fd776ab4ce33689ca3337acd62f2415b6348 (patch) | |
tree | 4644037b28d876d8637a610f5df1a29535a4ef9a /lib/sisu/v3/sysenv.rb | |
parent | debian/changelog (3.0.1-1) (diff) | |
parent | CHANGELOG_v{1,2,3}, syslink, avoid duplication (diff) |
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r-- | lib/sisu/v3/sysenv.rb | 419 |
1 files changed, 209 insertions, 210 deletions
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index a7105d69..d4d0f16d 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -1,4 +1,4 @@ -# coding: utf-8 +# encoding: utf-8 =begin * Name: SiSU @@ -59,7 +59,7 @@ @@cX=nil @@current_document=Dir.pwd #nil #'' module SiSU_Env - require "#{SiSU_lib}/constants" # constants.rb + require_relative 'constants' # constants.rb require 'fileutils' include FileUtils::Verbose require 'singleton' @@ -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', @@ -269,7 +269,7 @@ module SiSU_Env include Singleton @@noyaml=false @@rc,@@sisurc_path,@@vz,@@tx=nil,nil,nil,nil - @@ad={ :promo=>nil,:promo_list=>nil,:flag_promo=>false } + @@ad={ promo: nil, promo_list: nil, flag_promo: false } attr_accessor :yaml def initialize super() @@ -493,7 +493,7 @@ module SiSU_Env if FileTest.file?("#{@fn[:m]}.#{@fn[:t]}"); x << "#{@fn[:m]}.#{@fn[:t]}" end dir=SiSU_Env::Info_env.new(@fns) - @m << {:m => 'sisu_manifest.html', :l => 'English' } #fix later, default language + @m << { m: 'sisu_manifest.html', l: 'English' } #fix later, default language langs.each do |l| lng=SiSU_Env::Standardise_language.new(l) fns_c="#{@fn[:m]}~#{lng.code}.#{@fn[:t]}" @@ -502,12 +502,12 @@ module SiSU_Env fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(fns_c) lng=fn_set_lang[:l] fn=SiSU_Env::Env_call.new(fns_c).lang(fn_set_lang[:c]) - @m << {:m => fn[:manifest], :l => lng } + @m << { m: fn[:manifest], l: lng } elsif FileTest.file?(fns_l) fn_set_lang=SiSU_Env::Standardise_language.new.file_to_language(fns_l) @fnl=dir.i18n.lang_filename(fn_set_lang[:c]) fn=SiSU_Env::Env_call.new(fns_l).lang(fn_set_lang[:c]) - @m << {:m => fn[:manifest], :l => lng } + @m << { m: fn[:manifest], l: lng } end end @m.uniq! @@ -523,48 +523,48 @@ module SiSU_Env end def lang(code) @fn={ - :html => filename(code,'','.html'), - :book_index => filename(code,'book_index','.html'), - :concordance => filename(code,'concordance','.html'), - :sax => filename(code,'sax','.xml'), - :dom => filename(code,'dom','.xml'), - :docbook => filename(code,'docbook','.xml'), - :xhtml => filename(code,'scroll','.xhtml'), - :pdf_l => filename(code,'','.pdf'), - :pdf_p => filename(code,'','.pdf'), - :pdf_l_a4 => filename(code,"a4",'.pdf'), - :pdf_p_a4 => filename(code,"a4",'.pdf'), - :pdf_l_a5 => filename(code,"a5",'.pdf'), - :pdf_p_a5 => filename(code,"a5",'.pdf'), - :pdf_l_b5 => filename(code,"b5",'.pdf'), - :pdf_p_b5 => filename(code,"b5",'.pdf'), - :pdf_l_letter => filename(code,"letter",'.pdf'), - :pdf_p_letter => filename(code,"letter",'.pdf'), - :pdf_l_legal => filename(code,"legal",'.pdf'), - :pdf_p_legal => filename(code,"legal",'.pdf'), - :toc => filename(code,'toc','.html'), - :doc => filename(code,fnb,'.html'), - :index => filename(code,'index','.html'), - :po => filename(code,@fns,'.po'), - :pot => filename(code,@fns,'.pot'), - :odf => filename(code,'','.odt'), - :epub => filename(code,'','.epub'), - :plain => filename(code,'','.txt'), - :manpage => filename(code,'','.1'), #fix, section number - :wiki => filename(code,'wiki','.txt'), - :digest => filename(code,'digest','.txt'), - :metadata => filename(code,'metadata','.html'), #chk - :manifest => filename(code,'manifest','.html'), - :oai_pmh => filename(code,'oai_pmh','.xml'), - :sitemap => filename(code,'sitemap','.xml'), - :sitemap_touch => filename(code,"sitemap_#{fnb}",'.xml'), - :sxs => filename(code,fnb,'.sxs.xml'), - :sxd => filename(code,fnb,'.sxd.xml'), - :sxn => filename(code,fnb,'.sxn.xml'), - :sisupod => filename(nil,@fnz,''), - :book_idx_html => filename(code,'book_index','.html'), - :book_idx_epub => filename(code,'book_index','.xhtml'), - :epub_concord => filename(code,'concordance','.xhtml'), + html: filename(code,'','.html'), + book_index: filename(code,'book_index','.html'), + concordance: filename(code,'concordance','.html'), + sax: filename(code,'sax','.xml'), + dom: filename(code,'dom','.xml'), + docbook: filename(code,'docbook','.xml'), + xhtml: filename(code,'scroll','.xhtml'), + pdf_l: filename(code,'','.pdf'), + pdf_p: filename(code,'','.pdf'), + pdf_l_a4: filename(code,"a4",'.pdf'), + pdf_p_a4: filename(code,"a4",'.pdf'), + pdf_l_a5: filename(code,"a5",'.pdf'), + pdf_p_a5: filename(code,"a5",'.pdf'), + pdf_l_b5: filename(code,"b5",'.pdf'), + pdf_p_b5: filename(code,"b5",'.pdf'), + pdf_l_letter: filename(code,"letter",'.pdf'), + pdf_p_letter: filename(code,"letter",'.pdf'), + pdf_l_legal: filename(code,"legal",'.pdf'), + pdf_p_legal: filename(code,"legal",'.pdf'), + toc: filename(code,'toc','.html'), + doc: filename(code,fnb,'.html'), + index: filename(code,'index','.html'), + po: filename(code,@fns,'.po'), + pot: filename(code,@fns,'.pot'), + odf: filename(code,'','.odt'), + epub: filename(code,'','.epub'), + plain: filename(code,'','.txt'), + manpage: filename(code,'','.1'), #fix, section number + wiki: filename(code,'wiki','.txt'), + digest: filename(code,'digest','.txt'), + metadata: filename(code,'metadata','.html'), #chk + manifest: filename(code,'manifest','.html'), + oai_pmh: filename(code,'oai_pmh','.xml'), + sitemap: filename(code,'sitemap','.xml'), + sitemap_touch: filename(code,"sitemap_#{fnb}",'.xml'), + sxs: filename(code,fnb,'.sxs.xml'), + sxd: filename(code,fnb,'.sxd.xml'), + sxn: filename(code,fnb,'.sxn.xml'), + sisupod: filename(nil,@fnz,''), + book_idx_html: filename(code,'book_index','.html'), + book_idx_epub: filename(code,'book_index','.xhtml'), + epub_concord: filename(code,'concordance','.xhtml'), } @fn end @@ -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 @@ -1043,7 +1043,7 @@ module SiSU_Env @rc=SiSU_Env::Get_init.instance.sisu_yaml.rc @ad=SiSU_Env::Get_init.instance.ads @vz=SiSU_Env::Get_init.instance.skin - @flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false } + @flag={ ad: false, md: false, sk: false, rc: false } def promo? @flag[:ad]=if @md.flag_promo && @ad[:flag_promo] @flag[:md]=true @@ -1221,7 +1221,7 @@ WOK def widget_static @rc=SiSU_Env::Get_init.instance.sisu_yaml.rc @vz=SiSU_Env::Get_init.instance.skin - @flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false } + @flag={ ad: false, md: false, sk: false, rc: false } def search? flag=if defined? @rc['search'] \ and defined? @rc['search']['sisu'] \ @@ -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 <Info_env #todo unify with SiSU_file @@ -3736,8 +3735,8 @@ WOK def select # skin loading logic here load "#{SiSU_lib}/defaults.rb" skin_path=[] - @env.sys.rc_path.each{|x| skin_path << "#{x}/skin"} - skin_path << "#{@env.path.processing}/external_document/skin" + @env.sys.rc_path.each {|x| skin_path << "#{x}/skin"} + skin_path << "#{@env.processing_path.processing}/external_document/skin" skin=true if @pwd_stub =~/^sisupod$/ \ and @md.mod.inspect !~/--trust/ @@ -3900,7 +3899,7 @@ WOK end end class Create_site < Info_env - require "#{SiSU_lib}/css" # css.rb + require_relative 'css' # css.rb include SiSU_Style def initialize(cmd) @cmd=cmd @@ -3959,7 +3958,7 @@ WOK cp_images(src,dest) end def cp_external_images - src="#{@env.path.processing}/external_document/image" + src="#{@env.processing_path.processing}/external_document/image" dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external" cp_images(src,dest) end @@ -4026,10 +4025,10 @@ WOK end end module SiSU_Screen - require "#{SiSU_lib}/screen_text_color" # screen_text_color.rb + require_relative 'screen_text_color' # screen_text_color.rb end module SiSU_Errors - require "#{SiSU_lib}/errors" # errors.rb + require_relative 'errors' # errors.rb end __END__ https? intro check 2007-09-22 @@ -4041,7 +4040,7 @@ fns_array=unless fns =~/\.ssm.sst$/ end else if RUBY_VERSION < '1.9' - IO.readlines("#{path.composite_file}/#{fns}",'') - else IO.readlines("#{path.composite_file}/#{fns}",'r:utf-8') + IO.readlines("#{processing_path.composite_file}/#{fns}",'') + else IO.readlines("#{processing_path.composite_file}/#{fns}",'r:utf-8') end end |