diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-07-15 19:03:56 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-07-15 19:03:56 -0400 |
commit | d325316ca6328472bd462cfc49e33e3ae207a512 (patch) | |
tree | 6fac2c53e85a00ce88d79be9baa0f2c85ae40236 /lib/sisu/v6/sysenv.rb | |
parent | debian/changelog (5.5.0-1) (diff) | |
parent | v5 v6: document images (more to clean up) (diff) |
Merge tag 'sisu_5.5.1' into debian/sid
SiSU 5.5.1
Diffstat (limited to 'lib/sisu/v6/sysenv.rb')
-rw-r--r-- | lib/sisu/v6/sysenv.rb | 226 |
1 files changed, 128 insertions, 98 deletions
diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb index 3c774c46..72aaf2b9 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/sysenv.rb @@ -116,13 +116,13 @@ module SiSU_Env share=Config::CONFIG['datadir'] + '/sisu' data=Config::CONFIG['datadir'] + '/doc/sisu' m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m - @stub_pwd ||=@@pwd[m,1] + @base_markup_dir_stub=SiSU_Utils::Path.new.base_markup_stub prcss_dir='_sisu_processing_' + '.' + SiSU_is[:version_dir] prcss_dir_tmp_root="/tmp/#{prcss_dir}" - prcss_dir_stub="#{prcss_dir}/#{@stub_pwd}" + prcss_dir_stub="#{prcss_dir}/#{@base_markup_dir_stub}" if @@user - tmp_processing="#{prcss_dir_tmp_root}/#{@@user}/#{@stub_pwd}" - tmp_processing_individual="#{prcss_dir_tmp_root}/#{@@user}/#{@stub_pwd}" + tmp_processing="#{prcss_dir_tmp_root}/#{@@user}/#{@base_markup_dir_stub}" + tmp_processing_individual="#{prcss_dir_tmp_root}/#{@@user}/#{@base_markup_dir_stub}" else #error tmp_processing=tmp_processing_individual="/tmp/#{prcss_dir_stub}" end @@ -1096,7 +1096,7 @@ module SiSU_Env rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pathname or fileutils NOT FOUND (LoadError)') end - attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir + attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:base_markup_dir_stub,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir @@image_flag,@@local_image=true,true #warning on @@image_flag @@fb,@@man_path=nil,nil def initialize(fns='',md=nil) @@ -1121,11 +1121,10 @@ module SiSU_Env @fnb ||=@@fb #clean up this... used primarily for zap which is not passed normal parameters @fixed_websev_root='' # @home @pwd=@@pwd=Dir.pwd - m=/.+\/(?:src\/)?(\S+)/m # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m - @stub_pwd=@@pwd[m,1] || '' #; p __LINE__; #p @pwd; #p m; #p @stub_pwd - @stub_src= @stub_pwd + '/src' - @stub_pod= @stub_pwd + '/pod' - @stub_epub= @stub_pwd + '/epub' + @base_markup_dir_stub=SiSU_Utils::Path.new.base_markup_stub + @stub_src= @base_markup_dir_stub + '/src' + @stub_pod= @base_markup_dir_stub + '/pod' + @stub_epub= @base_markup_dir_stub + '/epub' pt=Pathname.new(Dir.pwd) stub=if output_dir_structure.by_language_code? r=Px[:lng_lst_rgx] @@ -1206,8 +1205,8 @@ module SiSU_Env @@current_document||=Dir.pwd @@current_document end - def stub_pwd #200412 - @stub_pwd + def base_markup_dir_stub #200412 + @base_markup_dir_stub end def stub_md_harvest #watch @stub_set_manifest @@ -2062,8 +2061,8 @@ WOK def pwd @sys.pwd end - def stub_pwd - @stub_pwd + def base_markup_dir_stub + @base_markup_dir_stub end def stub_epub @stub_epub @@ -2149,10 +2148,11 @@ WOK end def webserv_stub_ensure FileUtils::mkdir_p(path.webserv) unless FileTest.directory?(path.webserv) - FileUtils::mkdir_p("#{path.webserv}/#{@stub_pwd}") unless FileTest.directory?("#{path.webserv}/#{@stub_pwd}") + FileUtils::mkdir_p("#{path.webserv}/#{@base_markup_dir_stub}") \ + unless FileTest.directory?("#{path.webserv}/#{@base_markup_dir_stub}") end def webserv_map_pwd #dir - "#{path.webserv}/#{stub_pwd}" + "#{path.webserv}/#{base_markup_dir_stub}" end def webserv_dir #fixed/hard path to /www web/presentation directory, on Debian /var/www subdirectories are created within it, depending on markup directory stub-name (last segment of markup directory name) defaults[:webserv_dir] @@ -2288,13 +2288,13 @@ WOK end def stub_dir (usr_dir?) \ - ? ("#{root_dir}/#{user}/#{stub_pwd}") - : ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path] + ? ("#{root_dir}/#{user}/#{base_markup_dir_stub}") + : ("#{root_dir}/#{base_markup_dir_stub}") # see defaults[:processing_path] end def stub_dir_orig # ends up with lang, if lang dir (usr_dir?) \ - ? ("#{root_dir}/#{user}/#{stub_pwd}") - : ("#{root_dir}/#{stub_pwd}") # see defaults[:processing_path] + ? ("#{root_dir}/#{user}/#{base_markup_dir_stub}") + : ("#{root_dir}/#{base_markup_dir_stub}") # see defaults[:processing_path] end def processing_sisupod(opt=nil) #processing directory, used/needed for sisu work files, has sub-directories (ao,tex etc) @opt=opt @@ -2504,21 +2504,21 @@ WOK "http://#{@sys.hostname}" end def dir_url - "file://#{path.webserv}/#{stub_pwd}" + "file://#{path.webserv}/#{base_markup_dir_stub}" end def localhost - "http://localhost/#{stub_pwd}" + "http://localhost/#{base_markup_dir_stub}" end def local - "http://#{hostname}/#{@stub_pwd}" + "http://#{hostname}/#{@base_markup_dir_stub}" end def root if defined? @rc['webserv']['url_root'] \ and @rc['webserv']['url_root'] =~/https?:\/\// - "#{@rc['webserv']['url_root']}/#{@stub_pwd}" + "#{@rc['webserv']['url_root']}/#{@base_markup_dir_stub}" elsif defined? @rc['webserv']['url_root'] \ and @rc['webserv']['url_root'] =~/localhost/ - "http://localhost/#{@stub_pwd}" + "http://localhost/#{@base_markup_dir_stub}" else "file://#{path.output}" end end @@ -2567,14 +2567,14 @@ WOK and @rc['webserv_cgi']['host'].is_a?(String) http=((@rc['webserv_cgi']['host'] =~ /https?:\/\//) ? '' : 'http://') #check https? missing if port.webserv_port_cgi - "#{http}#{@rc['webserv_cgi']['host']}:#{port.webserv_port_cgi}/#{@stub_pwd}" - else "#{http}#{@rc['webserv_cgi']['host']}/#{@stub_pwd}" + "#{http}#{@rc['webserv_cgi']['host']}:#{port.webserv_port_cgi}/#{@base_markup_dir_stub}" + else "#{http}#{@rc['webserv_cgi']['host']}/#{@base_markup_dir_stub}" end else http=((webserv_host_base=~/https?:\/\//) ? '' : 'http://') if port.webserv_port_cgi(opt) - "#{http}#{webserv_host_base}:#{port.webserv_port_cgi(opt)}/#{@stub_pwd}" - else "#{http}#{webserv_host_base}/#{@stub_pwd}" + "#{http}#{webserv_host_base}:#{port.webserv_port_cgi(opt)}/#{@base_markup_dir_stub}" + else "#{http}#{webserv_host_base}/#{@base_markup_dir_stub}" end end http=http.strip @@ -2622,7 +2622,7 @@ WOK @rc['webserv']['url_root'] elsif path.webserv_dir \ and path.webserv =~ /#{path.webserv_dir}/ #revisit - "#{path.webserv}/#{@stub_pwd}".gsub(/#{path.webserv_dir}/,"#{url.hostname}/#{@stub_pwd}") + "#{path.webserv}/#{@base_markup_dir_stub}".gsub(/#{path.webserv_dir}/,"#{url.hostname}/#{@base_markup_dir_stub}") elsif defined? @rc['webserv']['webrick_url'] \ and @rc['webserv']['webrick_url']==false "file://#{path.webserv}" @@ -2635,7 +2635,7 @@ WOK def webserv_base #web url for local webserv (localhost, or hostname) if path.webserv_dir \ and path.webserv =~ /#{path.webserv_dir}/ #revisit - "#{path.webserv}/#{@stub_pwd}".gsub(/#{path.webserv_dir}/,"#{url.hostname}") + "#{path.webserv}/#{@base_markup_dir_stub}".gsub(/#{path.webserv_dir}/,"#{url.hostname}") elsif defined? @rc['webserv']['webrick_url'] \ and @rc['webserv']['webrick_url']==false "file://#{path.webserv}" @@ -2696,8 +2696,8 @@ WOK when /^filesystem(?:_url)?/ then url.dir_url when /^remote(?:_webserv)?/ then url.remote when /^(?:webserv|local_webserv)/ then url.local - when /^local(:\d+)/ then url.hostname + $1 + '/' + stub_pwd - when /^localhost(:\d+)/ then url.localhost + $1 + '/' + stub_pwd + when /^local(:\d+)/ then url.hostname + $1 + '/' + base_markup_dir_stub + when /^localhost(:\d+)/ then url.localhost + $1 + '/' + base_markup_dir_stub when /^localhost/ then url.localhost when /^webrick/ then url.webrick when /^path/ then url.webserv_map_pwd @@ -2716,7 +2716,11 @@ WOK else if @@local_image==true cmd=@cmd ? @cmd : '' - SiSU_Screen::Ansi.new(cmd,"WARNING - no local image directory or images:", defaults[:image_local] ).warn unless cmd =~/q/ + SiSU_Screen::Ansi.new( + cmd, + "WARNING - no local image directory or images:", + defaults[:image_local] + ).warn unless cmd =~/q/ @@local_image=false end url.images @@ -2726,15 +2730,21 @@ WOK if FileTest.directory?(image_external) if @@image_flag images=Dir.glob("#{image_external}/*.{png,jpg,gif}") - pth="#{path.webserv}/#{@stub_pwd}" - FileUtils::mkdir_p("#{pth}/_sisu/image_external") unless FileTest.directory?("#{pth}/_sisu/image_external") - images.each { |i| File.install(i,"#{pth}/#{i}") } unless images.length > 0 + pth="#{path.webserv}/#{@base_markup_dir_stub}" + FileUtils::mkdir_p("#{pth}/_sisu/image_external") \ + unless FileTest.directory?("#{pth}/_sisu/image_external") + images.each { |i| File.install(i,"#{pth}/#{i}") } \ + unless images.length > 0 @@image_flag=false end "#{Xx[:html_relative2]}/_sisu/image_external" else if @@local_image==true - SiSU_Screen::Ansi.new(@cmd,"WARNING - image directory for external images or no such images:", :image_external ).warn unless @cmd =~/q/ + SiSU_Screen::Ansi.new( + @cmd, + "WARNING - image directory for external images or no such images:", + :image_external + ).warn unless @cmd =~/q/ @@local_image=false end url.images_external @@ -3497,9 +3507,9 @@ WOK self.remote_host_base.each do |remote_conn| local_gen=@source_path remote_gen=case @opt.cmd - when /u/ then "#{remote_conn[:name]}/#{@env.path.stub_pwd}/." #creates remote directory tree, this is not the usual function of u - when /[abhHNopwxXy]/ then "#{remote_conn[:name]}/#{@env.path.stub_pwd}/#{@fnb}/." - else "#{remote_conn[:name]}/#{@env.path.stub_pwd}/." + when /u/ then "#{remote_conn[:name]}/#{@env.path.base_markup_dir_stub}/." #creates remote directory tree, this is not the usual function of u + when /[abhHNopwxXy]/ then "#{remote_conn[:name]}/#{@env.path.base_markup_dir_stub}/#{@fnb}/." + else "#{remote_conn[:name]}/#{@env.path.base_markup_dir_stub}/." end local_epub=@source_path_epub local_src=@source_path_src @@ -3544,7 +3554,7 @@ WOK def site_base #base site self.remote_host_base.each do |remote_conn| local=@source_path - remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." + remote="#{remote_conn[:name]}/#{@env.path.base_markup_dir_stub}/." if defined? @rc['permission_set']['remote_base_site'] \ and @rc['permission_set']['remote_base_site'] \ and @@flag_remote==true \ @@ -3562,7 +3572,7 @@ WOK def site_base_all #base site self.remote_host_base.each do |remote_conn| local=@source_path - remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." + remote="#{remote_conn[:name]}/#{@env.path.base_markup_dir_stub}/." if defined? @rc['permission_set']['remote_base_site'] \ and @rc['permission_set']['remote_base_site'] \ and @@flag_remote==true \ @@ -3591,9 +3601,9 @@ WOK if f self.remote_host_base.each do |remote_conn| local_gen=@source_path - #local_gen_image="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image" - #local_gen_image_external="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external" - remote_gen="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." + #local_gen_image="#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}/_sisu/image" + #local_gen_image_external="#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}/_sisu/image_external" + remote_gen="#{remote_conn[:name]}/#{@env.path.base_markup_dir_stub}/." remote_rel=remote_conn[:name] + '/' + f.output_path.stub.rcp @opt.fnc if (local_gen =~/\S/ \ @@ -3748,7 +3758,7 @@ WOK def site_harvest self.remote_host_base.each do |remote_conn| local=@source_path_harvest - l_rel="#{@env.path.webserv}/#{@env.path.stub_pwd}" + l_rel="#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}" lng='en' if @env.output_dir_structure.by? == :language ldest="#{lng}/manifest" @@ -3774,10 +3784,10 @@ WOK end def site_base #base site ldest='_sisu/*' - l_rel="#{@env.path.webserv}/#{@env.path.stub_pwd}" + l_rel="#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}" image_sys="#{@env.path.webserv}/_sisu/image_sys" self.remote_host_base.each do |remote_conn| - remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}" + remote="#{remote_conn[:name]}/#{@env.path.base_markup_dir_stub}" remote_conf="#{remote_conn[:name]}/_sisu" SiSU_Env::SystemCall.new(image_sys,remote_conf).rsync SiSU_Env::SystemCall.new(ldest,remote).rsync('--relative',l_rel) @@ -3786,7 +3796,7 @@ WOK def site_base_sync self.remote_host_base.each do |remote_conn| local=@source_path - remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." + remote="#{remote_conn[:name]}/#{@env.path.base_markup_dir_stub}/." if defined? @rc['permission_set']['remote_base_site'] \ and @rc['permission_set']['remote_base_site'] \ and @@flag_remote==true \ @@ -3811,7 +3821,7 @@ WOK def rsync_sitemaps #sitemap directory self.remote_host_base.each do |remote_conn| local="#{@source_path}/sitemapindex.xml" - remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/." + remote="#{remote_conn[:name]}/#{@env.path.base_markup_dir_stub}/." if @@flag_remote delete_extra_files='--delete' # '--delete-after' SiSU_Env::SystemCall.new(local,remote).rsync(delete_extra_files) @@ -6315,7 +6325,7 @@ WOK end def xml_docbook def ft - 'docbook' + DEVELOPER[:under_construction] + 'docbook' end def dir set_path(ft).dir.abc @@ -6363,7 +6373,7 @@ WOK end def xml_docbook_book def ft - 'docbook' + DEVELOPER[:under_construction] + 'docbook' end def dir set_path(ft).dir.abc @@ -6912,7 +6922,7 @@ WOK def xml_dom 'dom.css' end - def docbook_xml + def xml_docbook 'docbook.css' end def homepage @@ -6931,8 +6941,8 @@ WOK if @md.doc_css \ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_html.css") "#{@md.doc_css}_html.css" - elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_html.css") - "#{@env.path.stub_pwd}_html.css" + elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.base_markup_dir_stub}_html.css") + "#{@env.path.base_markup_dir_stub}_html.css" else SiSU_Env::CSS_Default.new.html end @@ -6941,8 +6951,8 @@ WOK if @md.doc_css \ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_html_tables.css") "#{@md.doc_css}_html_tables.css" - elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_html_tables.css") - "#{@env.path.stub_pwd}_html_tables.css" + elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.base_markup_dir_stub}_html_tables.css") + "#{@env.path.base_markup_dir_stub}_html_tables.css" else SiSU_Env::CSS_Default.new.html_tables end end @@ -6950,8 +6960,8 @@ WOK if @md.doc_css \ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xhtml.css") "#{@md.doc_css}_xhtml.css" - elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_xhtml.css") - "#{@env.path.stub_pwd}_xhtml.css" + elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.base_markup_dir_stub}_xhtml.css") + "#{@env.path.base_markup_dir_stub}_xhtml.css" else SiSU_Env::CSS_Default.new.xhtml end end @@ -6959,8 +6969,8 @@ WOK if @md.doc_css \ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xml_sax.css") "#{@md.doc_css}_xml_sax.css" - elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_xml_sax.css") - "#{@env.path.stub_pwd}_xml_sax.css" + elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.base_markup_dir_stub}_xml_sax.css") + "#{@env.path.base_markup_dir_stub}_xml_sax.css" else SiSU_Env::CSS_Default.new.xml_sax end end @@ -6968,26 +6978,26 @@ WOK if @md.doc_css \ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xml_dom.css") "#{@md.doc_css}_xml_dom.css" - elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_xml_dom.css") - "#{@env.path.stub_pwd}_xml_dom.css" + elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.base_markup_dir_stub}_xml_dom.css") + "#{@env.path.base_markup_dir_stub}_xml_dom.css" else SiSU_Env::CSS_Default.new.xml_dom end end - def docbook_xml + def xml_docbook if @md.doc_css \ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_docbook.css") "#{@md.doc_css}_xml_dom.css" - elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_docbook.css") - "#{@env.path.stub_pwd}_docbook.css" - else SiSU_Env::CSS_Default.new.docbook_xml + elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.base_markup_dir_stub}_docbook.css") + "#{@env.path.base_markup_dir_stub}_docbook.css" + else SiSU_Env::CSS_Default.new.xml_docbook end end def homepage if @md.doc_css \ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_homepage.css") "#{@md.doc_css}_homepage.css" - elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_homepage.css") - "#{@env.path.stub_pwd}_homepage.css" + elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.base_markup_dir_stub}_homepage.css") + "#{@env.path.base_markup_dir_stub}_homepage.css" else SiSU_Env::CSS_Default.new.homepage end end @@ -7029,12 +7039,16 @@ WOK stylesheet="#{@file.path_rel_links.xml_css}#{@env.path.style}/#{@css.xml_dom}" %{<?xml-stylesheet type="text/css" href="#{stylesheet}"?>} end + def xml_docbook + stylesheet="#{@file.path_rel_links.xml_css}#{@env.path.style}/#{@css.xml_docbook}" + %{<?xml-stylesheet type="text/css" href="#{stylesheet}"?>} + end end class CreateSite < InfoEnv require_relative 'css' # css.rb include SiSU_Style - def initialize(cmd) - @cmd=cmd + def initialize(opt) + @opt=opt @env=SiSU_Env::InfoEnv.new @init=SiSU_Env::GetInit.new @home,@pwd=ENV['HOME'],ENV['PWD'] #@pwd=Dir.pwd @@ -7047,8 +7061,8 @@ WOK puts %{ place your homepages in directory:\n "#{@env.path.rc}/home/*.html"\n (no action taken)} else puts %{ place your homepages in directory:\n "#{@env.path.rc}/home/*.html"\n (in order to replace default sisu homepage)} - filename_homepage="#{@env.path.webserv}/#{@env.path.stub_pwd}/index.html" - filename_home_toc="#{@env.path.webserv}/#{@env.path.stub_pwd}/toc.html" + filename_homepage="#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}/index.html" + filename_home_toc="#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}/toc.html" file_homepage=File.new(filename_homepage,'w') file_home_toc=File.new(filename_home_toc,'w') file_homepage << @vz_home.homepage @@ -7059,10 +7073,10 @@ WOK end def homepage home_pages_manually_created=Dir.glob("#{@env.path.rc}/home/*.html") - FileUtils::mkdir_p("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}") + FileUtils::mkdir_p("#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}") if home_pages_manually_created.length > 0 home_pages_manually_created.each do |homepage| - FileUtils.cp(homepage,"#{@env.path.webserv}/#{@env.path.stub_pwd}") + FileUtils.cp(homepage,"#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}") end else create_default_sisu_homepage(:none) @@ -7088,12 +7102,12 @@ WOK end def cp_local_images src="#{@pwd}/_sisu/image" - dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image" + dest="#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}/_sisu/image" cp_images(src,dest) if FileTest.directory?(src) end def cp_external_images src="#{@env.processing_path.processing}/external_document/image" - dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external" + dest="#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}/_sisu/image_external" if FileTest.directory?(src) cp_images(src,dest) if FileTest.directory?(src) end @@ -7102,7 +7116,7 @@ WOK src=@env.path.image_source dest_arr=[ "#{@env.path.webserv}/_sisu/image", - "#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image" + "#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}/_sisu/image" ] dest_arr.each do |dest| cp_images(src,dest) if FileTest.directory?(src) @@ -7110,25 +7124,30 @@ WOK end def cp_webserver_images_local #this should not have been necessary src=@env.path.image_source - dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image" + dest="#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}/_sisu/image" cp_images(src,dest) if FileTest.directory?(src) end def cp_base_images #fix images src=SiSU_is[:path_base_system_data] + '/image' dest_arr=[ "#{@env.path.webserv}/_sisu/image_sys", - "#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_sys" + "#{@env.path.webserv}/#{@env.path.base_markup_dir_stub}/_sisu/image_sys" ] dest_arr.each do |dest| cp_images(src,dest) if FileTest.directory?(src) end end def cp_css - FileUtils::mkdir_p("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}") - css_path=['/etc/sisu/css',"#{@home}/.sisu/css","#{@pwd}/_sisu/css"] #BROKEN + FileUtils::mkdir_p("#{@env.path.output}/#{@env.path.style}") \ + unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}") + css_path=[ + '/etc/sisu/css', + "#{@home}/.sisu/css", + "#{@pwd}/_sisu/css", + ] #BROKEN if defined? @rc['permission_set']['css_modify'] \ and @rc['permission_set']['css_modify'] - SiSU_Screen::Ansi.new(@cmd,"*WARN* modify is css set to: #{@rc['permission_set']['css_modify']}").warn if @cmd=~/[MV]/ + SiSU_Screen::Ansi.new(@opt.cmd,"*WARN* modify is css set to: #{@rc['permission_set']['css_modify']}").warn if @opt.cmd=~/[MV]/ css_path.each do |x| if FileTest.directory?(x) FileUtils::cd(x) @@ -7142,53 +7161,64 @@ WOK FileUtils::cd(@pwd) end end - else SiSU_Screen::Ansi.new(@cmd,"*WARN* modify css is not set or is set to: false").warn if @cmd=~/[MV]/ + else + SiSU_Screen::Ansi.new( + @opt.cmd, + "*WARN* modify css is not set or is set to: false" + ).warn if @opt.cmd=~/[MV]/ end fn_css=SiSU_Env::CSS_Default.new css=SiSU_Style::CSS.new path_style="#{@env.path.output}/#{@env.path.style}" FileUtils::mkdir_p(path_style) unless FileTest.directory?(path_style) - if @cmd =~/C/ \ + if @opt.cmd =~/C/ \ or not FileTest.file?("#{path_style}/#{fn_css.homepage}") style=File.new("#{path_style}/#{fn_css.homepage}",'w') style << css.homepage style.close end - if @cmd =~/C/ \ + if @opt.cmd =~/C/ \ or not FileTest.file?("#{path_style}/#{fn_css.html_tables}") style=File.new("#{path_style}/#{fn_css.html_tables}",'w') style << css.html_tables style.close end - if @cmd =~/C/ \ + if @opt.cmd =~/C/ \ or not FileTest.file?("#{path_style}/#{fn_css.html}") style=File.new("#{path_style}/#{fn_css.html}",'w') style << css.html style.close end - if @cmd =~/C/ \ + if @opt.cmd =~/C/ \ or not FileTest.file?("#{path_style}/#{fn_css.harvest}") style=File.new("#{path_style}/#{fn_css.harvest}",'w') style << css.harvest style.close end - if @cmd =~/C/ \ - or (@cmd =~/[x]/ \ - and not FileTest.file?("#{path_style}/#{fn_css.xml_sax}")) + if @opt.cmd =~/C/ \ + or (@opt.cmd =~/[x]/ \ + and not FileTest.file?("#{path_style}/#{fn_css.xml_sax}")) style=File.new("#{path_style}/#{fn_css.xml_sax}",'w') style << css.xml_sax style.close end - if @cmd =~/C/ \ - or (@cmd =~/[X]/ \ - and not FileTest.file?("#{path_style}/#{fn_css.xml_dom}")) + if @opt.cmd =~/C/ \ + or (@opt.cmd =~/[X]/ \ + and not FileTest.file?("#{path_style}/#{fn_css.xml_dom}")) style=File.new("#{path_style}/#{fn_css.xml_dom}",'w') style << css.xml_dom style.close end - if @cmd =~/C/ \ - or (@cmd =~/[b]/ \ - and not FileTest.file?("#{path_style}/#{fn_css.xhtml}")) + if @opt.cmd =~/C/ \ + or (@opt.act[:xml_docbook_book][:set] == :on \ + and not FileTest.file?("#{path_style}/#{fn_css.xml_docbook}")) + style=File.new("#{path_style}/#{fn_css.xml_docbook}",'w') + style << css.xml_docbook + style.close + end + if @opt.cmd =~/C/ \ + or (@opt.cmd =~/[b]/ \ + and not FileTest.file?("#{path_style}/#{fn_css.xhtml}")) style=File.new("#{path_style}/#{fn_css.xhtml}",'w') style << css.xhtml style.close |