From d5a35a0e2fba89c49fb7d7f1781c688694c0d83d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 1 May 2010 11:39:04 -0400 Subject: share source and sisupod make, control screen output --- lib/sisu/v2/share_src.rb | 15 +++++++++------ lib/sisu/v2/sisupod_make.rb | 38 +++++++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/lib/sisu/v2/share_src.rb b/lib/sisu/v2/share_src.rb index d0f1923e..9ea2fac0 100644 --- a/lib/sisu/v2/share_src.rb +++ b/lib/sisu/v2/share_src.rb @@ -70,10 +70,12 @@ module SiSU_Markup @output_path="#{@env.path.output}/src" end def read - tell=SiSU_Screen::Ansi.new(@opt.cmd,'Share Document Source!',@opt.fns) - tell.green_hi_blue unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,"Copy sisu markup file to output directory","#{@opt.fns} -> #{@output_path}") - tell.warn unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + @opt.cmd=~/[MVvz]/ \ + ? SiSU_Screen::Ansi.new(@opt.cmd,'Share Document Source!',@opt.fns).green_hi_blue \ + : SiSU_Screen::Ansi.new(@opt.cmd,'Share Document Source!',@opt.fns).green_title_hi + SiSU_Screen::Ansi.new(@opt.cmd,"Copy sisu markup file to output directory","#{@opt.fns} -> #{@output_path}").warn if @opt.cmd =~/[MVv]/ + end mkdir_p("#{@env.path.output}/src") unless FileTest.directory?("#{@env.path.output}/src") mkdir_p(@output_path) unless FileTest.directory?(@output_path) if FileTest.directory?(@output_path) @@ -86,8 +88,9 @@ module SiSU_Markup end end else - tell=SiSU_Screen::Ansi.new(@opt.cmd,"Output directory does not exist","#{@opt.fns} -> #{@output_path}") - tell.warn unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.cmd,"Output directory does not exist","#{@opt.fns} -> #{@output_path}").warn if @opt.cmd =~/[MVv]/ + end exit end end diff --git a/lib/sisu/v2/sisupod_make.rb b/lib/sisu/v2/sisupod_make.rb index 0b4b56d8..f0ba905c 100644 --- a/lib/sisu/v2/sisupod_make.rb +++ b/lib/sisu/v2/sisupod_make.rb @@ -82,19 +82,25 @@ module SiSU_Doc rm_rf("#{@env.path.processing}sisupod/*") if FileTest.directory?("#{@env.path.processing}sisupod") end def read - tell=SiSU_Screen::Ansi.new(@opt.cmd,'Share SiSU Document (zip)',@opt.fns) - tell.green_hi_blue unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + @opt.cmd=~/[MVvz]/ \ + ? SiSU_Screen::Ansi.new(@opt.cmd,'Share SiSU Document (zip)',@opt.fns).green_hi_blue \ + : SiSU_Screen::Ansi.new(@opt.cmd,'Share SiSU Document (zip)',@opt.fns).green_title_hi + end unless @opt.fns.empty? - tell=SiSU_Screen::Ansi.new(@opt.cmd,'Make sisu document (zip) and place in output directory',"#{@opt.fns} -> file://#{@env.path.output_pod}/#{@zipfile}.zip") - tell.warn unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.cmd,'Make sisu document (zip) and place in output directory',"#{@opt.fns} -> file://#{@env.path.output_pod}/#{@zipfile}.zip").warn if @opt.cmd =~/[MVv]/ + end directories sisupod_build sisupod_zip #sisupod_7zip else - tell=SiSU_Screen::Ansi.new(@opt.cmd,'Make (zip) of sisu work directory',"#{@env.stub_pwd}\_#{@date}.zip") - tell.warn unless @opt.cmd =~/q/ - tell.blue_tab unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,'Make (zip) of sisu work directory',"#{@env.stub_pwd}\_#{@date}.zip") + tell.warn if @opt.cmd =~/[MVv]/ + tell.blue_tab if @opt.cmd =~/[MVv]/ + end ans=@ans.response?('make sisupod of entire directory?') if ans; sisupod_zip_directory end @@ -122,12 +128,13 @@ module SiSU_Doc }) else puts "the required systemlink 'sisupod' could not be created on the current directory: remove the file or directory named 'sisupod' within #{Dir.pwd}" end - tell=SiSU_Screen::Ansi.new(@opt.cmd,'Share SiSU Document (tar gzip)',@opt.fns) - tell.green_hi_blue unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new(@opt.cmd,'Zipped directory',sisupod_directory) - tell.warn unless @opt.cmd =~/q/ - tell=SiSU_Screen::Ansi.new('',sisupod_directory) - tell.blue_tab unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + if @opt.cmd =~/[MVv]/ + SiSU_Screen::Ansi.new(@opt.cmd,'Share SiSU Document (tar gzip)',@opt.fns).green_hi_blue + SiSU_Screen::Ansi.new(@opt.cmd,'Zipped directory',sisupod_directory).warn + SiSU_Screen::Ansi.new('',sisupod_directory).blue_tab + end + end end def directories SiSU_Env::Info_env.new.sisupod @@ -283,8 +290,9 @@ module SiSU_Doc mv #{@zipfile}.zip #{@local_path}/. & rm -r sisupod/* && cd #{@env.path.pwd} }) - tell=SiSU_Screen::Ansi.new('',"#{@zipfile}.zip") - tell.blue_tab unless @opt.cmd =~/q/ + unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new('',"#{@zipfile}.zip").blue_tab if @opt.cmd =~/[MVv]/ + end end end end -- cgit v1.2.3