aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-10-01 16:12:14 -0400
committerRalph Amissah <ralph@amissah.com>2012-10-01 16:12:14 -0400
commit52e870e3e04b3848d024e144ffb2a7f26b078cb3 (patch)
treee33e864b661903a4eb59c399ff160a53d4824028 /lib/sisu/v3/sysenv.rb
parentv3: some fixes, cleaning, removing (diff)
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
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r--lib/sisu/v3/sysenv.rb19
1 files changed, 8 insertions, 11 deletions
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