diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-03-13 22:12:26 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-03-13 22:12:26 -0400 |
commit | 7e0877dcbff51b68752286516f045b8abdb47443 (patch) | |
tree | 41905d73ed77be6e7231ddc646e26bb2b36f5c88 /lib/sisu/v4/hub.rb | |
parent | debian/changelog (4.0.12-1) (diff) | |
parent | v4: version & changelog, dates touched (diff) |
Merge tag 'sisu_4.0.13' into debian/sid
SiSU 4.0.13
Diffstat (limited to 'lib/sisu/v4/hub.rb')
-rw-r--r-- | lib/sisu/v4/hub.rb | 122 |
1 files changed, 60 insertions, 62 deletions
diff --git a/lib/sisu/v4/hub.rb b/lib/sisu/v4/hub.rb index dee13bc1..f7cdb1e2 100644 --- a/lib/sisu/v4/hub.rb +++ b/lib/sisu/v4/hub.rb @@ -191,22 +191,22 @@ module SiSU @@n_do=0 end def remote_put_base_site_rsync # -CR -p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on + puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base end def remote_put_base_site_rsync_match # -CCRZ -p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on + puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base_sync end def remote_put_base_site # -Cr -p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on + puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base end def remote_put_base_site_all # -CCr -p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on + puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base_all end @@ -457,42 +457,22 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on end if @opt.act[:psql][:set]==:on #% --pg, -D DB postgresql require_relative 'dbi' - if @opt.files.length > 0 #switch test to actual commands - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb - end - else - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb end end if @opt.act[:sqlite][:set]==:on #% --sqlite, -d DB sqlite require_relative 'dbi' - if @opt.files.length > 0 #switch test to actual commands - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb - end - else - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb end end - if @opt.act[:dal][:set]==:on #% --dal, -m embedded content - # OptionLoopFiles.new(@opt).loop_files_on_given_option do - # require_relative 'embedded' - # SiSU_Embedded::Source.new(@opt).read # -m embedded.rb (image and other content) #check - # end - end if @opt.act[:zap][:set]==:on #% --zap, -Z # OptionLoopFiles.new(@opt).loop_files_on_given_option do # require_relative 'zap' # SiSU_Zap::Source.new(@opt).read # -Z zap.rb # end end - if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod - # OptionLoopFiles.new(@opt).loop_files_on_given_option do - # require_relative 'sisupod_make' - # SiSU_Doc::Source.new(@opt).read # -S sisupod_make.rb - # end - end if @opt.act[:manifest][:set]==:on #% --manifest, -y require_relative 'manifest' OptionLoopFiles.new(@opt).manifest_on_files_translated do @@ -629,50 +609,68 @@ p "#{__LINE__}:#{__FILE__}" if @opt.act[:maintenance][:set] ==:on ensure end end - if @opt.act[:site_init][:set]==:on #% -C - require_relative 'conf' # -s conf.rb - SiSU_Initialize::Source.new(@opt).read - end end def actions if @opt.act[:profile][:set]==:on require 'profile' end - action_on_file_ =(@opt.act[:dal][:set]==:on \ - || @opt.act[:manpage][:set]==:on \ - || @opt.act[:texinfo][:set]==:on \ - || @opt.act[:txt][:set]==:on \ - || @opt.act[:html][:set]==:on \ - || @opt.act[:html_scroll][:set]==:on \ - || @opt.act[:html_seg][:set]==:on \ - || @opt.act[:concordance][:set]==:on \ - || @opt.act[:xhtml][:set]==:on \ - || @opt.act[:epub][:set]==:on \ - || @opt.act[:odt][:set]==:on \ - || @opt.act[:xml_sax][:set]==:on \ - || @opt.act[:xml_dom][:set]==:on \ - || @opt.act[:pdf][:set]==:on \ - || @opt.act[:pdf_p][:set]==:on \ - || @opt.act[:pdf_l][:set]==:on \ - || @opt.act[:psql][:set]==:on \ - || @opt.act[:sqlite][:set]==:on \ - || @opt.act[:sqlite_discrete][:set]==:on \ - || @opt.act[:share_source][:set]==:on \ - || @opt.act[:sisupod][:set]==:on \ - || @opt.act[:qrcode][:set]==:on \ - || @opt.act[:hash_digests][:set]==:on \ - || @opt.act[:manifest][:set]==:on \ - || @opt.act[:rsync][:set]==:on \ - || @opt.act[:scp][:set]==:on \ - || @opt.act[:webrick][:set]==:on \ - || @opt.act[:zap][:set]==:on) \ - ? (:true) - : (:false) + action_on_file_ =if @opt.act[:rsync][:set]==:on \ + && @opt.act[:site_init][:set]==:on + :false + elsif @opt.act[:rsync][:set]==:on \ + && @opt.act[:site_init][:set] !=:on + :true + elsif ((@opt.act[:psql][:set]==:on \ + or @opt.act[:sqlite][:set]==:on) \ + and @opt.mod.join(';') =~/--(?:createdb|init(?:ialize)?|create(?:all)?|createtables|recreate|drop(?:all))/) + :false + else + (@opt.act[:dal][:set]==:on \ + || @opt.act[:manpage][:set]==:on \ + || @opt.act[:texinfo][:set]==:on \ + || @opt.act[:txt][:set]==:on \ + || @opt.act[:html][:set]==:on \ + || @opt.act[:html_scroll][:set]==:on \ + || @opt.act[:html_seg][:set]==:on \ + || @opt.act[:concordance][:set]==:on \ + || @opt.act[:xhtml][:set]==:on \ + || @opt.act[:epub][:set]==:on \ + || @opt.act[:odt][:set]==:on \ + || @opt.act[:xml_sax][:set]==:on \ + || @opt.act[:xml_dom][:set]==:on \ + || @opt.act[:pdf][:set]==:on \ + || @opt.act[:pdf_p][:set]==:on \ + || @opt.act[:pdf_l][:set]==:on \ + || @opt.act[:psql][:set]==:on \ + || @opt.act[:sqlite][:set]==:on \ + || @opt.act[:sqlite_discrete][:set]==:on \ + || @opt.act[:share_source][:set]==:on \ + || @opt.act[:sisupod][:set]==:on \ + || @opt.act[:qrcode][:set]==:on \ + || @opt.act[:hash_digests][:set]==:on \ + || @opt.act[:manifest][:set]==:on \ + || @opt.act[:scp][:set]==:on \ + || @opt.act[:webrick][:set]==:on \ + || @opt.act[:zap][:set]==:on) \ + ? (:true) + : (:false) + end if @opt.act[:harvest][:set]==:on 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 + elsif action_on_file_ == :false \ + and (@opt.act[:psql][:set]==:on \ + or @opt.act[:sqlite][:set]==:on) + if @opt.act[:psql][:set]==:on + require_relative 'dbi' + SiSU_DBI::SQL.new(@opt).connect + end + if @opt.act[:sqlite][:set]==:on + require_relative 'dbi' + SiSU_DBI::SQL.new(@opt).connect + end elsif action_on_file_ == :true \ or ( @opt.cmd =~/^-/ \ |