From ad5fbbc14216107e19b16654de7ac6dcab28e052 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 1 Oct 2007 01:50:20 +0100 Subject: proposed as sisu-0.60.0, see updated CHANGELOG * parameter reading on first run of file, (initialization of parameters) * composite files (.ssm) building moved to processing directory, to overcome problem of non-writable sisu-source document directories, perhaps also cleaner (management of files) * latex/pdf minor cleaning, * caret '^' is latex special character, additional match for escaping * clean major headings of markup heading tag with tilde and name e.g. '1~meta' * param / metadata, hash sums now returns has sum and file-name only even for sisu-skin --- lib/sisu/v0/param.rb | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'lib/sisu/v0/param.rb') diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb index a2036b8a..e3b42933 100644 --- a/lib/sisu/v0/param.rb +++ b/lib/sisu/v0/param.rb @@ -75,9 +75,10 @@ module SiSU_Param @@publisher='SiSU scribe' @@md=@@fns=nil def initialize(opt) + @opt=opt @cX||=SiSU_Screen::Ansi.new(opt.cmd) @cmd,@mod=opt.cmd,opt.mod - @fns=opt.fns.gsub(/\.ssm$/,'._sst') #revisit + @fns=opt.fns.gsub(/\.ssm$/,'._sst') #revisit CHECK Instantiate.new.param_instantiate @env=SiSU_Env::Info_env.new(@fns) @pstorefile="#{@env.path.dal}/#@fns.pstore" @@ -90,19 +91,20 @@ module SiSU_Param if @@md.nil? or @cmd =~/M/ #not particularly helpful, as current cycle is through output types, with files changing, only helpful if deal with a file all output types before going to next file if File.exist?(@pstorefile) param_msg='Parameters from pstore' - store=PStore.new(@pstorefile) - store.transaction do |s| + retrieve_store=PStore.new(@pstorefile) + retrieve_store.transaction do |s| @md=s['md'] - s.commit end - else #if @fns =~/\.s[123]/ + @md + else param_msg='Parameters extracted' - fns_array=IO.readlines(@fns,'') - @md=SiSU_Param::Instructions.new(fns_array,@fns,@cmd) + fns_array=@env.read_source_file(@opt.fns) + md=Instructions.new(fns_array,@opt) + @md=Instructions.new(fns_array,@opt).extract + @md end @@md=@md - else - @@md + else @@md end tell=SiSU_Screen::Ansi.new(@cmd,param_msg,@@md.title) tell.txt_grey if @cmd =~/[MV]/ @@ -130,7 +132,7 @@ module SiSU_Param ensure end end - protected + #protected def determine_papersize(l) l=case l when /eu|europe|uk/i; 'A4' #European default, SiSU default @@ -644,12 +646,12 @@ module SiSU_Param end @dgst,@dgst_skin=[],[] if @env.digest.type =~/sha256/ - @dgst=@sys.sha256(@fns) + @dgst=@sys.sha256(@env.source_file_with_path) @dgst_skin=if skin; @sys.sha256(skin) else nil end else - @dgst=@sys.md5(@fns) + @dgst=@sys.md5(@env.source_file_with_path) @dgst_skin=if skin; @sys.md5(skin) else nil end -- cgit v1.2.3