From af7543c058995af80e25f2f71be3a12699e26564 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 13 Sep 2011 19:15:22 -0400 Subject: v3: options, (hub), action (opt.act) modified to increase use possibilities --- lib/sisu/v3/hub.rb | 92 +++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'lib/sisu/v3/hub.rb') diff --git a/lib/sisu/v3/hub.rb b/lib/sisu/v3/hub.rb index 029c2861..5319bfdc 100644 --- a/lib/sisu/v3/hub.rb +++ b/lib/sisu/v3/hub.rb @@ -104,7 +104,6 @@ module SiSU @opt.files.each_with_index do |fns,i| env=SiSU_Env::Info_env.new(fns) if fns =~ /sisupod(?:\.txz)?|\S+?(?:\.ss[mt]\.txz|\.ssp)$/ -# env=SiSU_Env::Info_env.new(fns) require_relative 'remote' # remote.rb #check pod_name=if fns =~ /http:\/\/\S+?(?:\.ss[mt]\.txz|\.ssp)$/ SiSU_Remote::Remote_download.new(fns).pod.name @@ -305,28 +304,29 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ if @opt.cmd =~/E/ # re-assign character require 'profile' end - if @opt.act[:harvest] - require_relative 'harvest' # harvest.rb - SiSU_Harvest::Source.new(@opt).read # -h -H html.rb + if @opt.act[:harvest][:bool] + require_relative 'harvest' # harvest.rb + SiSU_Harvest::Source.new(@opt).read # -h -H html.rb elsif @opt.mod.inspect =~/--convert|--to|--from/ - require_relative 'sst_convert_markup' # sst_convert_markup.rb + require_relative 'sst_convert_markup' # sst_convert_markup.rb elsif @opt.cmd =~/([AabCcDdeFfGgHhIiJjkLMmNnOoPpQqRrSsTtUuVvwWXxYyZ_0-9])/ \ and @opt.cmd =~/^-/ \ and @opt.mod.inspect !~/--(?:sitemaps|query|identify)/ \ or @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ @cX=SiSU_Screen::Ansi.new(@opt.cmd).cX flag=SiSU_Env::Info_processing_flag.new - if @opt.cmd =~/[vVM]/ #% version information + if @opt.cmd =~/[vVM]/ #% version information if @opt.cmd =~/V/ \ - and @opt.files.empty? #% environment + and @opt.files.empty? #% environment SiSU_Help::Help.new('env',@opt).environment else SiSU_Help::Help.new('env',@opt).sisu_version end end - if @opt.act[:license] #% license information + if @opt.act[:license][:bool] #% license information SiSU_Help::Help.new('license',@opt).help_request end - if @opt.act[:dal] or @opt.act[:maintenance] #% --maintenance, -m for -C + if @opt.act[:dal][:bool] \ + or @opt.act[:maintenance][:bool] #% --maintenance, -m for -C path={} path[:css]=@@env.path.output + '/_sisu/css' path[:xml]=@@env.path.output + '/_sisu/xml' @@ -344,7 +344,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ end end end - if @opt.act[:site_init] #% --init-site, -C initialize/configure + if @opt.act[:site_init][:bool] #% --init-site, -C initialize/configure op('conf','configure site') if @opt.cmd =~/R/ if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ @@ -360,19 +360,19 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ end end end - if @opt.act[:sample_search_form] #% --sample-search-form, -F cgi sample search form + if @opt.act[:sample_search_form][:bool] #% --sample-search-form, -F cgi sample search form Operations.new(@opt).cgi end - if @opt.act[:webrick] #% --webrick, -W webrick + if @opt.act[:webrick][:bool] #% --webrick, -W webrick Operations.new(@opt).webrick end - if @opt.cmd =~/Z/ #% -Z wipe previous output clean + if @opt.cmd =~/Z/ #% -Z wipe previous output clean op('zap','Zap, deletions') end - if @opt.act[:share_source] + if @opt.act[:share_source][:bool] op('share_src','SiSU markup source') end - if @opt.act[:dal] + if @opt.act[:dal][:bool] @retry_count= -1 begin path_image='./_sisu/processing/external_document/image' @@ -397,8 +397,8 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ SiSU_Remote::Get.new(@opt,@get_s).fns Operations.new.counter end - if @get_p.length > 0 #% remote sisupod - require_relative 'remote' # remote.rb + if @get_p.length > 0 #% remote sisupod + require_relative 'remote' # remote.rb SiSU_Remote::Get.new(@opt,@get_p).sisupod end rescue @@ -409,60 +409,60 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ end @opt.files=@opt.files.collect {|x| x=x.gsub(/(?:https?|file):\/\/\S+\/(\S+)\.sst$/,'\1.-sst') } end - if @opt.act[:dal] #%--dal, -m + if @opt.act[:dal][:bool] #%--dal, -m op('dal','dal') end @opt.files=@opt.files.collect {|x| x=x.gsub(/\.ssm$/,'.ssm.sst') } - if @opt.act[:sisupod] #% --sisupod, -S make sisupod + if @opt.act[:sisupod][:bool] #% --sisupod, -S make sisupod op('sisupod_make','sisupod (txz)') if @opt.fns=~/\.kdi._sst/ - op('share_src_kdissert','kdissert (kdi)') #% -S share kdissert source + op('share_src_kdissert','kdissert (kdi)') #% -S share kdissert source end end - if @opt.act[:qrcode] #% --qrcode, -Q + if @opt.act[:qrcode][:bool] #% --qrcode, -Q op('qrcode','QRcode') end - if @opt.act[:hash_digests] #% --hash-digests, -N digest tree + if @opt.act[:hash_digests][:bool] #% --hash-digests, -N digest tree op('digests','digests') end - if @opt.act[:html] #% --html, -h + if @opt.act[:html][:bool] #% --html, -h op('html','html') end - if @opt.act[:txt] #% --txt, -t -a + if @opt.act[:txt][:bool] #% --txt, -t -a #-A -f -e -E plaintext -a creates ms-dos type; -A creates unix type, plaintext file op('plaintext','plaintext') end - if @opt.act[:epub] #% --epub, -e + if @opt.act[:epub][:bool] #% --epub, -e op('epub','ePub') end - if @opt.act[:odt] #% --odt, -o opendocument + if @opt.act[:odt][:bool] #% --odt, -o opendocument op('odf','OpenDocument') end - if @opt.act[:xml_sax] #% --xml-sax, -x xml sax type + if @opt.act[:xml_sax][:bool] #% --xml-sax, -x xml sax type op('xml','xml sax') end - if @opt.act[:xml_dom] #% --xml-dom, -x xml dom type + if @opt.act[:xml_dom][:bool] #% --xml-dom, -x xml dom type op('xml_dom','xml dom') end - #if @opt.act[:fictionbook] #% --fictionbook, -f fictionbook xml + #if @opt.act[:fictionbook] #% --fictionbook, -f fictionbook xml # op('xml_fictionbook','xml fictionbook') #end - if @opt.act[:xhtml] #% --xhtml, -b xhtml + if @opt.act[:xhtml][:bool] #% --xhtml, -b xhtml op('xhtml','xhtml sax') end - if @opt.act[:concordance] #% --concordance, -w + if @opt.act[:concordance][:bool] #% --concordance, -w op('concordance','Concordance') end - if @opt.cmd =~/O/ #% -O open archive initiative, metadata harvesting + if @opt.cmd =~/O/ #% -O open archive initiative, metadata harvesting op('xml_md_oai_pmh_dc','OAI PMH') end - if @opt.act[:po4a] #% --po4a, -P + if @opt.act[:po4a][:bool] #% --po4a, -P op('po4a','po4a') end - if @opt.act[:git] #% --git, -g sisu git + if @opt.act[:git][:bool] #% --git, -g sisu git op('git','SiSU Git') end - if @opt.cmd =~/T/ #% -T termsheet/standard form + if @opt.cmd =~/T/ #% -T termsheet/standard form SiSU_Help::Help.new('termsheet').help_request @opt.files.each do |fns| if FileTest.file?(fns) @@ -476,38 +476,38 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ end Operations.new.counter end - if @opt.cmd =~/k/ #% -T temporary tests + if @opt.cmd =~/k/ #% -T temporary tests op('xml_scaffold','XML scaffold') end - if @opt.act[:pdf] #% --pdf, -p latex/ texpdf + if @opt.act[:pdf][:bool] #% --pdf, -p latex/ texpdf op('texpdf','LaTeX pdf') end - if @opt.act[:manpage] #% --manpage, -i + if @opt.act[:manpage][:bool] #% --manpage, -i op('manpage','manpage') end - if @opt.act[:texinfo] #% --texinfo, -I + if @opt.act[:texinfo][:bool] #% --texinfo, -I op('texinfo','TeX Info') end - if @opt.act[:psql] #% --pg, -D DB postgresql + if @opt.act[:psql][:bool] #% --pg, -D DB postgresql op('dbi','postgresql') end - if @opt.act[:sqlite] #% --sqlite, -d DB sqlite + if @opt.act[:sqlite][:bool] #% --sqlite, -d DB sqlite op('dbi','sqlite') end - if @opt.act[:dal] #% --dal, -m embedded content + if @opt.act[:dal][:bool] #% --dal, -m embedded content op('embedded','Embedded Content') end - if @opt.act[:manifest] #% --manifest, -y + if @opt.act[:manifest][:bool] #% --manifest, -y op('manifest','Manifest') end - if @opt.act[:sitemap] #% --sitemap, -Y + if @opt.act[:sitemap][:bool] #% --sitemap, -Y op('sitemaps','Sitemap') end if @opt.mod.inspect !~/--harvest/ - if @opt.act[:scp] #% -r copy to remote server + if @opt.act[:scp][:bool] #% -r copy to remote server op('remote','scp') end - if @opt.act[:rsync] #% -R copy to remote server + if @opt.act[:rsync][:bool] #% -R copy to remote server op('remote','rsync') end else -- cgit v1.2.3