diff options
Diffstat (limited to 'lib/sisu/v0/param.rb')
-rw-r--r-- | lib/sisu/v0/param.rb | 26 |
1 files changed, 14 insertions, 12 deletions
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 |