From 22f6ac004b2b86d8554ddbc5650aa3f11d348d90 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 5 Sep 2011 11:04:42 -0400 Subject: v3: sisupod_v3 make (build); place (rsync); process (generate sisu output from) * sisupod v3 * modify pod dir structure, place sisu source in dir/[lang_code]/ e.g. dir/en/ * use tar.xz (.txz) * bundle all language version in pod * bundle .ssm and all included files for each selected language (rather than composited .ssm.sst file) (filename pattern) or named in files to be processed string * remote placement * sisu processing from sisupod v3 * rsync sisupod v3 * sysenv, check that tree is available and use as desired when available --- lib/sisu/v3/hub.rb | 52 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 16 deletions(-) (limited to 'lib/sisu/v3/hub.rb') diff --git a/lib/sisu/v3/hub.rb b/lib/sisu/v3/hub.rb index 5e288b96..029c2861 100644 --- a/lib/sisu/v3/hub.rb +++ b/lib/sisu/v3/hub.rb @@ -70,16 +70,27 @@ module SiSU end def pod_output(fns_pod) dir_pwd=@@env.path.pwd - dir_pod=@@env.sisupod_gen(fns_pod) - Dir.chdir(dir_pod) - content=Dir.glob("*.ss[mt]").join(' ') - if content =~/\.ss[mt]/ - Dir.chdir(dir_pwd) - @opt.fns=content #check - system("cd #{dir_pod} - sisu -CC #{@opt.cmd} #{@opt.mod.join(' ')} #{content} - cd - + dir_pod=@@env.sisupod_gen_v3(fns_pod) + Dir.chdir("#{dir_pod}/doc") + #system("ls") + files=Dir['*/*.ss[tm]'] + files_ssm=Dir['*/*.ssm'] + files_sst=Dir['*/*.sst'] + content=if files_ssm.length > 0 + files_ssm.join(' ') + elsif files_sst.length > 0 + files_sst.join(' ') + else + p 'no files found' + end + @opt.fns=content #check + if FileTest.directory?("#{dir_pod}/doc") + Dir.chdir("#{dir_pod}/doc") + system(" + sisu3 -CC #{@opt.cmd} #{@opt.mod.join(' ')} #{content} + #sisu3 -CC #{@opt.cmd} -G #{@opt.mod.join(' ')} #{content} ") + Dir.chdir(dir_pwd) end @pwd=`pwd`.strip Dir.chdir(@pwd) @@ -92,10 +103,15 @@ module SiSU if not @opt.files.empty? @opt.files.each_with_index do |fns,i| env=SiSU_Env::Info_env.new(fns) - if fns =~ /sisupod(?:\.zip)?|\S+?(?:\.ss[mt]\.zip|\.ssp)$/ + if fns =~ /sisupod(?:\.txz)?|\S+?(?:\.ss[mt]\.txz|\.ssp)$/ # env=SiSU_Env::Info_env.new(fns) require_relative 'remote' # remote.rb #check - pod_name=SiSU_Remote::Remote_download.new(fns).pod.name + pod_name=if fns =~ /http:\/\/\S+?(?:\.ss[mt]\.txz|\.ssp)$/ + SiSU_Remote::Remote_download.new(fns).pod.name + else + re_p=/(\S+?\.ss[mt](?:\.txz)?)$/ + re_p.match(fns).captures.join + end SiSU_Screen::Ansi.new(@opt.cmd,pod_name).puts_blue unless @opt.cmd =~/q/ @opt.files.shift pod_output(pod_name) @@ -317,7 +333,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ path[:xsd]=path[:xml] + '/xsd' path[:xsd]=path[:xml] + '/rnc' path[:xsd]=path[:xml] + '/rng' - re_p=/(sisupod(?:\.zip)?|\S+?\.ss[mt]\.zip|[^\/]+?\.ssp)$/ + re_p=/(sisupod(?:\.txz)?|\S+?\.ss[mt]\.txz|[^\/]+?\.ssp)$/ unless @opt.files.join(',') =~ re_p #do not mix pods with source markup files in command line unless ( FileTest.directory?(path[:css]) \ and FileTest.directory?(path[:xsd]) ) @@ -361,9 +377,10 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ begin path_image='./_sisu/processing/external_document/image' path_skin='./_sisu/processing/external_document/skin/doc' - @get_s,@get_p=[],[] + @get_s,@get_p,@get_pl=[],[],[] re_s=/((?:https?|file):\/\/\S+?\.sst)$/ - re_p=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.zip|sisupod(?:\.zip)?|\.ssp))/ + re_p=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.txz|sisupod(?:\.txz)?|\.ssp))/ + re_pl=/^(\/\S+?\.ss[mt]\.txz)/ @opt.files.each do |fns| if fns =~re_s @get_s << re_s.match(fns)[1] if re_s @@ -371,6 +388,9 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if fns =~re_p @get_p << re_p.match(fns)[1] if re_p end + if fns =~re_pl + @get_pl << re_pl.match(fns)[1] if re_p + end end if @get_s.length > 0 #% remote markup file .sst require_relative 'remote' # remote.rb @@ -394,7 +414,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ end @opt.files=@opt.files.collect {|x| x=x.gsub(/\.ssm$/,'.ssm.sst') } if @opt.act[:sisupod] #% --sisupod, -S make sisupod - op('sisupod_make','sisupod (zip)') + op('sisupod_make','sisupod (txz)') if @opt.fns=~/\.kdi._sst/ op('share_src_kdissert','kdissert (kdi)') #% -S share kdissert source end @@ -535,7 +555,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ @opt.files.each do |fns| if FileTest.file?(fns) @opt.fns=fns - unless @opt.fns =~ /(?:\.(?:(?:-|ssm\.)?sst|ssm|ssp|sx[sdn]\.xml|termsheet.rb)|\S+?\.ss[mt]\.zip|sisupod(?:\.zip)?|\S+?\.ssp)$/ + unless @opt.fns =~ /(?:\.(?:(?:-|ssm\.)?sst|ssm|ssp|sx[sdn]\.xml|termsheet.rb)|\S+?\.ss[mt]\.txz|sisupod(?:\.txz)?|\S+?\.ssp)$/ if @opt.cmd.inspect=~/-P/ elsif @opt.fns=~/\.kdi$/ \ and @opt.mod.inspect =~/--(?:convert(?:-from)?|from)[=-]kdi/ -- cgit v1.2.3