From 52e870e3e04b3848d024e144ffb2a7f26b078cb3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 1 Oct 2012 16:12:14 -0400 Subject: v3: dal, sysenv, file processing, split objects; remove ref to old ruby * markup file processing, change to sourcefile readlines & split of sourcefile array * removal of RUBY_VERSION references to older versions of ruby --- lib/sisu/v3/sysenv.rb | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'lib/sisu/v3/sysenv.rb') diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 40880701..c4b364ad 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -973,7 +973,7 @@ module SiSU_Env include FileUtils attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:stub_src,:webserv_host_cgi,:webserv_port_cgi,:processing,:processing_git,:etc,:yamlrc_dir @@image_flag,@@local_image=true,true #warning on @@image_flag - @@fb=@@man_path=nil,nil + @@fb,@@man_path=nil,nil def initialize(fns='',md=nil) super() #you may not want to re-execute this static info so frequently! @fns,@md=fns,md @@ -1739,18 +1739,15 @@ WOK self end def read_source_file(fns) - fns_array=if RUBY_VERSION < '1.9' - x=unless fns =~/\.ssm.sst$/ - IO.readlines(fns,'') - else IO.readlines("#{processing_path.composite_file}/#{fns}",'') - end - else #ruby version >= '1.9' - x=unless fns =~/\.ssm.sst$/ - IO.readlines(fns,'r:utf-8') - else IO.readlines("#{processing_path.composite_file}/#{fns}",'r:utf-8') - end + fns_array=unless fns =~/\.ssm.sst$/ + IO.readlines(fns, mode: 'r:utf-8', cr_newline: true) + else + IO.readlines("#{processing_path.composite_file}/#{fns}", mode: 'r:utf-8', cr_newline: true) end end + def source_file_processing_array(fns) + sf=read_source_file(fns).join.split(/\s*\n\s*\n/m) + end def path #dir def home @sys.home -- cgit v1.2.3