aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/sysenv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/sysenv.rb')
-rw-r--r--lib/sisu/v3dv/sysenv.rb88
1 files changed, 44 insertions, 44 deletions
diff --git a/lib/sisu/v3dv/sysenv.rb b/lib/sisu/v3dv/sysenv.rb
index a5658ee1..1b1a5857 100644
--- a/lib/sisu/v3dv/sysenv.rb
+++ b/lib/sisu/v3dv/sysenv.rb
@@ -472,7 +472,7 @@ module SiSU_Env
@fn[:t]=filename[m,2]
end
end
- lng_base=InfoEnv.new.language_default_set
+ lng_base=SiSU_Env::InfoEnv.new.language_default_set
lang=SiSU_Env::StandardiseLanguage.new
langs=lang.codes
x=[]
@@ -544,8 +544,7 @@ module SiSU_Env
@m << { m: fn[:manifest], l: lng }
end
end
- @m.uniq!
- @m
+ @m=@m.uniq
end
def filename(code,name,suffix)
#d=SiSU_Env::InfoEnv.new(@fns)
@@ -612,7 +611,7 @@ module SiSU_Env
@sys=InfoSystem.instance
end
def program_found?(program)
- found=`whereis #{program}`
+ found=`which #{program}` #`whereis #{program}`
(found =~/bin\/#{program}\b/) ? true : false
end
def locale #locales utf8 or other
@@ -623,10 +622,10 @@ module SiSU_Env
end
def file_encoding(filename,cmd='') #file encoding
program='file'
- fnsp=InfoEnv.new(filename).source_file_with_path
+ fnsp=SiSU_Env::InfoEnv.new(filename).source_file_with_path
if program_found?(program)
encoding=%x{file -L #{fnsp}}.strip
- encoding.gsub!(/#{fnsp}:(\s+|$)/,'')
+ encoding=encoding.gsub(/#{fnsp}:(\s+|$)/,'')
encoding=if encoding \
and not encoding.empty?
encoding
@@ -850,7 +849,7 @@ module SiSU_Env
require_relative 'i18n' # i18n.rb
def initialize(l='')
@language=(l.nil? || l.empty?) \
- ? InfoEnv.new.language_default_set
+ ? SiSU_Env::InfoEnv.new.language_default_set
: l
@r=%{(?:#{Px[:lng_lst].join('|')})}
@lang_info=SiSU_i18n::Languages.new
@@ -972,7 +971,7 @@ module SiSU_Env
def initialize(fns='',md=nil)
super() #you may not want to re-execute this static info so frequently!
@fns,@md=fns,md
- @env=EnvCall.new(fns) if fns
+ @env=SiSU_Env::EnvCall.new(fns) if fns
fnb=if @md \
and defined? @md.fnb
@md.fnb
@@ -1116,10 +1115,9 @@ module SiSU_Env
FileUtils::rm_rf(spp)
end
paths=[]
- flv=EnvCall.new(opt.fns).document_language_versions_found
+ flv=SiSU_Env::EnvCall.new(opt.fns).document_language_versions_found
flv[:f].each {|l| lng_dirs << l[:l] }
- lng_dirs.uniq!
- lng_dirs.each do |lng|
+ lng_dirs.uniq.each do |lng|
paths << "#{spp}/doc/#{lng}"
end
paths \
@@ -2740,11 +2738,13 @@ WOK
include FileUtils::Verbose
def initialize(opt)
@opt=opt
- z=FileMap.new(@opt)
+ z=SiSU_Env::FileMap.new(@opt)
@zap=z.local_sisu_source
if @opt.cmd =~ /[hH]/
@zap=Dir.glob(@zap).join(' ')
- if @opt.cmd !~ /w/; @zap.gsub!(/#{@source_path}\/concordance.html/,'')
+ @zap=if @opt.cmd !~ /w/
+ @zap.gsub(/#{@source_path}\/concordance.html/,'')
+ else @zap
end
end
@env=SiSU_Env::InfoEnv.new
@@ -2901,15 +2901,15 @@ WOK
and remote_gen !~/\/\//) \
and @@flag_remote==true \
and @opt.cmd !~/U/
- SystemCall.new(local_gen,remote_gen).scp
+ SiSU_Env::SystemCall.new(local_gen,remote_gen).scp
if FileTest.file?("#{local_src}/#{src_txt}")
- SystemCall.new("#{local_src}/#{src_txt}",remote_src).scp
+ SiSU_Env::SystemCall.new("#{local_src}/#{src_txt}",remote_src).scp
end
if FileTest.file?("#{local_pod}/#{src_pod}")
- SystemCall.new("#{local_src}/#{src_pod}",remote_pod).scp
+ SiSU_Env::SystemCall.new("#{local_src}/#{src_pod}",remote_pod).scp
end
if FileTest.file?("#{local_epub}/#{@opt.fnb}.epub")
- SystemCall.new("#{local_epub}/#{@opt.fnb}.epub",remote_epub,@opt.cmd).scp
+ SiSU_Env::SystemCall.new("#{local_epub}/#{@opt.fnb}.epub",remote_epub,@opt.cmd).scp
end
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
@@ -2936,7 +2936,7 @@ WOK
and @@flag_remote==true \
and @opt.cmd !~/U/
puts "begin scp_base: #{local} -> #{remote}"
- SystemCall.new("#{local}/#{@env.path.style}/",remote).scp
+ SiSU_Env::SystemCall.new("#{local}/#{@env.path.style}/",remote).scp
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "begin scp_base: #{local} -> #{remote}"
@@ -2954,9 +2954,9 @@ WOK
and @@flag_remote==true \
and @opt.cmd !~/U/
puts "begin scp_base_all: #{local} -> #{remote}"
- SystemCall.new("#{local}/_sisu/image_sys/",remote).scp
- SystemCall.new("#{local}/_sisu/image/",remote).scp
- SystemCall.new("#{local}/#{@env.path.style}/",remote).scp
+ SiSU_Env::SystemCall.new("#{local}/_sisu/image_sys/",remote).scp
+ SiSU_Env::SystemCall.new("#{local}/_sisu/image/",remote).scp
+ SiSU_Env::SystemCall.new("#{local}/#{@env.path.style}/",remote).scp
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "scp_base_all: #{local} -> #{remote}"
@@ -2970,7 +2970,7 @@ WOK
self
end
def images_from_skin
- skin=InfoSkin.new(@md).select
+ skin=SiSU_Env::InfoSkin.new(@md).select
skin_array=nil
skin_images_array=[]
if skin
@@ -3001,7 +3001,7 @@ WOK
and remote_gen !~/\/\//) \
and @@flag_remote==true \
and @opt.cmd !~/U/
-# SystemCall.new("#{local_src}/#{src_txt}",remote_src,@opt.cmd).rsync
+# SiSU_Env::SystemCall.new("#{local_src}/#{src_txt}",remote_src,@opt.cmd).rsync
delete_extra_files='--delete' # '--delete-after'
inp=[]
if (@opt.cmd =~/h/ \
@@ -3108,13 +3108,13 @@ WOK
##create file structure without copying files?:
##rsync -av -f"+ */" -f"- *" @f.output_path.base.dir remote:./path/.
#local_dirs=%{-f"+ */" -f"- *" #{@f.output_path.base.dir}/*}
- #SystemCall.new(local_dirs,remote_gen,@opt.cmd).rsync
+ #SiSU_Env::SystemCall.new(local_dirs,remote_gen,@opt.cmd).rsync
local=local_gen + ' ' + images + ' ' + images_skin + ' ' + images_system + ' ' + local_css
- SystemCall.new(local,remote_rel,@opt.cmd).rsync('--relative',@f.output_path.base.dir)
+ SiSU_Env::SystemCall.new(local,remote_rel,@opt.cmd).rsync('--relative',@f.output_path.base.dir)
rescue
p __LINE__.to_s + ':' + __FILE__
local_dirs=%{--include='*/' --exclude='*' #{@f.output_path.base.dir}}
- SystemCall.new(local_dirs,remote_gen,@opt.cmd).rsync
+ SiSU_Env::SystemCall.new(local_dirs,remote_gen,@opt.cmd).rsync
end
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
@@ -3141,9 +3141,9 @@ WOK
and @rc['permission_set']['remote_base_site'] \
and @@flag_remote==true \
and @opt.cmd !~/U/
- SystemCall.new("#{image_sys}","#{remote_conf}").rsync
- SystemCall.new("#{images}","#{remote_conf}").rsync
- SystemCall.new("#{ldest}","#{remote}").rsync
+ SiSU_Env::SystemCall.new("#{image_sys}","#{remote_conf}").rsync
+ SiSU_Env::SystemCall.new("#{images}","#{remote_conf}").rsync
+ SiSU_Env::SystemCall.new("#{ldest}","#{remote}").rsync
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "rsync_base: #{local} -> #{remote}"
@@ -3164,9 +3164,9 @@ WOK
and @opt.cmd !~/U/
delete_extra_files='--delete' # '--delete-after'
puts "begin rsync_base_sync: #{local} -> #{remote}"
- SystemCall.new("#{local}/_sisu/image_sys/",remote).rsync(delete_extra_files)
- SystemCall.new("#{local}/_sisu/image/",remote).rsync(delete_extra_files)
- SystemCall.new("#{local}/#{@env.path.style}/",remote).rsync(delete_extra_files)
+ SiSU_Env::SystemCall.new("#{local}/_sisu/image_sys/",remote).rsync(delete_extra_files)
+ SiSU_Env::SystemCall.new("#{local}/_sisu/image/",remote).rsync(delete_extra_files)
+ SiSU_Env::SystemCall.new("#{local}/#{@env.path.style}/",remote).rsync(delete_extra_files)
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "rsync_base_sync: #{local} -> #{remote}"
@@ -3185,7 +3185,7 @@ WOK
remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
if @@flag_remote
delete_extra_files='--delete' # '--delete-after'
- SystemCall.new(local,remote).rsync(delete_extra_files)
+ SiSU_Env::SystemCall.new(local,remote).rsync(delete_extra_files)
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "rsync_sitemaps: #{local} -> #{remote}"
@@ -3199,7 +3199,7 @@ WOK
remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
if @@flag_remote
delete_extra_files='--delete' # '--delete-after'
- SystemCall.new(local,remote).rsync(delete_extra_files)
+ SiSU_Env::SystemCall.new(local,remote).rsync(delete_extra_files)
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "rsync_sitemaps: #{local} -> #{remote}"
@@ -4838,7 +4838,7 @@ WOK
end
def param_instantiate
@cX||=SiSU_Screen::Ansi.new(@cmd)
- @@date=InfoDate.new
+ @@date=SiSU_Env::InfoDate.new
@@proc=@@filename_txt=@@filename_texinfo=@@filename_lout_portrait=@@filename_lout_landscape=@@filename_html_scroll=@@filename_html_index=@@filename_html_segtoc=@@filename_semantic=@@filename_rss=@@newfile=@@drr=@@yaml=@@yamladdr=nil
@@publisher='SiSU scribe'
end
@@ -4856,7 +4856,7 @@ WOK
u=/.+?\/([^\/]+)(?:\/(?:#{r})$|$)/
@pwd_stub=pt.realpath.to_s[u,1]
@rc=@@rc ||=GetInit.instance.sisu_yaml.rc
- @defaults=InfoEnv.new.defaults
+ @defaults=SiSU_Env::InfoEnv.new.defaults
end
def share_source?
((defined? @rc['db']['share_source']) \
@@ -5053,7 +5053,7 @@ WOK
"#{@md.doc_css}_html.css"
elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_html.css")
"#{@env.path.stub_pwd}_html.css"
- else CSS_Default.new.html
+ else SiSU_Env::CSS_Default.new.html
end
end
def html_tables
@@ -5062,7 +5062,7 @@ WOK
"#{@md.doc_css}_html_tables.css"
elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_html_tables.css")
"#{@env.path.stub_pwd}_html_tables.css"
- else CSS_Default.new.html_tables
+ else SiSU_Env::CSS_Default.new.html_tables
end
end
def xhtml
@@ -5071,7 +5071,7 @@ WOK
"#{@md.doc_css}_xhtml.css"
elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_xhtml.css")
"#{@env.path.stub_pwd}_xhtml.css"
- else CSS_Default.new.xhtml
+ else SiSU_Env::CSS_Default.new.xhtml
end
end
def xml_sax
@@ -5080,7 +5080,7 @@ WOK
"#{@md.doc_css}_xml_sax.css"
elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_xml_sax.css")
"#{@env.path.stub_pwd}_xml_sax.css"
- else CSS_Default.new.xml_sax
+ else SiSU_Env::CSS_Default.new.xml_sax
end
end
def xml_dom
@@ -5089,7 +5089,7 @@ WOK
"#{@md.doc_css}_xml_dom.css"
elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_xml_dom.css")
"#{@env.path.stub_pwd}_xml_dom.css"
- else CSS_Default.new.xml_dom
+ else SiSU_Env::CSS_Default.new.xml_dom
end
end
def docbook_xml
@@ -5098,7 +5098,7 @@ WOK
"#{@md.doc_css}_xml_dom.css"
elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_docbook.css")
"#{@env.path.stub_pwd}_docbook.css"
- else CSS_Default.new.docbook_xml
+ else SiSU_Env::CSS_Default.new.docbook_xml
end
end
def homepage
@@ -5107,14 +5107,14 @@ WOK
"#{@md.doc_css}_homepage.css"
elsif FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@env.path.stub_pwd}_homepage.css")
"#{@env.path.stub_pwd}_homepage.css"
- else CSS_Default.new.homepage
+ else SiSU_Env::CSS_Default.new.homepage
end
end
end
class CSS_Stylesheet
def initialize(md)
@md=md
- @css=CSS_Select.new(@md)
+ @css=SiSU_Env::CSS_Select.new(@md)
@env=SiSU_Env::InfoEnv.new
@file=SiSU_Env::FileOp.new(@md)
end