aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/sysenv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/sysenv.rb')
-rw-r--r--lib/sisu/v3/sysenv.rb58
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index acc38507..977fd3fe 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -264,8 +264,8 @@ module SiSU_Env
require @prog
else
@mandatory \
- ? (SiSU_Screen::Ansi.new(@cmd,"module required: #{@prog}").warn)
- : (SiSU_Screen::Ansi.new(@cmd,"#{@prog} load requested").warn)
+ ? (SiSU_Screen::Ansi.new(@cmd,"*WARN* module required: #{@prog}").warn)
+ : (SiSU_Screen::Ansi.new(@cmd,"*WARN* #{@prog} load requested").warn)
end
load_prog
end
@@ -300,7 +300,7 @@ module SiSU_Env
@yamlrc_path.each do |v|
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
+ STDERR.puts "WARNING - YAML loading switched off, to enable delete the file:\n\t#{v}/noyaml\n\n" unless @@noyaml
@@noyaml=true
break
else
@@ -657,7 +657,7 @@ module SiSU_Env
program='rcs'
program_ref="\n\t\tdocument version information requested"
if program_found?(program); true
- else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ else STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" #if @cmd =~/v/
false
end
end
@@ -665,7 +665,7 @@ module SiSU_Env
program='cvs'
program_ref="\n\t\tdocument version information requested"
if program_found?(program); true
- else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ else STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" #if @cmd =~/v/
false
end
end
@@ -673,7 +673,7 @@ module SiSU_Env
program='openssl'
program_ref="\n\t\tused to generate requested source document identification digest"
if program_found?(program); true
- else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ else STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" #if @cmd =~/v/
false
end
end
@@ -686,7 +686,7 @@ module SiSU_Env
dgst=%x{openssl dgst -md5 #{File.basename(filename)}}.strip #use file name without file path
Dir.chdir(pwd)
dgst.scan(/\S+/)
- else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ else STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" #if @cmd =~/v/
false
end
end
@@ -699,7 +699,7 @@ module SiSU_Env
dgst=%x{openssl dgst -sha256 #{File.basename(filename)}}.strip #use file name without file path
Dir.chdir(pwd)
dgst.scan(/\S+/)
- else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ else STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" #if @cmd =~/v/
false
end
end
@@ -707,7 +707,7 @@ module SiSU_Env
program='psql'
program_ref="\n\t\tpsql requested"
if program_found?(program); true
- else puts "\tWARN: #{program} is not installed #{program_ref}" #if @cmd =~/v/
+ else STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" #if @cmd =~/v/
false
end
end
@@ -722,14 +722,14 @@ module SiSU_Env
program_ref="\n\t\tcreatedb dbname #{db_name} #for postgresql database creation"
(program_found?(program)) \
? system("#{program} #{dbname_name}")
- : (puts "\tWARN: #{program} is not available #{program_ref}")
+ : (STDERR.puts "\t*WARN* #{program} is not available #{program_ref}")
end
def relaxng(cmd='') #trang - convert between different schema languages for XML
program='trang'
program_ref="\n\t\tsee <http://www.thaiopensource.com/relaxng/trang.html>"
(program_found?(program)) \
? system("#{program} #{@input} #{@output}")
- : (puts "\tWARN: #{program} is not installed #{program_ref}" if cmd =~/V/)
+ : (STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" if cmd =~/V/)
end
def qrencode #qrcode - for generating QR code
program='qrencode'
@@ -739,21 +739,21 @@ module SiSU_Env
? (system(%{
echo "#{@input}" | #{program} -s 3 -o #{@output}
}))
- : (puts "\tWARN: #{program} is not installed #{program_ref}" if cmd =~/V/)
+ : (STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" if cmd =~/V/)
#found
end
def imagemagick #imagemagick is a image manipulation program
program='identify'
program_ref="\n\t\tsee <http://www.imagemagick.org/>"
found=(program_found?(program)) ? true : false
- puts "\tWARN: #{program} is not installed #{program_ref}" unless found
+ STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" unless found
found
end
def graphicksmagick #graphicsmagick is a image manipulation program
program='gm'
program_ref="\n\t\tsee <http://www.graphicsmagick.org/>"
found=(program_found?(program)) ? true : false
- puts "\tWARN: #{program} is not installed #{program_ref}" unless found
+ STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}" unless found
found
end
def well_formed? #tidy - check for well formed xml xhtml etc.
@@ -761,7 +761,7 @@ module SiSU_Env
program_ref="\n\t\tsee <http://tidy.sourceforge.net/>"
(program_found?(program)) \
? system("#{@prog.tidy} -xml #{@input} > #{@output}")
- : (puts "\tWARN: #{program} is not installed #{program_ref}")
+ : (STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}")
end
def tex2pdf_engine
prog=['xetex','xelatex','pdflatex','pdfetex','pdftex']
@@ -799,7 +799,7 @@ module SiSU_Env
when /pdflatex/; "#{texpdf} -interaction=#{mode} #{@input} #{tell}\n"
end
system(texpdf_cmd)
- else puts "\tWARN: none of the following programs are installed: #{program[0]}, #{program[1]}, #{program[2]} is installed. #{program_ref}"
+ else STDERR.puts "\t*WARN* none of the following programs are installed: #{program[0]}, #{program[1]}, #{program[2]} is installed. #{program_ref}"
end
end
def makeinfo #texinfo
@@ -808,7 +808,7 @@ module SiSU_Env
program_ref="\n\t\tsee http://www.gnu.org/software/texinfo/"
(program_found?(program)) \
? system("#{program} #{options} #{@input}\n")
- : (puts "\tWARN: #{program} is not installed #{program_ref}")
+ : (STDERR.puts "\t*WARN* #{program} is not installed #{program_ref}")
end
def scp
program='scp'
@@ -816,7 +816,7 @@ module SiSU_Env
puts "scp disabled"
#(program_found?(program)) \
#? system("scp -Cr #{@input} #{@output}") \
- #: (puts "\tWARN: #{program} not found" )
+ #: (STDERR.puts "\t*WARN* #{program} not found" )
end
def rsync(action='',chdir=nil)
program='rsync'
@@ -840,7 +840,7 @@ module SiSU_Env
#{rsync_cmd} #{msg}
")
dir_return
- else puts "\tWARN: #{program} not found"
+ else STDERR.puts "\t*WARN* #{program} not found"
end
end
def rm
@@ -848,7 +848,7 @@ module SiSU_Env
elsif @cmd =~/V/; FileUtils::rm(@input)
elsif @cmd !~/q/; FileUtils::rm(@input)
elsif @cmd =~/q/; FileUtils::rm(@input)
- else puts "\tWARN: operation ignored"
+ else STDERR.puts "\t*WARN* operation ignored"
end
end
end
@@ -2694,7 +2694,7 @@ WOK
end
#system(tree) #enable if (/[vVM]/)
else
- SiSU_Screen::Ansi.new('',"file not found: #{fns_pod}").warn unless @cmd=~/q/
+ SiSU_Screen::Ansi.new('',"*WARN* file not found: #{fns_pod}").warn unless @cmd=~/q/
end
sisupod_processing_path
end
@@ -2710,7 +2710,7 @@ WOK
end
(FileTest.file?(fns_pod)) \
? system("unzip -q #{fns_pod} -d #{processing_path.processing}")
- : (SiSU_Screen::Ansi.new('',"file not found: #{fns_pod}").warn unless @cmd=~/q/)
+ : (SiSU_Screen::Ansi.new('',"*WARN* file not found: #{fns_pod}").warn unless @cmd=~/q/)
sisupod_processing_path
end
end
@@ -3445,12 +3445,12 @@ WOK
def make_file(path,filename)
(File.writable?("#{path}/.")) \
? File.new("#{path}/#{filename}",'w+')
- : (SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn)
+ : (SiSU_Screen::Ansi.new('',"*WARN* is the file or directory writable?, could not create #{filename}").warn)
end
def touch_file(path,filename)
if File.writable?("#{path}/.");
FileUtils::touch("#{path}/#{filename}")
- else SiSU_Screen::Ansi.new('',"is the file or directory writable?, could not create #{filename}").warn
+ else SiSU_Screen::Ansi.new('',"*WARN* is the file or directory writable?, could not create #{filename}").warn
end
end
def make_path(path)
@@ -4276,10 +4276,10 @@ WOK
self
end
def pdf_p
- puts 'ERROR not available due to multiple page format sizes'
+ STDERR.puts 'ERROR not available due to multiple page format sizes'
end
def pdf_l
- puts 'ERROR not available due to multiple page format sizes'
+ STDERR.puts 'ERROR not available due to multiple page format sizes'
end
def xhtml
def dir
@@ -5886,7 +5886,7 @@ WOK
FileUtils::chmod(0644,"#{dest_path}/#{i}")
end
FileUtils::cd(@pwd)
- else puts "\tWARN, did not find - #{src_path}"
+ else STDERR.puts %{\t*WARN* did not find - #{src_path} [#{__FILE__}:#{__LINE__}]}
end
end
def cp_local_images
@@ -5921,7 +5921,7 @@ WOK
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']
- SiSU_Screen::Ansi.new(@cmd,"modify is css set to: #{@rc['permission_set']['css_modify']}").warn if @cmd=~/[MV]/
+ SiSU_Screen::Ansi.new(@cmd,"*WARN* modify is css set to: #{@rc['permission_set']['css_modify']}").warn if @cmd=~/[MV]/
css_path.each do |x|
if FileTest.directory?(x)
FileUtils::cd(x)
@@ -5932,7 +5932,7 @@ WOK
FileUtils::cd(@pwd)
end
end
- else SiSU_Screen::Ansi.new(@cmd,"modify css is not set or is set to: false").warn if @cmd=~/[MV]/
+ else SiSU_Screen::Ansi.new(@cmd,"*WARN* modify css is not set or is set to: false").warn if @cmd=~/[MV]/
end
fn_css=SiSU_Env::CSS_Default.new
css=SiSU_Style::CSS.new