aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/sisu/v0/embedded.rb51
-rw-r--r--lib/sisu/v0/sysenv.rb634
2 files changed, 458 insertions, 227 deletions
diff --git a/lib/sisu/v0/embedded.rb b/lib/sisu/v0/embedded.rb
index 22835e8f..b5d33ac2 100644
--- a/lib/sisu/v0/embedded.rb
+++ b/lib/sisu/v0/embedded.rb
@@ -83,13 +83,16 @@ module SiSU_Embedded
def images
src="#{Dir.pwd}/_sisu/image"
ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image"
- rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/image"
- if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src)
- File.mkpath(ldest) unless FileTest.directory?(ldest)
- src_ec="#{src}/" + @md.ec[:image].join(" #{src}/")
- SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync
- if @md.cmd.inspect =~/R/ #rsync to remote image directory
- SiSU_Env::System_call.new(src_ec,"#{rdest}/.",'q').rsync
+ @rhost.each do |remote_conn|
+ rdest="#{remote_conn[:name]}/#{@env.path.stub_pwd}/_sisu/image"
+ if @md.cmd.inspect =~/[vVMR]/ \
+ and FileTest.directory?(src)
+ File.mkpath(ldest) unless FileTest.directory?(ldest)
+ src_ec="#{src}/" + @md.ec[:image].join(" #{src}/")
+ SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync
+ if @md.cmd.inspect =~/R/ #rsync to remote image directory
+ SiSU_Env::System_call.new(src_ec,"#{rdest}/.",'q').rsync
+ end
end
end
end
@@ -97,13 +100,16 @@ module SiSU_Embedded
#p @md.ec[:audio]
src="#{Dir.pwd}/_sisu/mm/audio"
ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/mm/audio"
- rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/mm/audio"
- if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src)
- File.mkpath(ldest) unless FileTest.directory?(ldest)
- src_ec="#{src}/" + @md.ec[:audio].join(" #{src}/")
- SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync
- if @md.cmd.inspect =~/R/ #rsync to remote audio directory
- SiSU_Env::System_call.new(src_ec,"#{rdest}/.",'q').rsync
+ @rhost.each do |remote_conn|
+ rdest="#{remote_conn[:name]}/#{@env.path.stub_pwd}/_sisu/mm/audio"
+ if @md.cmd.inspect =~/[vVMR]/ \
+ and FileTest.directory?(src)
+ File.mkpath(ldest) unless FileTest.directory?(ldest)
+ src_ec="#{src}/" + @md.ec[:audio].join(" #{src}/")
+ SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync
+ if @md.cmd.inspect =~/R/ #rsync to remote audio directory
+ SiSU_Env::System_call.new(src_ec,"#{rdest}/.",'q').rsync
+ end
end
end
end
@@ -111,13 +117,16 @@ module SiSU_Embedded
#p @md.ec[:multimedia]
src="#{Dir.pwd}/_sisu/mm/video"
ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/mm/video"
- rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/mm/video"
- if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src)
- File.mkpath(ldest) unless FileTest.directory?(ldest)
- src_ec="#{src}/" + @md.ec[:multimedia].join(" #{src}/")
- SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync
- if @md.cmd.inspect =~/R/ #rsync to remote video directory
- SiSU_Env::System_call.new(src_ec,"#{rdest}/.",'q').rsync
+ @rhost.each do |remote_conn|
+ rdest="#{remote_conn[:name]}/#{@env.path.stub_pwd}/_sisu/mm/video"
+ if @md.cmd.inspect =~/[vVMR]/ \
+ and FileTest.directory?(src)
+ File.mkpath(ldest) unless FileTest.directory?(ldest)
+ src_ec="#{src}/" + @md.ec[:multimedia].join(" #{src}/")
+ SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync
+ if @md.cmd.inspect =~/R/ #rsync to remote video directory
+ SiSU_Env::System_call.new(src_ec,"#{rdest}/.",'q').rsync
+ end
end
end
end
diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb
index a06af89d..e5c2c394 100644
--- a/lib/sisu/v0/sysenv.rb
+++ b/lib/sisu/v0/sysenv.rb
@@ -101,9 +101,11 @@ module SiSU_Env
prcss_dir='_sisu_processing'
prcss_dir_tmp_root="/tmp/#{prcss_dir}"
prcss_dir_stub="#{prcss_dir}/#{@stub_pwd}"
- @processing_dir=if @@home and File.writable?("#{@@home}/."); "#{@@home}/#{prcss_dir_stub}"
+ @processing_dir=if @@home \
+ and File.writable?("#{@@home}/.")
+ "#{@@home}/#{prcss_dir_stub}"
#elsif File.writable?("#{@@pwd}/."); "#{@@pwd}/#{prcss_dir}"
- else prcss_dir_stub
+ else prcss_dir_stub
end
tmp_processing_base=if @@user; "#{prcss_dir_tmp_root}/#{@@user}/#{@stub_pwd}"
else "#{prcss_dir_stub}"
@@ -115,7 +117,11 @@ module SiSU_Env
else "/tmp/#{prcss_dir_stub}"
end
user=ENV['USER']
- port_pgsql=if defined? ENV['PGPORT'] and not (ENV['PGPORT'].nil? or ENV['PGPORT'].empty?) and ENV['PGPORT']=~/^\d+$/; ENV['PGPORT']
+ port_pgsql=if defined? ENV['PGPORT'] \
+ and not (ENV['PGPORT'].nil? \
+ or ENV['PGPORT'].empty?) \
+ and ENV['PGPORT']=~/^\d+$/
+ ENV['PGPORT']
else '5432'
end
IMAGES=:images
@@ -230,7 +236,9 @@ module SiSU_Env
break
end
end
- if load_prog and @prog=~/dbi/; require 'dbi' #revisit
+ if load_prog \
+ and @prog=~/dbi/
+ require 'dbi' #revisit
end
if load_prog; require @prog
else
@@ -269,7 +277,8 @@ module SiSU_Env
def yamlrc
unless @@rc
@yamlrc_path.each do |v|
- if @@noyaml or FileTest.exist?("#{v}/noyaml")
+ if @@noyaml \
+ or FileTest.exist?("#{v}/noyaml")
puts "WARNING - YAML loading switched off, to enable delete the file:\n\t#{v}/noyaml\n\n" unless @@noyaml
@@noyaml=true
break
@@ -298,7 +307,8 @@ module SiSU_Env
def ads #WORK AREA
tell_no_yaml='WARNING - YAML loading switched off, to enable delete the file:'
@ad_path.each do |v|
- if @@noyaml or FileTest.exist?("#{v}/noyaml")
+ if @@noyaml \
+ or FileTest.exist?("#{v}/noyaml")
puts tell_no_yaml + "\n\t#{v}/noyaml\n" unless @@noyaml
@@noyaml=true
break
@@ -317,7 +327,8 @@ module SiSU_Env
end
end
@ad_path.each do |v|
- if @@noyaml or FileTest.exist?("#{v}/noyaml")
+ if @@noyaml \
+ or FileTest.exist?("#{v}/noyaml")
puts tell_no_yaml + "\n\t#{v}/noyaml\n" unless @@noyaml
@@noyaml=true
break
@@ -348,10 +359,13 @@ module SiSU_Env
@sys=Info_system.instance
@rc=Get_init.instance.yamlrc
@ad=Get_init.instance.ads
- if @fns and @fns != '' and @fns !=@@fns
+ if @fns \
+ and @fns != '' \
+ and @fns !=@@fns
@@fns,@@fnn,@@fnb,@@fnt,@@flv,@@fnz=@fns,nil,nil,nil,nil,nil
end
- if @fns and @fns != '' #watch
+ if @fns \
+ and @fns != '' #watch
if multilingual
m=/((.+?)(?:\~\w{2,3})?)\.((?:-|ssm\.)?sst|ssm)$/
@@fnn ||=@fns[m,1]
@@ -373,13 +387,16 @@ module SiSU_Env
@fnn,@fnb,@fnt,@flv,@fnz=@@fnn,@@fnb,@@fnt,@@flv,@@fnz
end
def multilingual
- if defined? @rc['default']['multilingual'] and @rc['default']['multilingual'] != nil; @rc['default']['multilingual']
- else true
+ if defined? @rc['default']['multilingual'] \
+ and @rc['default']['multilingual'] != nil
+ @rc['default']['multilingual']
+ else true
end
end
def document_language_versions_found
@fn={}
- unless (@fns.nil? or @fns.empty?)
+ unless (@fns.nil? \
+ or @fns.empty?)
if multilingual
m=/((.+?)(?:\~\w{2,3})?)\.((?:-|ssm\.)?sst$)/
@fn[:b],@fn[:m],@fn[:t]=@fns[m,1],@fns[m,2],@fns[m,3]
@@ -409,7 +426,8 @@ module SiSU_Env
ob=output_base
@fn={}
@m=[]
- unless (@fns.nil? or @fns.empty?)
+ unless (@fns.nil? \
+ or @fns.empty?)
if multilingual
m=/((.+?)(?:\~\w{2,3})?)\.((?:-|ssm\.)?sst$)/
@fn[:b],@fn[:m],@fn[:t]=@fns[m,1],@fns[m,2],@fns[m,3]
@@ -510,7 +528,9 @@ module SiSU_Env
if program_found?(program)
encoding=%x{file #{fnsp}}.strip
encoding.gsub!(/#{fnsp}:(\s+|$)/,'')
- encoding=if encoding and not encoding.empty?; encoding
+ encoding=if encoding \
+ and not encoding.empty?
+ encoding
else 'UTF-8 assumed, encoding undetermined'
end
puts encoding if cmd =~/[VM]/
@@ -520,7 +540,9 @@ module SiSU_Env
end
def wc #word count
program='wc'
- if program_found?(program) and locale !~/utf-?8/i; true
+ if program_found?(program) \
+ and locale !~/utf-?8/i
+ true
else
program_ref="(not available)" unless program_found?(program)
program_ref="(UTF-8)" if locale =~/utf-?8/i
@@ -764,9 +786,14 @@ module SiSU_Env
super() #you may not want to re-execute this tatic info so frequently!
@fns,@md=fns,md
@env=Env_call.new(fns) if fns
- fnb=if @md and defined? @md.fnb; @md.fnb
- elsif defined? @env.fnb and @env.fnb; @env.fnb
- elsif not @fns.nil? and not @fns.empty?
+ fnb=if @md \
+ and defined? @md.fnb
+ @md.fnb
+ elsif defined? @env.fnb \
+ and @env.fnb
+ @env.fnb
+ elsif not @fns.nil? \
+ and not @fns.empty?
m=/(.+)?\.(?:(?:-|ssm\.)?sst|ssm)$/m
@fns[m,1] if not @fns.empty?
end
@@ -799,7 +826,8 @@ module SiSU_Env
@sys.locale
end
def concord_max
- concord_max=if defined? @rc['processing']['concord_max'] and @rc['processing']['concord_max']
+ concord_max=if defined? @rc['processing']['concord_max'] \
+ and @rc['processing']['concord_max']
@rc['processing']['concord_max']
else defaults[:concord_max]
end
@@ -826,7 +854,10 @@ module SiSU_Env
# doc [relevant skin if any other than default]
# image [all images for specific document gathered here]
sisupod_processing_path="#{path.processing}/sisupod"
- rm_rf(sisupod_processing_path) if FileTest.directory?(sisupod_processing_path) or FileTest.file?(sisupod_processing_path)
+ if FileTest.directory?(sisupod_processing_path) \
+ or FileTest.file?(sisupod_processing_path)
+ rm_rf(sisupod_processing_path)
+ end
paths=[]
paths=["#{path.processing}/sisupod/_sisu/skin/doc","#{path.processing}/sisupod/_sisu/skin/dir","#{path.processing}/sisupod/_sisu/skin/site","#{path.processing}/sisupod/_sisu/image"]
paths.each {|x| File.mkpath(x) unless FileTest.directory?(x) }
@@ -846,10 +877,15 @@ module SiSU_Env
@flag[:ad]=if @md.flag_promo && @ad[:flag_promo]
@flag[:md]=true
true
- elsif defined? @vz.widget_promo and not @vz.widget_promo.nil? and @vz.widget_promo.class == Array and @vz.widget_promo.length > 0
+ elsif defined? @vz.widget_promo \
+ and not @vz.widget_promo.nil? \
+ and @vz.widget_promo.class == Array \
+ and @vz.widget_promo.length > 0
@flag[:sk]=true
true
- elsif defined? @rc['promo'] and not @rc['promo'].nil? and @rc['promo'].length > 0
+ elsif defined? @rc['promo'] \
+ and not @rc['promo'].nil? \
+ and @rc['promo'].length > 0
@flag[:rc]=true
true
else
@@ -862,16 +898,17 @@ module SiSU_Env
flag=false
if defined? @rc['search']
searches.each do |type|
- flag=if defined? @rc['search'][type] and
- defined? @rc['search'][type]['action'] and
- @rc['search'][type]['flag']==true and
- @rc['search'][type]['action'] =~/https?:\/\// #and
- #defined? @rc['search'][type]['db'] and @rc['search'][type]['db'] =~/\S+/ # and
+ flag=if defined? @rc['search'][type] \
+ and defined? @rc['search'][type]['action'] \
+ and @rc['search'][type]['flag']==true \
+ and @rc['search'][type]['action'] =~/https?:\/\//
flag=if promo?[:ad]
false
- elsif defined? @vz.widget_search and @vz.widget_search == true
+ elsif defined? @vz.widget_search \
+ and @vz.widget_search == true
true
- elsif defined? @rc['search'][type]['flag'] and @rc['search'][type]['flag'] == true
+ elsif defined? @rc['search'][type]['flag'] \
+ and @rc['search'][type]['flag'] == true
true
else false
end
@@ -887,14 +924,18 @@ module SiSU_Env
searches=['sisu','hyperestraier']
flag=if defined? @rc['search']
searches.each do |type|
- if defined? @rc['search'][type] and
- defined? @rc['search'][type]['action'] and @rc['search'][type]['action'] =~/https?:\/\// and
- defined? @rc['search'][type]['db'] and @rc['search'][type]['db'] =~/\S+/ # and
+ if defined? @rc['search'][type] \
+ and defined? @rc['search'][type]['action'] \
+ and @rc['search'][type]['action'] =~/https?:\/\// \
+ and defined? @rc['search'][type]['db'] \
+ and @rc['search'][type]['db'] =~/\S+/
flag=if promo?[:ad]
false
- elsif defined? @vz.widget_search and @vz.widget_search == true
+ elsif defined? @vz.widget_search \
+ and @vz.widget_search == true
true
- elsif defined? @rc['search'][type]['flag'] and @rc['search'][type]['flag'] == true
+ elsif defined? @rc['search'][type]['flag'] \
+ and @rc['search'][type]['flag'] == true
true
else false
end
@@ -906,17 +947,24 @@ module SiSU_Env
end
def search_form(type='sisusearch',action=nil,db=nil,table=false)
rc=SiSU_Env::Get_init.instance.yamlrc
- create_form_hyperestraier=if defined? rc['search']['sisu']['flag'] and
- rc['search']['sisu']['flag']==true and
- action and action =~/https?:\/\//; true
+ create_form_hyperestraier=if defined? rc['search']['sisu']['flag'] \
+ and rc['search']['sisu']['flag']==true \
+ and action \
+ and action =~/https?:\/\//
+ true
else false
end
- create_form_sisu=if action and db and action =~/https?:\/\// and db =~/\S+/
+ create_form_sisu=if action \
+ and db \
+ and action =~/https?:\/\// \
+ and db =~/\S+/
true
elsif widget.search?
- db=if rc['search']['sisu']['flag']==true and
- rc['search']['sisu']['db']=~/\S+/
- rc['search']['sisu']['db']=~/^SiSU_\S+/ ? rc['search']['sisu']['db'] : "SiSU_#{rc['search']['sisu']['db']}"
+ db=if rc['search']['sisu']['flag']==true \
+ and rc['search']['sisu']['db']=~/\S+/
+ rc['search']['sisu']['db']=~/^SiSU_\S+/ \
+ ? rc['search']['sisu']['db'] \
+ : "SiSU_#{rc['search']['sisu']['db']}"
else nil
end
action=rc['search']['sisu']['action']
@@ -930,9 +978,10 @@ module SiSU_Env
table_open=''
table_close='<br />'
end
- form=if create_form_sisu and type=~/sisusearch/ and
- defined? rc['search']['sisu'] and
- defined? rc['search']['sisu']['action']
+ form=if create_form_sisu \
+ and type=~/sisusearch/ \
+ and defined? rc['search']['sisu'] \
+ and defined? rc['search']['sisu']['action']
<<WOK
<!-- SiSU Search -->
#{table_open}
@@ -952,8 +1001,9 @@ module SiSU_Env
#{table_close}
<!-- SiSU Search -->
WOK
- elsif create_form_hyperestraier and type=~/hyperestraier/ and
- defined? rc['search']['hyperestraier']
+ elsif create_form_hyperestraier \
+ and type=~/hyperestraier/ \
+ and defined? rc['search']['hyperestraier']
<<WOK
<!-- SiSU Search using Hyperestraier -->
#{table_open}
@@ -976,12 +1026,18 @@ WOK
end
def search_form_static(action=nil,db=nil)
rc=SiSU_Env::Get_init.instance.yamlrc
- create_form=if rc['search']['sisu']['flag']==true and
- action and db and action =~/https?:\/\// and db =~/\S+/
+ create_form=if rc['search']['sisu']['flag']==true \
+ and action \
+ and db \
+ and action =~/https?:\/\// \
+ and db =~/\S+/
true
elsif widget.search_fixed?
- db=if rc['search']['sisu']['flag']==true and rc['search']['sisu']['db']=~/\S+/
- rc['search']['sisu']['db']=~/^SiSU_\S+/ ? rc['search']['sisu']['db'] : "SiSU_#{rc['search']['sisu']['db']}"
+ db=if rc['search']['sisu']['flag']==true \
+ and rc['search']['sisu']['db']=~/\S+/
+ rc['search']['sisu']['db']=~/^SiSU_\S+/ \
+ ? rc['search']['sisu']['db'] \
+ : "SiSU_#{rc['search']['sisu']['db']}"
else nil
end
action=rc['search']['sisu']['action']
@@ -1022,14 +1078,19 @@ WOK
@vz=SiSU_Env::Get_init.instance.skin
@flag={ :ad=>false,:md=>false,:sk=>false,:rc=>false }
def search?
- flag=if defined? @rc['search'] and
- defined? @rc['search']['sisu'] and
- defined? @rc['search']['sisu']['action'] and @rc['search']['sisu']['action'] =~/https?:\/\// and
- defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/
- defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/
- flag=if defined? @vz.widget_search and @vz.widget_search == true
+ flag=if defined? @rc['search'] \
+ and defined? @rc['search']['sisu'] \
+ and defined? @rc['search']['sisu']['action'] \
+ and @rc['search']['sisu']['action'] =~/https?:\/\// \
+ and defined? @rc['search']['sisu']['db'] \
+ and @rc['search']['sisu']['db'] =~/\S+/ \
+ and defined? @rc['search']['sisu']['db'] \
+ and @rc['search']['sisu']['db'] =~/\S+/
+ flag=if defined? @vz.widget_search \
+ and @vz.widget_search == true
true
- elsif defined? @rc['search']['sisu']['flag'] and @rc['search']['sisu']['flag'] == true
+ elsif defined? @rc['search']['sisu']['flag'] \
+ and @rc['search']['sisu']['flag'] == true
true
else
false
@@ -1039,14 +1100,19 @@ WOK
end
end
def search_fixed?
- flag=if defined? @rc['search'] and
- defined? @rc['search']['sisu'] and
- defined? @rc['search']['sisu']['action'] and @rc['search']['sisu']['action'] =~/https?:\/\// and
- defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/
- defined? @rc['search']['sisu']['db'] and @rc['search']['sisu']['db'] =~/\S+/
- flag=if defined? @vz.widget_search and @vz.widget_search == true
+ flag=if defined? @rc['search'] \
+ and defined? @rc['search']['sisu'] \
+ and defined? @rc['search']['sisu']['action'] \
+ and @rc['search']['sisu']['action'] =~/https?:\/\// \
+ and defined? @rc['search']['sisu']['db'] \
+ and @rc['search']['sisu']['db'] =~/\S+/ \
+ and defined? @rc['search']['sisu']['db'] \
+ and @rc['search']['sisu']['db'] =~/\S+/
+ flag=if defined? @vz.widget_search \
+ and @vz.widget_search == true
true
- elsif defined? @rc['search']['sisu']['flag'] and @rc['search']['sisu']['flag'] == true
+ elsif defined? @rc['search']['sisu']['flag'] \
+ and @rc['search']['sisu']['flag'] == true
true
else
false
@@ -1057,11 +1123,15 @@ WOK
end
def search_form(action=nil,db=nil)
rc=SiSU_Env::Get_init.instance.yamlrc
- create_form=if defined? rc['search']['sisu']['flag'] and
- rc['search']['sisu']['flag']==true and
- action and db and action =~/https?:\/\// and db =~/\S+/
+ create_form=if defined? rc['search']['sisu']['flag'] \
+ and rc['search']['sisu']['flag']==true \
+ and action \
+ and db \
+ and action =~/https?:\/\// \
+ and db =~/\S+/
true
- elsif widget_static.search? and rc['search']['sisu']['flag']==true
+ elsif widget_static.search? \
+ and rc['search']['sisu']['flag']==true
db=if rc['search']['sisu']['db']=~/\S+/
rc['search']['sisu']['db']=~/^SiSU_\S+/ ? rc['search']['sisu']['db'] : "SiSU_#{rc['search']['sisu']['db']}"
else nil
@@ -1070,7 +1140,9 @@ WOK
true
else false
end
- if create_form and @fnb and @fnb=~/\S+/
+ if create_form \
+ and @fnb \
+ and @fnb=~/\S+/
%{<!-- SiSU Search -->
<a name="search"></a>
<form method="get" action="#{rc['search']['sisu']['action']}" target="_top">
@@ -1191,17 +1263,23 @@ WOK
end
def webserv #separation required for webrick which cannot use path.output (different requirements as no file is passed)
man_path=if @@man_path.nil?
- man_path=if defined? @rc['webserv']['path'] and @rc['webserv']['path'] =~/\S\S+/
+ man_path=if defined? @rc['webserv']['path'] \
+ and @rc['webserv']['path'] =~/\S\S+/
man_path=@@man_path=File.expand_path(@rc['webserv']['path'])
else nil
end
else manpath=@@man_path
end
- @webserv_path=if defined? man_path and File.writable?("#{man_path}/."); man_path #web server path as configured in rc file
- elsif FileTest.directory?(defaults[:webserv_path]) and File.writable?("#{defaults[:webserv_path]}/.") #web server path default
+ @webserv_path=if defined? man_path \
+ and File.writable?("#{man_path}/.")
+ man_path #web server path as configured in rc file
+ elsif FileTest.directory?(defaults[:webserv_path]) \
+ and File.writable?("#{defaults[:webserv_path]}/.") #web server path default
defaults[:webserv_path]
else #create default directory under home and place output there
- File.mkpath(defaults[:output_local]) unless FileTest.directory?(defaults[:output_local])
+ unless FileTest.directory?(defaults[:output_local])
+ File.mkpath(defaults[:output_local])
+ end
defaults[:output_local]
end
end
@@ -1252,8 +1330,11 @@ WOK
end
File.mkpath(defaults[:processing_path]) unless FileTest.directory?(defaults[:processing_path])
File.mkpath(defaults[:processing_path_tmp]) unless FileTest.directory?(defaults[:processing_path_tmp])
- path_processing=if defined? @rc['processing']['path'] and @rc['processing']['path']
- File.mkpath("#{path.home}/#{@rc['processing']['path']}") unless FileTest.directory?("#{path.home}/#{@rc['processing']['path']}")
+ path_processing=if defined? @rc['processing']['path'] \
+ and @rc['processing']['path']
+ unless FileTest.directory?("#{path.home}/#{@rc['processing']['path']}")
+ File.mkpath("#{path.home}/#{@rc['processing']['path']}")
+ end
["#{path.home}/#{@rc['processing']['path']}",defaults[:processing_path],defaults[:processing_path_tmp]]
else [defaults[:processing_path],defaults[:processing_path_tmp]]
end
@@ -1346,7 +1427,8 @@ WOK
url.webserv_map_pwd
end
def image_source #image repository source directory
- image_path=if defined? @rc['image']['path'] and defined? @rc['image']['public']
+ image_path=if defined? @rc['image']['path'] \
+ and defined? @rc['image']['public']
pth="#{@rc['image']['path']}"
"#{pth}/#{@rc['image']['public']}"
else
@@ -1354,7 +1436,8 @@ WOK
end
end
def image_source_tex #image repository source directory
- image_path=if defined? @rc['image']['path'] and defined? @rc['image']['public']
+ image_path=if defined? @rc['image']['path'] \
+ and defined? @rc['image']['public']
pth="#{@rc['image']['path']}"
"#{pth}/#{@rc['image']['public']}"
else
@@ -1389,8 +1472,12 @@ WOK
"http://#{hostname}/#@stub_pwd"
end
def root
- if defined? @rc['webserv']['url_root'] and @rc['webserv']['url_root'] =~/https?:\/\//; "#{@rc['webserv']['url_root']}/#@stub_pwd"
- elsif defined? @rc['webserv']['url_root'] and @rc['webserv']['url_root'] =~/localhost/; "http://localhost/#@stub_pwd"
+ if defined? @rc['webserv']['url_root'] \
+ and @rc['webserv']['url_root'] =~/https?:\/\//
+ "#{@rc['webserv']['url_root']}/#@stub_pwd"
+ elsif defined? @rc['webserv']['url_root'] \
+ and @rc['webserv']['url_root'] =~/localhost/
+ "http://localhost/#@stub_pwd"
else "file://#{path.output}"
end
end
@@ -1408,11 +1495,16 @@ WOK
end
end
def webrick_port
- if @md and @md.cmd.inspect=~/-F/ and @md.mod.inspect=~/port=(\d+)/
+ if @md \
+ and @md.cmd.inspect=~/-F/ \
+ and @md.mod.inspect=~/port=(\d+)/
$1
else
if defined? @rc['webserv_cgi']['port']
- if @rc['webserv_cgi']['port'].nil? and (defined? @md.mod and not @md.mod.nil? and @md.mod.inspect=~/webrick/)
+ if @rc['webserv_cgi']['port'].nil? \
+ and (defined? @md.mod \
+ and not @md.mod.nil? \
+ and @md.mod.inspect=~/webrick/)
defaults[:webserv_port_cgi]
elsif not @rc['webserv_cgi']['port'].nil?
@rc['webserv_cgi']['port']
@@ -1423,11 +1515,16 @@ WOK
end
end
def webserv_port_cgi
- if @md and @md.cmd.inspect=~/-F/ and @md.mod.inspect=~/port=(\d+)/
+ if @md \
+ and @md.cmd.inspect=~/-F/ \
+ and @md.mod.inspect=~/port=(\d+)/
$1
else
if defined? @rc['webserv_cgi']['port']
- if @rc['webserv_cgi']['port'].nil? and (defined? @md.mod and not @md.mod.nil? and @md.mod.inspect=~/webrick/)
+ if @rc['webserv_cgi']['port'].nil? \
+ and (defined? @md.mod \
+ and not @md.mod.nil? \
+ and @md.mod.inspect=~/webrick/)
defaults[:webserv_port_cgi]
elsif not @rc['webserv_cgi']['port'].nil?
@rc['webserv_cgi']['port']
@@ -1438,7 +1535,8 @@ WOK
end
end
def webserv_cgi #web url for local webserv (localhost, or hostname)
- if defined? @rc['webserv_cgi']['host'] and not @rc['webserv_cgi']['host'].nil?
+ if defined? @rc['webserv_cgi']['host'] \
+ and not @rc['webserv_cgi']['host'].nil?
http=@rc['webserv_cgi']['host'] =~ /https?:\/\// ? '' : 'http://' #check https? missing
if webserv_port_cgi
"#{http}#{@rc['webserv_cgi']['host']}:#{webserv_port_cgi}/#@stub_pwd"
@@ -1453,7 +1551,8 @@ WOK
end
end
def webserv_base_cgi #web url for local webserv (localhost, or hostname)
- if defined? @rc['webserv_cgi']['host'] and not @rc['webserv_cgi']['host'].nil?
+ if defined? @rc['webserv_cgi']['host'] \
+ and not @rc['webserv_cgi']['host'].nil?
http=@rc['webserv_cgi']['host'] =~ /https?:\/\// ? '' : 'http://'
if webserv_port_cgi
"#{http}#{@rc['webserv_cgi']['host']}:#{webserv_port_cgi}"
@@ -1469,7 +1568,8 @@ WOK
end
def webrick #must have a port #REMOVE
#port=":#{webserv_port_cgi}"
- if defined? @rc['webserv_cgi']['host'] and not @rc['webserv_cgi']['host'].nil?
+ if defined? @rc['webserv_cgi']['host'] \
+ and not @rc['webserv_cgi']['host'].nil?
http=if @rc['webserv_cgi']['host'] =~/http:\/\//
'http://'
elsif @rc['webserv_cgi']['host'] =~/https:\/\//
@@ -1477,14 +1577,17 @@ WOK
else defaults
end
"#{http}#{@rc['webserv_cgi']['host']}"
- elsif webserv_host_base and not webserv_host_base.nil?
+ elsif webserv_host_base \
+ and not webserv_host_base.nil?
"#{http}#{webserv_host_base}"
else "#{http}localhost" end
end
def webserv #web url for local webserv (localhost, or hostname)
- if path.webserv_dir and path.webserv =~ /#{path.webserv_dir}/ #revisit
+ if path.webserv_dir \
+ and path.webserv =~ /#{path.webserv_dir}/ #revisit
"#{path.webserv}/#@stub_pwd".gsub(/#{path.webserv_dir}/,"#{url.hostname}/#@stub_pwd")
- elsif defined? @rc['webserv']['webrick_url'] and @rc['webserv']['webrick_url'] == false
+ elsif defined? @rc['webserv']['webrick_url'] \
+ and @rc['webserv']['webrick_url'] == false
"file://#{path.webserv}/#@stub_pwd"
elsif webserv_port_cgi =~/\S+/
"#{url.hostname}:#{webserv_port_cgi}/#@stub_pwd"
@@ -1492,9 +1595,11 @@ WOK
end
end
def webserv_base #web url for local webserv (localhost, or hostname)
- if path.webserv_dir and path.webserv =~ /#{path.webserv_dir}/ #revisit
+ if path.webserv_dir \
+ and path.webserv =~ /#{path.webserv_dir}/ #revisit
"#{path.webserv}/#@stub_pwd".gsub(/#{path.webserv_dir}/,"#{url.hostname}")
- elsif defined? @rc['webserv']['webrick_url'] and @rc['webserv']['webrick_url'] == false
+ elsif defined? @rc['webserv']['webrick_url'] \
+ and @rc['webserv']['webrick_url'] == false
"file://#{path.webserv}"
else "#{url.webrick_base}"
end
@@ -1512,13 +1617,15 @@ WOK
end
end
def sample_search_form_title
- if defined? @rc['search']['sisu']['title'] and @rc['search']['sisu']['title'] =~/\S+/
+ if defined? @rc['search']['sisu']['title'] \
+ and @rc['search']['sisu']['title'] =~/\S+/
@rc['search']['sisu']['title']
else %{SiSU search form (sample):}
end
end
def output_tell
- output_type=if defined? @rc['show_output_on'] and @rc['show_output_on'] =~/^(?:filesystem|webserv|(?:local|remote)(?:_webserv)?|webrick)/
+ output_type=if defined? @rc['show_output_on'] \
+ and @rc['show_output_on'] =~/^(?:filesystem|webserv|(?:local|remote)(?:_webserv)?|webrick)/
@rc['show_output_on']
else 'filesystem'
end
@@ -1587,7 +1694,8 @@ WOK
end
def digest
def type
- if defined? @rc['default']['digest'] and @rc['default']['digest'] != nil
+ if defined? @rc['default']['digest'] \
+ and @rc['default']['digest'] != nil
case @rc['default']['digest']
when /^sha(?:2|256)?$/; 'sha256'
when /^md5$/; 'md5'
@@ -1610,23 +1718,28 @@ WOK
end
def program
def text_editor
- if defined? @rc['program_select']['editor'] and @rc['program_select']['editor'] =~/\S\S+/
+ if defined? @rc['program_select']['editor'] \
+ and @rc['program_select']['editor'] =~/\S\S+/
@rc['program_select']['editor']
- elsif defined? @rc['program_select']['text_editor'] and @rc['program_select']['text_editor'] =~/\S\S+/
+ elsif defined? @rc['program_select']['text_editor'] \
+ and @rc['program_select']['text_editor'] =~/\S\S+/
@rc['program_select']['text_editor']
else 'editor' #'gvim -c :R -c :S'
end
end
def pdf_viewer
- if defined? @rc['program_select']['pdf_viewer'] and @rc['program_select']['pdf_viewer'] =~/\S\S+/
+ if defined? @rc['program_select']['pdf_viewer'] \
+ and @rc['program_select']['pdf_viewer'] =~/\S\S+/
@rc['program_select']['pdf_viewer']
else 'pdf-viewer' #'evince'
end
end
def web_browser
- if defined? @rc['program_select']['www_browser'] and @rc['program_select']['www_browser'] =~/\S\S+/
+ if defined? @rc['program_select']['www_browser'] \
+ and @rc['program_select']['www_browser'] =~/\S\S+/
@rc['program_select']['www_browser']
- elsif defined? @rc['program_select']['web_browser'] and @rc['program_select']['web_browser'] =~/\S\S+/
+ elsif defined? @rc['program_select']['web_browser'] \
+ and @rc['program_select']['web_browser'] =~/\S\S+/
@rc['program_select']['web_browser']
else 'x-www-browser' #'kazehakase' 'galeon'
end
@@ -1635,9 +1748,11 @@ WOK
web_browser
end
def console_web_browser
- if defined? @rc['program_select']['console_www_browser'] and @rc['program_select']['console_www_browser'] =~/\S\S+/
+ if defined? @rc['program_select']['console_www_browser'] \
+ and @rc['program_select']['console_www_browser'] =~/\S\S+/
@rc['program_select']['console_www_browser']
- elsif defined? @rc['program_select']['console_web_browser'] and @rc['program_select']['console_web_browser'] =~/\S\S+/
+ elsif defined? @rc['program_select']['console_web_browser'] \
+ and @rc['program_select']['console_web_browser'] =~/\S\S+/
@rc['program_select']['console_web_browser']
else 'console-www-browser' #'links2' 'elinks' 'epiphany'
end
@@ -1646,7 +1761,8 @@ WOK
web_browser
end
def xml_viewer
- if defined? @rc['program_select']['xml_viewer'] and @rc['program_select']['xml_viewer'] =~/\S\S+/
+ if defined? @rc['program_select']['xml_viewer'] \
+ and @rc['program_select']['xml_viewer'] =~/\S\S+/
@rc['program_select']['xml_viewer']
else text_editor
end
@@ -1655,44 +1771,58 @@ WOK
xml_viewer
end
def odf_viewer
- if defined? @rc['program_select']['odf_viewer'] and @rc['program_select']['odf_viewer'] =~/\S\S+/
+ if defined? @rc['program_select']['odf_viewer'] \
+ and @rc['program_select']['odf_viewer'] =~/\S\S+/
@rc['program_select']['odf_viewer']
else 'oowriter' #'odf-viewer','oowriter'
end
end
def manpage_generator
- if defined? @rc['program_select']['man'] and @rc['program_select']['man'] =~/\S\S+/
+ if defined? @rc['program_select']['man'] \
+ and @rc['program_select']['man'] =~/\S\S+/
@rc['program_select']['man']
else 'nroff -man' #'nroff -man' #'groff -man -Tascii'
end
end
def file_encoding #file encoding
is=''
- if defined? @rc['program_set']['file_encoding']; is=@rc['program_set']['encoding']
+ if defined? @rc['program_set']['file_encoding']
+ is=@rc['program_set']['encoding']
end
- if is.nil? or is==true; is='encoding'
+ if is.nil? \
+ or is==true
+ is='encoding'
end
is
end
def wc #wordcount
is=''
- if defined? @rc['program_set']['wc']; is=@rc['program_set']['wc']
+ if defined? @rc['program_set']['wc']
+ is=@rc['program_set']['wc']
end
- if is.nil? or is==true; is='wc'
+ if is.nil? \
+ or is==true
+ is='wc'
end
is
end
def tidy
- if defined? @rc['program_set']['tidy']; is=@rc['program_set']['tidy']
+ if defined? @rc['program_set']['tidy']
+ is=@rc['program_set']['tidy']
end
- if is.nil? or is==true; is='tidy'
+ if is.nil? \
+ or is==true
+ is='tidy'
end
is
end
def rmagick
- if defined? @rc['program_set']['rmagick']; is=@rc['program_set']['rmagick']
+ if defined? @rc['program_set']['rmagick']
+ is=@rc['program_set']['rmagick']
end
- if is.nil? or is==true; is='rmagick'
+ if is.nil? \
+ or is==true
+ is='rmagick'
end
is
end
@@ -1704,7 +1834,9 @@ WOK
is=if defined? @rc['program_set']['rexml']; @rc['program_set']['rexml']
else ''
end
- if is.nil? or is==true; is='rexml'
+ if is.nil? \
+ or is==true
+ is='rexml'
end
is
end
@@ -1712,7 +1844,9 @@ WOK
is=if defined? @rc['program_set']['pdflatex']; @rc['program_set']['pdflatex']
else ''
end
- if is.nil? or is==true; is='pdflatex'
+ if is.nil? \
+ or is==true
+ is='pdflatex'
end
is
end
@@ -1720,7 +1854,9 @@ WOK
is=if defined? @rc['program_set']['postgresql']; @rc['program_set']['postgresql']
else ''
end
- if is.nil? or is==true; is='postgresql'
+ if is.nil? \
+ or is==true
+ is='postgresql'
end
is
end
@@ -1728,7 +1864,9 @@ WOK
is=if defined? @rc['program_set']['sqlite']; @rc['program_set']['sqlite']
else ''
end
- if is.nil? or is==true; is='sqlite'
+ if is.nil? \
+ or is==true
+ is='sqlite'
end
is
end
@@ -1749,19 +1887,22 @@ WOK
SiSU_Env::Standardise_language.new(l)
end
def multilingual
- if defined? @rc['default']['multilingual'] and @rc['default']['multilingual'] != nil; @rc['default']['multilingual']
+ if defined? @rc['default']['multilingual'] \
+ and @rc['default']['multilingual'] != nil; @rc['default']['multilingual']
else defaults[:multilingual]
end
end
def lang_filename(l)
@lang={}
x=if multilingual
- x=if defined? @rc['default']['language_file'] and @rc['default']['language_file'] != nil; @rc['default']['language_file']
+ x=if defined? @rc['default']['language_file'] \
+ and @rc['default']['language_file'] != nil; @rc['default']['language_file']
else 1
end
else 0
end
- if (l != defaults[:language_code]) or (language.code != defaults[:language_code]) #watch
+ if (l != defaults[:language_code]) \
+ or (language.code != defaults[:language_code]) #watch
if x==1; @lang[:pre],@lang[:mid],@lang[:post]="#{l}.",'',''
elsif x==2; @lang[:pre],@lang[:mid],@lang[:post]='',".#{l}",''
elsif x==3; @lang[:pre],@lang[:mid],@lang[:post]='','',".#{l}"
@@ -1777,7 +1918,8 @@ WOK
is=''
if defined? @rc['program_set']['file_encoding']; is=@rc['program_set']['encoding']
end
- if is.nil? or is==true; is='encoding'
+ if is.nil? \
+ or is==true; is='encoding'
end
is
end
@@ -1793,8 +1935,13 @@ WOK
def sisupod_gen(fns_pod)
pwd=Dir.pwd
sisupod_processing_path="#{path.processing}/sisupod"
- rm_rf(sisupod_processing_path) if FileTest.directory?(sisupod_processing_path) or FileTest.file?(sisupod_processing_path)
- File.mkpath(sisupod_processing_path) unless FileTest.directory?(sisupod_processing_path)
+ if FileTest.directory?(sisupod_processing_path) \
+ or FileTest.file?(sisupod_processing_path)
+ rm_rf(sisupod_processing_path)
+ end
+ unless FileTest.directory?(sisupod_processing_path)
+ File.mkpath(sisupod_processing_path)
+ end
if FileTest.file?("#{Dir.pwd}/#{fns_pod}")
system("unzip -q #{Dir.pwd}/#{fns_pod} -d #{path.processing}")
else
@@ -1815,43 +1962,49 @@ WOK
end
end
def cf_0 #processing flag shortcuts
- if defined? @rc['flag']['default'] and
- not (@rc['flag']['default'].nil? or @rc['flag']['default'].empty?)
+ if defined? @rc['flag']['default'] \
+ and not (@rc['flag']['default'].nil? \
+ or @rc['flag']['default'].empty?)
@rc['flag']['default']
else '-NhwpaobxXyYv'
end
end
def cf_1 #processing flag shortcuts
- if defined? @rc['flag']['i'] and
- not (@rc['flag']['i'].nil? or @rc['flag']['i'].empty?)
+ if defined? @rc['flag']['i'] \
+ and not (@rc['flag']['i'].nil? \
+ or @rc['flag']['i'].empty?)
@rc['flag']['i']
else '-hwpoy'
end
end
def cf_2 #processing flag shortcuts
- if defined? @rc['flag']['ii'] and
- not (@rc['flag']['ii'].nil? or @rc['flag']['ii'].empty?)
+ if defined? @rc['flag']['ii'] \
+ and not (@rc['flag']['ii'].nil? \
+ or @rc['flag']['ii'].empty?)
@rc['flag']['ii']
else '-NhwpaobxXy'
end
end
def cf_3 #processing flag shortcuts
- if defined? @rc['flag']['iii'] and
- not (@rc['flag']['iii'].nil? or @rc['flag']['iii'].empty?)
+ if defined? @rc['flag']['iii'] \
+ and not (@rc['flag']['iii'].nil? \
+ or @rc['flag']['iii'].empty?)
@rc['flag']['iii']
else '-NhwpaobxXyY'
end
end
def cf_4 #processing flag shortcuts
- if defined? @rc['flag']['iv'] and
- not (@rc['flag']['iv'].nil? or @rc['flag']['iv'].empty?)
+ if defined? @rc['flag']['iv'] \
+ and not (@rc['flag']['iv'].nil? \
+ or @rc['flag']['iv'].empty?)
@rc['flag']['iv']
else '-NhwpaobxXDyY --import'
end
end
def cf_5 #processing flag shortcuts
- if defined? @rc['flag']['v'] and
- not (@rc['flag']['v'].nil? or @rc['flag']['v'].empty?)
+ if defined? @rc['flag']['v'] \
+ and not (@rc['flag']['v'].nil? \
+ or @rc['flag']['v'].empty?)
@rc['flag']['v']
else '-NhwpaobxXDyY --update'
end
@@ -1875,7 +2028,8 @@ WOK
super()
@opt=opt #,opt.fns,opt.cmd
#@file=@opt.fns #not always fns
- @env=if @opt.fns and not @opt.fns.empty?
+ @env=if @opt.fns \
+ and not @opt.fns.empty?
SiSU_Env::Info_env.new(@opt.fns)
else
SiSU_Env::Info_env.new('dummy.sst')
@@ -1883,74 +2037,85 @@ WOK
if @opt.cmd =~/m/; @md=SiSU_Param::Parameters.new(@opt).get
end
ft=[]
- if @md and defined? @md.fn and @md.fn # used for multilingual
- if @md.cmd =~ /[hH]/; ft << @md.fn[:html]
+ if @md \
+ and defined? @md.fn \
+ and @md.fn # used for multilingual
+ if @md.cmd =~ /[hH]/
+ ft << @md.fn[:html]
end
- if @md.cmd =~ /w/ and @md.cmd !~ /[hH]/; ft << @md.fn[:concordance]
+ if @md.cmd =~ /w/ \
+ and @md.cmd !~ /[hH]/
+ ft << @md.fn[:concordance]
end
- if @md.cmd =~ /y/ and @md.cmd !~ /[hH]/; ft << @md.fn[:manifest]
+ if @md.cmd =~ /y/ \
+ and @md.cmd !~ /[hH]/
+ ft << @md.fn[:manifest]
end
- if @md.cmd =~ /p/; ft << @md.fn[:pdf_l] << @md.fn[:pdf_p]
+ if @md.cmd =~ /p/; ft << @md.fn[:pdf_l] << @md.fn[:pdf_p]
end
- if @md.cmd =~ /x/; ft << @md.fn[:sax]
+ if @md.cmd =~ /x/; ft << @md.fn[:sax]
end
- if @md.cmd =~ /X/; ft << @md.fn[:dom]
+ if @md.cmd =~ /X/; ft << @md.fn[:dom]
end
- if @md.cmd =~ /b/; ft << @md.fn[:xhtml]
+ if @md.cmd =~ /b/; ft << @md.fn[:xhtml]
end
- if @md.cmd =~ /a/; ft << @md.fn[:plain]
+ if @md.cmd =~ /a/; ft << @md.fn[:plain]
end
- if @md.cmd =~ /i/; ft << @md.fn[:manpage]
+ if @md.cmd =~ /i/; ft << @md.fn[:manpage]
end
- if @md.cmd =~ /[g]/; ft << @md.fn[:wiki]
+ if @md.cmd =~ /[g]/; ft << @md.fn[:wiki]
end
- if @md.cmd =~ /N/; ft << @md.fn[:digest]
+ if @md.cmd =~ /N/; ft << @md.fn[:digest]
end
- if @md.cmd =~ /o/; ft << @md.fn[:odf]
+ if @md.cmd =~ /o/; ft << @md.fn[:odf]
end
- if @md.cmd =~ /O/; ft << @md.fn[:oai_pmh]
+ if @md.cmd =~ /O/; ft << @md.fn[:oai_pmh]
end
- if @md.cmd =~ /s/; ft << @md.fns
+ if @md.cmd =~ /s/; ft << @md.fns
end
- if @md.cmd =~ /S/; ft << @md.fn[:sisupod] << '.kdi'
+ if @md.cmd =~ /S/; ft << @md.fn[:sisupod] << '.kdi'
end
@fnb=@md.fnb
else # still needed where/when param is not parsed
- if @opt.cmd =~ /[hH]/; ft << '.html' << '.html.??'
+ if @opt.cmd =~ /[hH]/; ft << '.html' << '.html.??'
end
- if @opt.cmd =~ /w/ and @opt.cmd !~ /[hH]/; ft << 'concordance.html' << '??.concordance.html' << 'concordance.??.html'
+ if @opt.cmd =~ /w/ \
+ and @opt.cmd !~ /[hH]/
+ ft << 'concordance.html' << '??.concordance.html' << 'concordance.??.html'
end
- if @opt.cmd =~ /y/ and @opt.cmd !~ /[hH]/; ft << 'sisu_manifest.html' << '??.sisu_manifest.html' << 'sisu_manifest.??.html'
+ if @opt.cmd =~ /y/ \
+ and @opt.cmd !~ /[hH]/
+ ft << 'sisu_manifest.html' << '??.sisu_manifest.html' << 'sisu_manifest.??.html'
end
- if @opt.cmd =~ /p/; ft << 'landscape.pdf' << 'portrait.pdf' << '.pdf'
+ if @opt.cmd =~ /p/; ft << 'landscape.pdf' << 'portrait.pdf' << '.pdf'
end
- if @opt.cmd =~ /x/; ft << 'sax.xml' << '??.sax.xml' << 'sax.??.xml'
+ if @opt.cmd =~ /x/; ft << 'sax.xml' << '??.sax.xml' << 'sax.??.xml'
end
- if @opt.cmd =~ /X/; ft << 'dom.xml' << '??.dom.xml' << 'dom.??.xml'
+ if @opt.cmd =~ /X/; ft << 'dom.xml' << '??.dom.xml' << 'dom.??.xml'
end
- if @opt.cmd =~ /b/; ft << 'scroll.xhtml' << '??.scroll.xhtml' << 'scroll.??.xhtml'
+ if @opt.cmd =~ /b/; ft << 'scroll.xhtml' << '??.scroll.xhtml' << 'scroll.??.xhtml'
end
- if @opt.cmd =~ /i/; ft << '.1' << '??.man.1' << 'man.??.1'
+ if @opt.cmd =~ /i/; ft << '.1' << '??.man.1' << 'man.??.1'
end
- if @opt.cmd =~ /a/; ft << 'plain.txt' << '??.plain.txt' << 'plain.??.txt'
+ if @opt.cmd =~ /a/; ft << 'plain.txt' << '??.plain.txt' << 'plain.??.txt'
end
- if @opt.cmd =~ /[g]/; ft << 'wiki.txt' << '??.wiki.txt' << 'wiki.??.txt'
+ if @opt.cmd =~ /[g]/; ft << 'wiki.txt' << '??.wiki.txt' << 'wiki.??.txt'
end
- if @opt.cmd =~ /N/; ft << 'digest.txt' << '??.digest.txt' << 'digest.??.txt'
+ if @opt.cmd =~ /N/; ft << 'digest.txt' << '??.digest.txt' << 'digest.??.txt'
end
- if @opt.cmd =~ /o/; ft << 'opendocument.odt' << '??.opendocument.odt' << 'opendocument.??.odt'
+ if @opt.cmd =~ /o/; ft << 'opendocument.odt' << '??.opendocument.odt' << 'opendocument.??.odt'
end
- if @opt.cmd =~ /O/; ft << 'oai_pmh.xml'
+ if @opt.cmd =~ /O/; ft << 'oai_pmh.xml'
end
- if @opt.cmd =~ /s/; ft << '.sst' << '.ssi' << '.ssm'
+ if @opt.cmd =~ /s/; ft << '.sst' << '.ssi' << '.ssm'
end
- if @opt.cmd =~ /S/; ft << '.zip' << '.kdi'
+ if @opt.cmd =~ /S/; ft << '.zip' << '.kdi'
end
- if @opt.mod.inspect =~ /sxm|sxs|xml/; ft << @fnb << '.sxs.xml'
+ if @opt.mod.inspect =~ /sxm|sxs|xml/; ft << @fnb << '.sxs.xml'
end
- if @opt.mod.inspect =~ /sxd/; ft << @fnb << '.sxd.xml'
+ if @opt.mod.inspect =~ /sxd/; ft << @fnb << '.sxd.xml'
end
- if @opt.mod.inspect =~ /sxn/; ft << @fnb << '.sxn.xml'
+ if @opt.mod.inspect =~ /sxn/; ft << @fnb << '.sxn.xml'
end
end
ft=ft.uniq
@@ -1960,11 +2125,15 @@ WOK
elsif filetypes =~/\S+?,\S+/; '*{' + filetypes + '}' # more than one relevant file type
else '*' + filetypes # one relevant file type
end
- @source_path=if @fnb and not @fnb.empty?; "#{@env.path.output}/#@fnb"
- else @env.path.output
+ @source_path=if @fnb \
+ and not @fnb.empty?
+ "#{@env.path.output}/#@fnb"
+ else @env.path.output
end
- @source_path_src=if @fnb and not @fnb.empty?; "#{@env.path.output}/src"
- else @env.path.output_src
+ @source_path_src=if @fnb \
+ and not @fnb.empty?
+ "#{@env.path.output}/src"
+ else @env.path.output_src
end
@local_sisu_source=if @filetypes =~/\S/; "#@source_path/#@filetypes"
else @source_path
@@ -1993,7 +2162,8 @@ WOK
#System_call.new(@zap,'',@cmd).rm
end
def zap_map
- if @opt.fnb and not @opt.fnb.empty?
+ if @opt.fnb \
+ and not @opt.fnb.empty?
sm="#{@env.path.output}/sitemaps/sitemap_#{@opt.fnb}.xml"
rm(sm) if FileTest.file?(sm)
end
@@ -2005,11 +2175,13 @@ WOK
end
def remote_host #see Info_remote remote_host_base_general
r=[]
- r=if (defined? @rc['remote'] and @rc['remote'].class==Array)
+ r=if (defined? @rc['remote'] \
+ and @rc['remote'].class==Array)
r_array=@rc['remote']
r_array.each_with_index do |renv,i|
r[i]={}
- if defined? renv['user'] and defined? renv['host']
+ if defined? renv['user'] \
+ and defined? renv['host']
end
r[i][:user]=renv['user']
r[i][:host]=renv['host']
@@ -2020,7 +2192,10 @@ WOK
r[i][:name]="#{r[i][:user]}@#{r[i][:host]}:#{r[i][:path]}"
end
r
- elsif (defined? @rc['remote'] and @rc['remote'].class==Hash and defined? @rc['remote']['user'] and defined? @rc['remote']['host'])
+ elsif (defined? @rc['remote'] \
+ and @rc['remote'].class==Hash \
+ and defined? @rc['remote']['user'] \
+ and defined? @rc['remote']['host'])
r[0]={}
r[0][:user]=@rc['remote']['user']
r[0][:host]=@rc['remote']['host']
@@ -2112,15 +2287,22 @@ WOK
remote_src="#{remote_conn[:name]}/#{@env.path.stub_src}/."
src_txt=@opt.fnc
src_pod=@opt.fncb.gsub(/(\.ss[mt])(?:\.sst)?$/,'\1.zip')
- if (local_gen =~/\S/ and local_gen !~/\/\//) and (remote_gen =~/\S/ and remote_gen !~/\/\//) and @@flag_remote==true and @opt.cmd !~/U/
+ if (local_gen =~/\S/ \
+ and local_gen !~/\/\//) \
+ and (remote_gen =~/\S/ \
+ and remote_gen !~/\/\//) \
+ and @@flag_remote==true \
+ and @opt.cmd !~/U/
System_call.new(local_gen,remote_gen).scp
- if FileTest.file?("#{local_src}/#{src_txt}") or FileTest.file?("#{local_src}/#{src_pod}")
+ if FileTest.file?("#{local_src}/#{src_txt}") \
+ or FileTest.file?("#{local_src}/#{src_pod}")
System_call.new("#{local_src}/#{src_txt} #{local_src}/#{src_pod}",remote_src).scp
end
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "#{local_gen} -> #{remote_gen}"
- if FileTest.file?("#{local_src}/#{src_doc}") or FileTest.file?("#{local_src}/#{src_doc}.zip")
+ if FileTest.file?("#{local_src}/#{src_doc}") \
+ or FileTest.file?("#{local_src}/#{src_doc}.zip")
puts "#{local_src}/#{src_doc}* -> #{remote_src}"
end
else
@@ -2138,15 +2320,22 @@ WOK
remote_src="#{remote_conn[:name]}/#{@env.path.stub_src}/."
src_txt=@opt.fnc
src_pod=@opt.fncb.gsub(/(\.ss[mt])(?:\.sst)?$/,'\1.zip')
- if (local_gen =~/\S/ and local_gen !~/\/\//) and (remote_gen =~/\S/ and remote_gen !~/\/\//) and @@flag_remote==true and @opt.cmd !~/U/
+ if (local_gen =~/\S/ \
+ and local_gen !~/\/\//) \
+ and (remote_gen =~/\S/ \
+ and remote_gen !~/\/\//) \
+ and @@flag_remote==true \
+ and @opt.cmd !~/U/
System_call.new(local_gen,remote_gen,@opt.cmd).rsync('--delete-after')
- if FileTest.file?("#{local_src}/#{src_txt}") or FileTest.file?("#{local_src}/#{src_pod}")
+ if FileTest.file?("#{local_src}/#{src_txt}") \
+ or FileTest.file?("#{local_src}/#{src_pod}")
System_call.new("#{local_src}/#{src_txt} #{local_src}/#{src_pod}",remote_src,@opt.cmd).rsync
end
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "#{local_gen} -> #{remote_gen}"
- if FileTest.file?("#{local_src}/#{src_doc}") or FileTest.file?("#{local_src}/#{src_doc}.zip")
+ if FileTest.file?("#{local_src}/#{src_doc}") \
+ or FileTest.file?("#{local_src}/#{src_doc}.zip")
puts "#{local_src}/#{src_doc}* -> #{remote_src}"
end
else
@@ -2160,7 +2349,10 @@ WOK
self.remote_host_base.each do |remote_conn|
local=@source_path
remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
- if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
+ if defined? @rc['permission_set']['remote_base_site'] \
+ and @rc['permission_set']['remote_base_site'] \
+ and @@flag_remote==true \
+ and @opt.cmd !~/U/
puts "begin scp_base: #{local} -> #{remote}"
System_call.new("#{local}/#{@env.path.style}/",remote).scp
elsif @opt.cmd =~/U/
@@ -2175,7 +2367,10 @@ WOK
self.remote_host_base.each do |remote_conn|
local=@source_path
remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
- if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
+ if defined? @rc['permission_set']['remote_base_site'] \
+ and @rc['permission_set']['remote_base_site'] \
+ and @@flag_remote==true \
+ and @opt.cmd !~/U/
puts "begin scp_base_all: #{local} -> #{remote}"
System_call.new("#{local}/_sisu/image/",remote).scp
System_call.new("#{local}/_sisu/image_local/",remote).scp
@@ -2191,14 +2386,18 @@ WOK
end
end
def rsync_base #base site
+ ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu"
+ image_sys="#{@env.path.webserv}/_sisu/image_sys"
self.remote_host_base.each do |remote_conn|
- local=@source_path
remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
- if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
+ remote_sys="#{remote_conn[:name]}/_sisu"
+ if defined? @rc['permission_set']['remote_base_site'] \
+ and @rc['permission_set']['remote_base_site'] \
+ and @@flag_remote==true \
+ and @opt.cmd !~/U/
#puts "begin rsync_base: #{local} -> #{remote}"
- #System_call.new("#{local}/_sisu/image/",remote).rsync
- #System_call.new("#{local}/_sisu/image_local/",remote).rsync
- #System_call.new("#{local}/#{@env.path.style}/",remote).rsync
+ System_call.new("#{image_sys}","#{remote_sys}").rsync
+ System_call.new("#{ldest}","#{remote}").rsync
elsif @opt.cmd =~/U/
puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
puts "rsync_base: #{local} -> #{remote}"
@@ -2213,7 +2412,10 @@ WOK
self.remote_host_base.each do |remote_conn|
local=@source_path
remote="#{remote_conn[:name]}/#{@env.path.stub_pwd}/."
- if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
+ if defined? @rc['permission_set']['remote_base_site'] \
+ and @rc['permission_set']['remote_base_site'] \
+ and @@flag_remote==true \
+ and @opt.cmd !~/U/
puts "begin rsync_base_sync: #{local} -> #{remote}"
System_call.new("#{local}/_sisu/image/",remote).rsync('--delete-after')
System_call.new("#{local}/_sisu/image_local/",remote).rsync('--delete-after')
@@ -2265,8 +2467,13 @@ WOK
@env=SiSU_Env::Info_env.new
end
def images
- File.mkpath("#{@env.path.output}/_sisu") unless FileTest.directory?("#{@env.path.output}/_sisu")
- File.symlink("../../_sisu/image_sys", "#{@env.path.output}/_sisu/image_sys") unless File.exist?("#{@env.path.output}/_sisu/image_sys") or File.symlink?("#{@env.path.output}/_sisu/image_sys")
+ unless FileTest.directory?("#{@env.path.output}/_sisu")
+ File.mkpath("#{@env.path.output}/_sisu")
+ end
+ unless File.exist?("#{@env.path.output}/_sisu/image_sys") \
+ or File.symlink?("#{@env.path.output}/_sisu/image_sys")
+ File.symlink("../../_sisu/image_sys", "#{@env.path.output}/_sisu/image_sys")
+ end
end
def man_forms
#File.symlink("../../man/form", "#{@env.path.output}/man/form") unless File.symlink?("#{@env.path.output}/man/form") == true
@@ -2324,7 +2531,8 @@ WOK
"#{@env.path.webserv}/#@pwd_stub/sisu_sqlite.db"
end
def port_psql #PGPORT
- if defined? @rc['db']['postgresql']['port'] and @rc['db']['postgresql']['port'] =~/\d+/
+ if defined? @rc['db']['postgresql']['port'] \
+ and @rc['db']['postgresql']['port'] =~/\d+/
@rc['db']['postgresql']['port']
else @defaults[:postgresql_port]
end
@@ -2361,7 +2569,9 @@ WOK
def initialize(md=nil,skin=nil)
@md=md
@d_sk=if skin.class==String ; skin
- elsif defined? md.doc_skin and md.doc_skin; md.doc_skin
+ elsif defined? md.doc_skin \
+ and md.doc_skin
+ md.doc_skin
else nil
end
@home,@pwd=ENV['HOME'],ENV['PWD']
@@ -2376,7 +2586,9 @@ WOK
skin_path << "#{@env.path.processing}/external_document/skin"
#skin_path << "#{@env.path.processing}/external_document/_sisu/skin" #revisit
skin=true
- if @pwd_stub =~/^sisupod$/ and @md.mod.inspect !~/--trust/; skin=false #security only run skins on sisupod if --trust flag is provided
+ if @pwd_stub =~/^sisupod$/ \
+ and @md.mod.inspect !~/--trust/
+ skin=false #security only run skins on sisupod if --trust flag is provided
end
doc_skin,dir_skin=nil,nil
if skin
@@ -2436,7 +2648,8 @@ WOK
@env=SiSU_Env::Info_env.new
end
def html
- css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_html.css")
+ css=if @md.doc_css \
+ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_html.css")
"#{@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"
@@ -2444,7 +2657,8 @@ WOK
end
end
def html_tables
- css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_html_tables.css")
+ css=if @md.doc_css \
+ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_html_tables.css")
"#{@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"
@@ -2452,7 +2666,8 @@ WOK
end
end
def xhtml
- css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xhtml.css")
+ css=if @md.doc_css \
+ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xhtml.css")
"#{@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"
@@ -2460,7 +2675,8 @@ WOK
end
end
def xml_sax
- css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xml_sax.css")
+ css=if @md.doc_css \
+ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xml_sax.css")
"#{@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"
@@ -2468,7 +2684,8 @@ WOK
end
end
def xml_dom
- css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xml_dom.css")
+ css=if @md.doc_css \
+ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_xml_dom.css")
"#{@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"
@@ -2476,7 +2693,8 @@ WOK
end
end
def docbook_xml
- css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_docbook.css")
+ css=if @md.doc_css \
+ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_docbook.css")
"#{@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"
@@ -2484,7 +2702,8 @@ WOK
end
end
def homepage
- css=if @md.doc_css and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_homepage.css")
+ css=if @md.doc_css \
+ and FileTest.file?("#{@env.path.output}/#{@env.path.style}/#{@md.doc_css}_homepage.css")
"#{@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"
@@ -2575,7 +2794,8 @@ WOK
when /sql/
when /xml|plaintext|ascii/; @env_out="#{@env.path.output}/#@fnb" #check change of name to plaintext from ascii
else
- if defined? @md.sfx_src and @md.sfx_src =~/ss[ftsumc]/
+ if defined? @md.sfx_src \
+ and @md.sfx_src =~/ss[ftsumc]/
@env_suf='lm'
@env_out_root=@env.path.output
@env_out="#{@env.path.output}/#@fnb"
@@ -2670,7 +2890,8 @@ WOK
end
end
File.mkpath("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}")
- if homepage_path and FileTest.file?(homepage_path)
+ if homepage_path \
+ and FileTest.file?(homepage_path)
cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/index.html")
cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/toc.html")
else
@@ -2726,7 +2947,8 @@ WOK
def cp_css
File.mkpath("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}")
css_path=['/etc/sisu/css',"#@home/.sisu/css","#@pwd/_sisu/css"] #BROKEN
- if defined? @rc['permission_set']['css_modify'] and @rc['permission_set']['css_modify']
+ if defined? @rc['permission_set']['css_modify'] \
+ and @rc['permission_set']['css_modify']
tell=SiSU_Screen::Ansi.new(@cmd,"modify is css set to: #{@rc['permission_set']['css_modify']}")
css_path.each do |x|
if FileTest.directory?(x)