diff options
Diffstat (limited to 'lib/sisu/v3/options.rb')
-rw-r--r-- | lib/sisu/v3/options.rb | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb index 44d4e40e..c7789f3a 100644 --- a/lib/sisu/v3/options.rb +++ b/lib/sisu/v3/options.rb @@ -196,6 +196,7 @@ module SiSU_Commandline def set_files_and_paths_and_general_extract(s) c,w='','' m,f,pth,z,lng,lngs=[],[],[],[],[],[] + lng_is='' a=s.split(/\s+/) r_l=Px[:lng_lst].join('|') a.uniq.each do |x| @@ -208,7 +209,43 @@ module SiSU_Commandline m << x end elsif x =~ /(?:\.(?:(?:-|ssm\.)?sst(?:\.xml)?|ssm|ssi|sx[sdn]\.xml|s[1-3]|kdi|ssp)|\S+?\.ss[mt]\.(?:txz|zip)|sisupod\.(?:txz|zip))$/ - if x =~/^(?:https?|file):\/\/\S+/ \ + if x =~/\S+?\.ss[mt]\.(?:txz|zip)|sisupod\.(?:txz|zip)/ + if x =~/^(?:https?|file):\/\/\S+/ #\ + end + pwd=Dir.pwd + fn_pod=x.gsub(/.+?([^\/]+)\.txz$/,'\1') + fullname=@env.processing_path.processing + '/sisupod/' + fn_pod + pt=Pathname.new(fullname) + FileUtils::mkdir_p(pt.to_s) + Dir.chdir(pt.realpath) + options=s.gsub(/(\s+--?\S+)+.+/,'\1') + system(" + chdir #{fullname} + tar xaf #{x} + chdir #{pwd} + ") + Dir.chdir(pt.realpath.to_s + '/sisupod/doc') + r=Px[:lng_lst].join('|') + Dir.entries("#{fullname}/sisupod/doc").each do |d_lng| + if d_lng =~/^(?:#{r})$/ + Dir.chdir(pt.realpath.to_s + "/sisupod/doc/#{d_lng}") + filenames=Dir.glob("*.ss[mt]") + filenames.each do |fn| + f_pths << { + pth: "#{fullname}/sisupod/doc/#{d_lng}", + f: "#{fn}", + pth_stub: 'doc', + lng: d_lng, + lng_is: d_lng, + url_base: '', + url: '' + } + Dir.chdir(pwd) + f << fn + end + end + end + elsif x =~/^(?:https?|file):\/\/\S+/ \ and x =~/\S+?\.ss[mt]$/ r_url=/(http:\/\/\S+?\/\S+?\/src(?:\/(?:#{r_l}))?)\// url_base = (x[r_url,1]) @@ -252,12 +289,7 @@ module SiSU_Commandline url: url } f << fn - elsif x =~/^(?:https?|file):\/\/\S+/ \ - and x =~/\S+?\.ss[mt]\.(?:txz|zip)|sisupod\.(?:txz|zip)/ - x=x.gsub(/^file:\/\//,'') - f << x elsif FileTest.file?(x) -### FIX pt=Pathname.new(x) pth << pt.split[0].realpath.to_s #remove? f << pt.split[1].to_s #remove? @@ -266,14 +298,7 @@ module SiSU_Commandline l_p = (pt.split[0].realpath.to_s[t,1]) \ ? pt.split[0].realpath.to_s[t,1] : nil - lng << l_p - lngs << if l_p - l_p - elsif x =~/~(#{r_l})\.ss[tm]/ - $1 - else lng_base - end - lng_is =if l_p + lngs << lng_is = if l_p l_p elsif x =~/~(#{r_l})\.ss[tm]/ $1 @@ -283,14 +308,11 @@ module SiSU_Commandline pth: pt.split[0].realpath.to_s, f: pt.split[1].to_s, pth_stub: pt.split[0].realpath.to_s[r_u,1], - lng: (pt.split[0].realpath.to_s[t,1]) \ - ? pt.split[0].realpath.to_s[t,1] - : nil, + lng: lng_is, lng_is: lng_is, url_base: nil, url: nil } -# Dir.chdir(pt.split[0].realpath) else puts "file not found: #{x}" end elsif x =~ /\.termsheet\.rb$/ @@ -301,7 +323,7 @@ module SiSU_Commandline puts "#{x} in #{a.join(' ')}?" end end - { cmd: c, mod: m, what: w, paths: pth, files: f, f_pths: f_pths, lng: lng, lngs: lngs } + { cmd: c, mod: m, what: w, paths: pth, files: f, f_pths: f_pths, lng: lng_is, lngs: lngs } end def expand_numeric_shortcuts(a) shortcut=SiSU_Env::InfoProcessingFlag.new |