From edd89902036bde18c91031470e19c871a182cf6d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:40:45 -0400 Subject: v5: options & downstream, more use of opt.act instead of opt.cmd * opt.act.*.set==:on instead of opt.cmd =~/\S/ --- lib/sisu/v5/epub.rb | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'lib/sisu/v5/epub.rb') diff --git a/lib/sisu/v5/epub.rb b/lib/sisu/v5/epub.rb index 26f1dc0d..37ab535b 100644 --- a/lib/sisu/v5/epub.rb +++ b/lib/sisu/v5/epub.rb @@ -86,14 +86,21 @@ module SiSU_EPUB @md=@particulars.md @fnb=@md.fnb @env=@particulars.env - unless @opt.cmd =~/q/ - tool=(@opt.cmd =~/[MVvz]/) \ + unless @opt.act[:quiet][:set]==:on + tool=(@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) \ ? "#{@env.program.epub_viewer} #{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}" : "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}" - @opt.cmd=~/[MVvz]/ \ - ? SiSU_Screen::Ansi.new(@opt.cmd,'EPUB',tool).green_hi_blue - : SiSU_Screen::Ansi.new(@opt.cmd,'EPUB',tool).green_title_hi - SiSU_Screen::Ansi.new(@opt.cmd,@opt.fns,"#{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}").flow if @opt.cmd =~/[MV]/ + (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) \ + ? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'EPUB',tool).green_hi_blue + : SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'EPUB',tool).green_title_hi + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"#{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}").flow + end end @env.processing_path.epub_bld #(@md) @env.processing_path.epub_cp_images(@md) @@ -111,7 +118,8 @@ module SiSU_EPUB __LINE__.to_s + ':' + __FILE__ end ensure - unless @opt.cmd =~/[MV]/ #check maintenance flag + unless (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) texfiles=Dir["#{@env.processing_path.tune}/#{@opt.fns}*"] texfiles.each do |f| if FileTest.file?(f) @@ -139,7 +147,7 @@ module SiSU_EPUB SiSU_Env::FileOp.new(@md).mkdir.output.epub end def tuned_file_instructions - @tell=SiSU_Screen::Ansi.new(@md.opt.cmd) + @tell=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set]) directories dal_array=@particulars.dal_array # dal file drawn here @tuned_file_array=SiSU_EPUB_Tune::Tune.new(dal_array,@md).songsheet @@ -186,11 +194,15 @@ module SiSU_EPUB @md,@data=md,data @vz=SiSU_Viz::Defaults.new @epub=SiSU_EPUB_Format::HeadInformation.new(@md) - @tell=SiSU_Screen::Ansi.new(@md.opt.cmd) if @md + @tell=SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set]) if @md @make=SiSU_Env::ProcessingSettings.new(@md) end def songsheet #extracts toc for scroll & seg - SiSU_Screen::Ansi.new(@md.opt.cmd,'Toc').txt_grey if @md.opt.cmd =~/[MVv]/ + if (@md.opt.act[:verbose][:set]==:on \ + || @md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],'Toc').txt_grey + end toc=nil @@firstseg=nil @@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] } @@ -519,7 +531,11 @@ module SiSU_EPUB def in_common toc_shared=[] segtoc=[] - SiSU_Screen::Ansi.new(@md.opt.cmd,'Scroll & Segtoc').txt_grey if @md.opt.cmd =~/[MVv]/ + if (@md.opt.act[:verbose][:set]==:on \ + || @md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],'Scroll & Segtoc').txt_grey + end format_head_toc=SiSU_EPUB_Format::HeadToc.new(@md) dochead=format_head_toc.head dochead=dochead.gsub(/toc\.(html)/,'doc.\1') #kludge @@ -687,7 +703,7 @@ module SiSU_EPUB ") FileUtils::mv(@epub_doc, @md.file.place_file.epub.dir) Dir.chdir(pwd) - unless @md.opt.cmd.inspect =~/M/ + unless @md.opt.act[:maintenance][:set]==:on FileUtils::rm_r(@md.env.processing_path.epub) end end -- cgit v1.2.3