From 64e5c9120ffb7a65b96eded0850f481e116f1d3f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 8 Aug 2014 00:16:16 -0400 Subject: v6: use opt.act, code internals (simplify, cleaner; remove opt.cmd & opt.mod) * v5 dp, indentation changed to retain easy comparison with v6 --- lib/sisu/v6/texpdf.rb | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'lib/sisu/v6/texpdf.rb') diff --git a/lib/sisu/v6/texpdf.rb b/lib/sisu/v6/texpdf.rb index 4802614e..42e8383f 100644 --- a/lib/sisu/v6/texpdf.rb +++ b/lib/sisu/v6/texpdf.rb @@ -107,7 +107,7 @@ module SiSU_TeX Dir.mkdir(@env.processing_path.tex) unless FileTest.directory?(@env.processing_path.tex) end rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -148,7 +148,7 @@ module SiSU_TeX end end @md=@particulars.md - $flag=@md.opt.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format + $flag=@md.opt.selections.str #introduced to pass 0 for no object citation numbers... to texpdf_format directories #% needed needs to be reprogrammed !!! ao_array=SiSU_AO::Source.new(@opt).get # ao file drawn here @@ -158,7 +158,7 @@ module SiSU_TeX SiSU_TeX::Source::LaTeXtoPdf.new(@md,@particulars.env).latexrun_selective Dir.chdir(pwd) rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -180,7 +180,7 @@ module SiSU_TeX @@date=SiSU_Env::InfoDate.new @@flag={} $flag=1 #remove at some stage - SiSU_Env::Clear.new(@opt.cmd,@opt.fns).param_instantiate + SiSU_Env::Clear.new(@opt.selections.str,@opt.fns).param_instantiate end end private @@ -194,7 +194,7 @@ module SiSU_TeX @texfilename=texfilename @@n_lpdf=@@n_lpdf+1 tex_fn_base=@texfilename.gsub(/\.tex$/,'') - tell=SiSU_Screen::Ansi.new(@md.opt.cmd) + tell=SiSU_Screen::Ansi.new(@md.opt.selections.str) if @md.opt.act[:pdf_p][:set]==:on if (@md.opt.act[:verbose][:set]==:on \ || @md.opt.act[:verbose_plus][:set]==:on \ @@ -204,13 +204,21 @@ module SiSU_TeX "#{papersize} portrait ->" ).dark_grey_title_hi end - cmd=SiSU_Env::SystemCall.new("#{tex_fn_base}.tex",'',@md.opt.cmd) - tell.grey_open if @md.opt.cmd =~/[MVv]/ + cmd=SiSU_Env::SystemCall.new("#{tex_fn_base}.tex",'',@md.opt.selections.str) + if @md.opt.act[:verbose][:set]==:on \ + || @md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on + tell.grey_open + end if "#{tex_fn_base}" =~/\w+/ \ and "#{papersize}" =~/\w+/ 2.times { |i| cmd.latex2pdf(@md,papersize) } #comment out to skip processing of latex portrait end - tell.p_off 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 + tell.p_off + end end if @md.opt.act[:pdf_l][:set]==:on if (@md.opt.act[:verbose][:set]==:on \ @@ -221,7 +229,7 @@ module SiSU_TeX "#{papersize} landscape ->" ).dark_grey_title_hi end - cmd=SiSU_Env::SystemCall.new("#{tex_fn_base}.landscape.tex",'',@md.opt.cmd) + cmd=SiSU_Env::SystemCall.new("#{tex_fn_base}.landscape.tex",'',@md.opt.selections.str) if (@md.opt.act[:verbose][:set]==:on \ || @md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) @@ -357,7 +365,7 @@ module SiSU_TeX lst=Dir["*.{aux,log,out}"] lst.each {|file| File.unlink(file)} if lst rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -438,7 +446,7 @@ module SiSU_TeX data=markup(data) output(data) rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure -- cgit v1.2.3