aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-11-11 00:08:04 -0500
committerRalph Amissah <ralph@amissah.com>2011-11-11 00:08:04 -0500
commitd17e7245922a9bdc9233ccfa0137dfdab5747356 (patch)
tree27c1c6e3866fe69af3de653bc1656b5be5740827 /lib
parentv3: 3.1.4 version & changelog "opened" (diff)
v3: FileUtils, make explicit calls (more verbose, easier to find)
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v3/composite.rb12
-rw-r--r--lib/sisu/v3/concordance.rb2
-rw-r--r--lib/sisu/v3/conf.rb16
-rw-r--r--lib/sisu/v3/embedded.rb8
-rw-r--r--lib/sisu/v3/epub.rb8
-rw-r--r--lib/sisu/v3/git.rb35
-rw-r--r--lib/sisu/v3/harvest.rb2
-rw-r--r--lib/sisu/v3/harvest_authors.rb4
-rw-r--r--lib/sisu/v3/harvest_topics.rb4
-rw-r--r--lib/sisu/v3/html_segments.rb4
-rw-r--r--lib/sisu/v3/hub.rb4
-rw-r--r--lib/sisu/v3/odf.rb14
-rw-r--r--lib/sisu/v3/po4a.rb4
-rw-r--r--lib/sisu/v3/share_src.rb8
-rw-r--r--lib/sisu/v3/share_src_kdissert.rb6
-rw-r--r--lib/sisu/v3/sisupod_make.rb20
-rw-r--r--lib/sisu/v3/sitemaps.rb4
-rw-r--r--lib/sisu/v3/sst_convert_markup.rb4
-rw-r--r--lib/sisu/v3/sysenv.rb160
-rw-r--r--lib/sisu/v3/termsheet.rb2
-rw-r--r--lib/sisu/v3/texinfo.rb2
-rw-r--r--lib/sisu/v3/texpdf.rb12
-rw-r--r--lib/sisu/v3/webrick.rb4
23 files changed, 155 insertions, 184 deletions
diff --git a/lib/sisu/v3/composite.rb b/lib/sisu/v3/composite.rb
index b269cc39..6dfcf0b2 100644
--- a/lib/sisu/v3/composite.rb
+++ b/lib/sisu/v3/composite.rb
@@ -58,10 +58,8 @@
=end
module SiSU_Assemble
- require 'fileutils'
require_relative 'sysenv' # sysenv.rb
class Remote_image
- include FileUtils
def initialize
@env=SiSU_Env::Info_env.new
end
@@ -72,7 +70,7 @@ module SiSU_Assemble
end
def download_images(images_info)
path="#{@env.processing_path.processing}/external_document/image"
- mkdir_p(path) unless FileTest.directory?(path)
+ FileUtils::mkdir_p(path) unless FileTest.directory?(path)
download_from=images_info.shift
images_info.each do |i|
image="#{path}/#{i}"
@@ -83,12 +81,12 @@ module SiSU_Assemble
imagefile.close
end
output_path="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external"
- mkdir_p(output_path) unless FileTest.directory?(output_path)
+ FileUtils::mkdir_p(output_path) unless FileTest.directory?(output_path)
SiSU_Env::System_call.new("#{path}/*",output_path,'q').rsync
end
def download_doc_skin(doc_skin) #first element in array is source url
path="#{@env.processing_path.processing}/external_document/skin/doc"
- mkdir_p(path) unless FileTest.directory?(path)
+ FileUtils::mkdir_p(path) unless FileTest.directory?(path)
download_from=doc_skin.shift
doc_skin.each do |i|
skin="#{path}/#{i}.rb"
@@ -124,7 +122,7 @@ module SiSU_Assemble
end
def download_images(download_from,images_array)
path="#{@env.processing_path.processing}/external_document/image"
- mkdir_p(path) unless FileTest.directory?(path)
+ FileUtils::mkdir_p(path) unless FileTest.directory?(path)
images_array.each do |i|
image="#{path}/#{i}"
unless FileTest.exists?(image)
@@ -138,7 +136,7 @@ module SiSU_Assemble
end
def download_doc_skin(doc_skin) #first element in array is source url
path="#{@env.processing_path.processing}/external_document/skin/doc"
- mkdir_p(path) unless FileTest.directory?(path)
+ FileUtils::mkdir_p(path) unless FileTest.directory?(path)
download_from=doc_skin.shift
doc_skin.each do |i|
skin="#{path}/#{i}.rb"
diff --git a/lib/sisu/v3/concordance.rb b/lib/sisu/v3/concordance.rb
index 1ef42ade..c02824d2 100644
--- a/lib/sisu/v3/concordance.rb
+++ b/lib/sisu/v3/concordance.rb
@@ -208,7 +208,7 @@ WOK
end
def songsheet
begin
- mkdir_p(@file.output_path.html_concordance.dir) unless FileTest.directory?(@file.output_path.html_concordance.dir)
+ FileUtils::mkdir_p(@file.output_path.html_concordance.dir) unless FileTest.directory?(@file.output_path.html_concordance.dir)
@file_concordance=File.open(@file.place_file.html_concordance.dir,'w')
map_para
rescue; SiSU_Errors::Info_error.new($!,$@,@md.opt.cmd,@md.fns).error
diff --git a/lib/sisu/v3/conf.rb b/lib/sisu/v3/conf.rb
index 197a04b3..3bae2179 100644
--- a/lib/sisu/v3/conf.rb
+++ b/lib/sisu/v3/conf.rb
@@ -78,9 +78,7 @@ module SiSU_Initialize
end
end
class SiSU_Config #config files such as css are not updated if they already exist unless forced using the --init=site modifier
- require 'fileutils'
require_relative 'sysenv' # sysenv.rb
- include FileUtils #::Verbose
def initialize(opt)
@opt=opt
@env=SiSU_Env::Info_env.new(@opt.fns)
@@ -120,7 +118,7 @@ module SiSU_Initialize
def dtd
SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring DTDs','').colorize unless @opt.cmd =~/q/
@rxng=SiSU_relaxng::RelaxNG.new
- @path.each { |d| mkdir_p(d[1]) unless FileTest.directory?(d[1]) }
+ @path.each { |d| FileUtils::mkdir_p(d[1]) unless FileTest.directory?(d[1]) }
#ugly code, sort later
if @rxng.methods.join =~/[^_]dtd_sax\b/
if @rxng.dtd_sax.length > 200
@@ -175,8 +173,8 @@ module SiSU_Initialize
schema=SiSU_Env::System_call.new(rnc_src,rng_file)
schema.relaxng(@opt.cmd)
#rnc
- cp(rnc_src,rnc_file)
- chmod(0644,rnc_file)
+ FileUtils::cp(rnc_src,rnc_file)
+ FileUtils::chmod(0644,rnc_file)
end
def trang_rnc_model_output_dom
s=@suffix
@@ -194,8 +192,8 @@ module SiSU_Initialize
schema=SiSU_Env::System_call.new(rnc_src,rng_file)
schema.relaxng(@opt.cmd)
#rnc
- cp(rnc_src,rnc_file)
- chmod(0644,rnc_file)
+ FileUtils::cp(rnc_src,rnc_file)
+ FileUtils::chmod(0644,rnc_file)
end
def trang_rnc_model_output_xhtml
s=@suffix
@@ -213,8 +211,8 @@ module SiSU_Initialize
schema=SiSU_Env::System_call.new(rnc_src,rng_file)
schema.relaxng(@opt.cmd)
#rnc
- cp(rnc_src,rnc_file)
- chmod(0644,rnc_file)
+ FileUtils::cp(rnc_src,rnc_file)
+ FileUtils::chmod(0644,rnc_file)
end
def trang_rnc_model_input_sax
rnc_file=@env.processing_path.dal + '/sax.rnc'
diff --git a/lib/sisu/v3/embedded.rb b/lib/sisu/v3/embedded.rb
index fb2245c9..45e96c04 100644
--- a/lib/sisu/v3/embedded.rb
+++ b/lib/sisu/v3/embedded.rb
@@ -62,8 +62,6 @@ module SiSU_Embedded
require_relative 'sysenv' # sysenv.rb
include SiSU_Env
class Source
- require 'fileutils'
- include FileUtils
def initialize(opt)
@opt=opt
@md=SiSU_Param::Parameters.new(@opt).get
@@ -94,7 +92,7 @@ module SiSU_Embedded
remote_rel=remote_conn[:name] + '/' + @f.output_path.stub.rcp
if @md.opt.cmd.inspect =~/[vVMR]/ \
and FileTest.directory?(src)
- mkdir_p(img_dir) unless FileTest.directory?(img_dir)
+ FileUtils::mkdir_p(img_dir) unless FileTest.directory?(img_dir)
src_ec=@f.place_file.images.rel + '/' + @md.ec[:image].join(" #{@f.output_path.images.rel}/")
unless @opt.fns =~/\.-sst$/
SiSU_Env::System_call.new(src_ec,ldest,'q').rsync('--relative',@opt.base_path)
@@ -113,7 +111,7 @@ module SiSU_Embedded
rdest="#{remote_conn[:name]}/#{@env.path.stub_pwd}/_sisu/mm/audio"
if @md.opt.cmd.inspect =~/[vVMR]/ \
and FileTest.directory?(src)
- mkdir_p(ldest) unless FileTest.directory?(ldest)
+ FileUtils::mkdir_p(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.opt.cmd.inspect =~/R/ #rsync to remote audio directory
@@ -130,7 +128,7 @@ module SiSU_Embedded
rdest="#{remote_conn[:name]}/#{@env.path.stub_pwd}/_sisu/mm/video"
if @md.opt.cmd.inspect =~/[vVMR]/ \
and FileTest.directory?(src)
- mkdir_p(ldest) unless FileTest.directory?(ldest)
+ FileUtils::mkdir_p(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.opt.cmd.inspect =~/R/ #rsync to remote video directory
diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb
index c1dcacec..80482984 100644
--- a/lib/sisu/v3/epub.rb
+++ b/lib/sisu/v3/epub.rb
@@ -601,8 +601,6 @@ module SiSU_EPUB
class Seg < SiSU_EPUB_seg::Seg
end
class Epub_output
- require 'fileutils'
- include FileUtils #::Verbose
def initialize(md,output='')
@md,@output=md,output
@epub_doc="#{@md.fnb}.epub"
@@ -661,10 +659,10 @@ module SiSU_EPUB
@md.ec[:image].each do |x|
if FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \
&& FileTest.file?("#{@md.file.output_path.epub.rel_image}/#{x}")
- cp("#{@md.file.output_path.epub.rel_image}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image")
+ FileUtils::cp("#{@md.file.output_path.epub.rel_image}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image")
elsif FileTest.directory?("#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image") \
&& FileTest.file?("#{img_pth}/#{x}")
- cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image")
+ FileUtils::cp("#{img_pth}/#{x}","#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}/image")
end
end
end
@@ -672,7 +670,7 @@ module SiSU_EPUB
SiSU_EPUB_Concordance::Source.new(@md.opt).read
end
def output_zip
- mkdir_p(@md.file.output_path.epub.dir) unless FileTest.directory?(@md.file.output_path.epub.dir)
+ FileUtils::mkdir_p(@md.file.output_path.epub.dir) unless FileTest.directory?(@md.file.output_path.epub.dir)
if FileTest.directory?(@md.env.processing_path.epub)
pwd=Dir.pwd
Dir.chdir(@md.env.processing_path.epub)
diff --git a/lib/sisu/v3/git.rb b/lib/sisu/v3/git.rb
index 2e76fa4a..a0e70a97 100644
--- a/lib/sisu/v3/git.rb
+++ b/lib/sisu/v3/git.rb
@@ -61,7 +61,6 @@ module SiSU_Git
require_relative 'sysenv' # sysenv.rb
require_relative 'dal' # dal.rb
class Source
- include FileUtils #::Verbose
def initialize(opt)
@opt=opt
@env=SiSU_Env::Info_env.new
@@ -124,15 +123,15 @@ module SiSU_Git
(found =~/bin\/git\b/) ? true : false
end
def make_dir_fnb
- mkdir_p(@git_path[:fnb]) unless FileTest.directory?(@git_path[:fnb])
- mkdir_p(@git_path[:src]) unless FileTest.directory?(@git_path[:src])
- mkdir_p(@git_path[:po]) unless FileTest.directory?(@git_path[:po])
- mkdir_p(@git_path[:pot]) unless FileTest.directory?(@git_path[:pot])
- mkdir_p(@git_path[:conf]) unless FileTest.directory?(@git_path[:conf])
- mkdir_p(@git_path[:skin]) unless FileTest.directory?(@git_path[:skin])
- mkdir_p(@git_path[:image]) unless FileTest.directory?(@git_path[:image])
- #mkdir_p(@git_path[:audio]) unless FileTest.directory?(@git_path[:audio])
- #mkdir_p(@git_path[:video]) unless FileTest.directory?(@git_path[:video])
+ FileUtils::mkdir_p(@git_path[:fnb]) unless FileTest.directory?(@git_path[:fnb])
+ FileUtils::mkdir_p(@git_path[:src]) unless FileTest.directory?(@git_path[:src])
+ FileUtils::mkdir_p(@git_path[:po]) unless FileTest.directory?(@git_path[:po])
+ FileUtils::mkdir_p(@git_path[:pot]) unless FileTest.directory?(@git_path[:pot])
+ FileUtils::mkdir_p(@git_path[:conf]) unless FileTest.directory?(@git_path[:conf])
+ FileUtils::mkdir_p(@git_path[:skin]) unless FileTest.directory?(@git_path[:skin])
+ FileUtils::mkdir_p(@git_path[:image]) unless FileTest.directory?(@git_path[:image])
+ #FileUtils::mkdir_p(@git_path[:audio]) unless FileTest.directory?(@git_path[:audio])
+ #FileUtils::mkdir_p(@git_path[:video]) unless FileTest.directory?(@git_path[:video])
end
def git_init
unless FileTest.directory?("#{@git_path[:fnb]}/.git")
@@ -160,12 +159,12 @@ module SiSU_Git
end
def copy_src_head
if @opt.f_pth[:lng]
- cp_r("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{@opt.fns}",@git_path[:src])
+ FileUtils::cp_r("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{@opt.fns}",@git_path[:src])
elsif @opt.fns =~/\.ssm\.sst/
ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm')
- cp_r("#{@env.path.pwd}/#{ssm}",@git_path[:src])
+ FileUtils::cp_r("#{@env.path.pwd}/#{ssm}",@git_path[:src])
else
- cp_r("#{@env.path.pwd}/#{@opt.fns}",@git_path[:src])
+ FileUtils::cp_r("#{@env.path.pwd}/#{@opt.fns}",@git_path[:src])
end
end
def copy_related_sst_ssi
@@ -179,9 +178,9 @@ module SiSU_Git
end
doc_import.each do |f|
if @opt.f_pth[:lng]
- cp_r("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{f}",@git_path[:src])
+ FileUtils::cp_r("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{f}",@git_path[:src])
else
- cp_r("#{@env.path.pwd}/#{f}",@git_path[:src])
+ FileUtils::cp_r("#{@env.path.pwd}/#{f}",@git_path[:src])
end
end
end
@@ -239,18 +238,18 @@ module SiSU_Git
image_path="#{@env.path.pwd}/_sisu/image"
images.flatten.each do |i|
if FileTest.file?("#{image_path}/#{i}")
- cp_r("#{image_path}/#{i}",@git_path[:image])
+ FileUtils::cp_r("#{image_path}/#{i}",@git_path[:image])
end
end
if FileTest.file?(skin)
- cp_r(skin,"#{@git_path[:conf]}/skin")
+ FileUtils::cp_r(skin,"#{@git_path[:conf]}/skin")
end
{ skin: skin, images: images }
end
def sisuyaml_rc
sisurc=@env.path.sisurc_path
if FileTest.file?(sisurc)
- cp_r(sisurc,@git_path[:conf])
+ FileUtils::cp_r(sisurc,@git_path[:conf])
end
end
def read_src
diff --git a/lib/sisu/v3/harvest.rb b/lib/sisu/v3/harvest.rb
index 47380c2e..ce8880f0 100644
--- a/lib/sisu/v3/harvest.rb
+++ b/lib/sisu/v3/harvest.rb
@@ -72,7 +72,7 @@ module SiSU_Harvest
end
def read
harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}"
- mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth)
+ FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth)
cases(@opt,@env)
end
def help
diff --git a/lib/sisu/v3/harvest_authors.rb b/lib/sisu/v3/harvest_authors.rb
index 1320be41..08716f2b 100644
--- a/lib/sisu/v3/harvest_authors.rb
+++ b/lib/sisu/v3/harvest_authors.rb
@@ -170,8 +170,6 @@ module HARVEST_authors
end
class Output_index
require_relative 'i18n' # i18n.rb
- require 'fileutils'
- include FileUtils
def initialize(opt,the_idx)
@opt,@the_idx=opt,the_idx
@env=SiSU_Env::Info_env.new
@@ -192,7 +190,7 @@ module HARVEST_authors
harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}/manifest"
file="#{harvest_pth}/authors.#{lng}.html"
end
- mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth)
+ FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth)
puts "file://#{file}"
@output[lng][:html]=File.new(file,'w')
end
diff --git a/lib/sisu/v3/harvest_topics.rb b/lib/sisu/v3/harvest_topics.rb
index 9ab78f46..c489092f 100644
--- a/lib/sisu/v3/harvest_topics.rb
+++ b/lib/sisu/v3/harvest_topics.rb
@@ -261,8 +261,6 @@ module HARVEST_topics
end
class Output_index
require_relative 'i18n' # i18n.rb
- require 'fileutils'
- include FileUtils
def initialize(opt,the_idx)
@opt,@the_idx=opt,the_idx
@env=SiSU_Env::Info_env.new
@@ -283,7 +281,7 @@ module HARVEST_topics
harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}/manifest"
file="#{harvest_pth}/topics.#{lng}.html"
end
- mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth)
+ FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth)
puts "file://#{file}"
@output[lng][:html]=File.new(file,'w')
if @opt.cmd.inspect =~/-M/
diff --git a/lib/sisu/v3/html_segments.rb b/lib/sisu/v3/html_segments.rb
index 60b4312e..ba1adfcb 100644
--- a/lib/sisu/v3/html_segments.rb
+++ b/lib/sisu/v3/html_segments.rb
@@ -120,8 +120,6 @@ module SiSU_HTML_seg
end
end
class Seg
- require 'fileutils'
- include FileUtils
@@seg,@@seg_subtoc,@@seg_endnotes,@@seg_ad={},{},{},{}
@@seg_name,@@seg_name_html=[],[]
@@seg_url=@@fn=@@get_hash_to=@@get_hash_fn=''
@@ -234,7 +232,7 @@ module SiSU_HTML_seg
dir_sisu=dirout.path.output
@file=SiSU_Env::SiSU_file.new(@md)
unless FileTest.directory?(@file.output_path.html_seg.dir)
- mkdir_p(@file.output_path.html_seg.dir) if File.writable?("#{@file.output_path.base.dir}/.")
+ FileUtils::mkdir_p(@file.output_path.html_seg.dir) if File.writable?("#{@file.output_path.base.dir}/.")
end
Seg.new(@md).tail
segfilename="#{@file.output_path.html_seg.dir}/#{@@seg_name_html[tracking-1]}#{@md.lang_code_insert}#{Sfx[:html]}"
diff --git a/lib/sisu/v3/hub.rb b/lib/sisu/v3/hub.rb
index 584845ba..a0f3f3d6 100644
--- a/lib/sisu/v3/hub.rb
+++ b/lib/sisu/v3/hub.rb
@@ -587,8 +587,8 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/
and @@env.user \
and FileTest.directory?(@@env.processing_path.processing) \
and @@env.processing_path.processing =~/#{@@env.user}$/ #clean temporary processing directory of content as is located in public area
- cd(@@env.processing_path.processing_base_tmp) do
- rm_rf(@@env.user) unless @opt.cmd =~/M/
+ FileUtils::cd(@@env.processing_path.processing_base_tmp) do
+ FileUtils::rm_rf(@@env.user) unless @opt.cmd =~/M/
end end
elsif @opt.mod.inspect =~/--query/
require_relative 'sst_identify_markup' # sst_identify_markup.rb
diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb
index 3bd59e81..4cb6664b 100644
--- a/lib/sisu/v3/odf.rb
+++ b/lib/sisu/v3/odf.rb
@@ -71,8 +71,6 @@ module SiSU_ODF
class Source
require 'zlib'
require 'find'
- require 'fileutils'
- include FileUtils
def initialize(opt)
@opt=opt
@particulars=SiSU_Particulars::Combined_singleton.instance.get_all(opt)
@@ -215,7 +213,7 @@ module SiSU_ODF
image_source=image_src(i)
pwd=Dir.pwd
if image_source
- cp("#{image_source}/#{i}","#{@env.processing_path.odt}/Pictures/#{i}")
+ FileUtils::cp("#{image_source}/#{i}","#{@env.processing_path.odt}/Pictures/#{i}")
end
img=if i.to_s =~/jpg|png|gif/ \
and h.to_s =~/\d/ \
@@ -523,7 +521,7 @@ module SiSU_ODF
fix=[]
bullet=image_src('bullet_09.png')
if bullet
- cp("#{bullet}/bullet_09.png","#{@env.processing_path.odt}/Pictures/.")
+ FileUtils::cp("#{bullet}/bullet_09.png","#{@env.processing_path.odt}/Pictures/.")
end
odf_metadata
data.each do |dob|
@@ -744,7 +742,7 @@ WOK
end
od.close
opendoc=@md.fn[:odf]
- mkdir_p(@md.file.output_path.odt.dir) unless FileTest.directory?(@md.file.output_path.odt.dir)
+ FileUtils::mkdir_p(@md.file.output_path.odt.dir) unless FileTest.directory?(@md.file.output_path.odt.dir)
if FileTest.directory?(@env.processing_path.odt)
pwd=Dir.pwd
Dir.chdir(@env.processing_path.odt)
@@ -782,7 +780,7 @@ page break
notes?? [you could add a note number for every object/paragraph!]
- cd(@env.processing_path.odt)
+ FileUtils::cd(@env.processing_path.odt)
structure=[]
Find.find(@env.processing_path.odt) do |f|
structure << puts f
@@ -795,8 +793,8 @@ notes?? [you could add a note number for every object/paragraph!]
zip.close
end
#zip -qr #{opendoc} *
- mv(opendoc,"#{@env.path.output}/#{@md.fnb}/.")
- cd(Dir.pwd)
+ FileUtils::mv(opendoc,"#{@env.path.output}/#{@md.fnb}/.")
+ FileUtils::cd(Dir.pwd)
<text:span text:style-name="T6">●</text:span> #bullet
dob.obj.gsub!(/^(#{Mx[:pa_o]}:i[1-9]#{Mx[:pa_c]})\s*#{Mx[:gl_bullet]}/,'\1 <text:span text:style-name="T6">·</text:span> ') #bullet
diff --git a/lib/sisu/v3/po4a.rb b/lib/sisu/v3/po4a.rb
index d5c6109b..64db20c3 100644
--- a/lib/sisu/v3/po4a.rb
+++ b/lib/sisu/v3/po4a.rb
@@ -956,9 +956,9 @@ GSUB
git=SiSU_Git::Source.new(@md.opt)
git.create_file_structure_git unless FileTest.directory?(@file.output_path.pot_git.dir)
if @md.opt.f_pth[:lng] ==opt.lng_base
- cp(@file.place_file.pot.dir, @file.output_path.pot_git.dir)
+ FileUtils::cp(@file.place_file.pot.dir, @file.output_path.pot_git.dir)
else # naive, work on -->
- cp(@file.place_file.po.dir, @file.output_path.po_git.dir) #unless FileTest.file?(@file.place_file.po_git.dir)
+ FileUtils::cp(@file.place_file.po.dir, @file.output_path.po_git.dir) #unless FileTest.file?(@file.place_file.po_git.dir)
end
git.read
end
diff --git a/lib/sisu/v3/share_src.rb b/lib/sisu/v3/share_src.rb
index 17641815..5595c88e 100644
--- a/lib/sisu/v3/share_src.rb
+++ b/lib/sisu/v3/share_src.rb
@@ -61,8 +61,6 @@ module SiSU_Markup
include SiSU_Env
pwd=Dir.pwd
class Source
- require 'fileutils'
- include FileUtils
def initialize(opt)
@opt=opt
@env=SiSU_Env::Info_env.new(@opt.fns)
@@ -77,13 +75,13 @@ module SiSU_Markup
: SiSU_Screen::Ansi.new(@opt.cmd,'Share Document Source!',@opt.fns).green_title_hi
SiSU_Screen::Ansi.new(@opt.cmd,"Copy sisu markup file to output directory","#{@opt.fns} -> #{@file.output_path.src.dir}").warn if @opt.cmd =~/[MVv]/
end
- mkdir_p(@file.output_path.src.dir) unless FileTest.directory?(@file.output_path.src.dir)
+ FileUtils::mkdir_p(@file.output_path.src.dir) unless FileTest.directory?(@file.output_path.src.dir)
if FileTest.directory?(@file.output_path.src.dir)
- unless @opt.fns =~/\.ssm$/; cp(@opt.fns,@file.output_path.src.dir)
+ unless @opt.fns =~/\.ssm$/; FileUtils::cp(@opt.fns,@file.output_path.src.dir)
else
req=@opt.fns.gsub(/(.+?\.ssm)$/,'\1.sst')
file="#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst"
- if FileTest.file?(file); cp(file,"#{@file.output_path.src.dir}/#{req}")
+ if FileTest.file?(file); FileUtils::cp(file,"#{@file.output_path.src.dir}/#{req}")
else print "did not find #{file} to copy"
end
end
diff --git a/lib/sisu/v3/share_src_kdissert.rb b/lib/sisu/v3/share_src_kdissert.rb
index 755bd1b0..45f68b9f 100644
--- a/lib/sisu/v3/share_src_kdissert.rb
+++ b/lib/sisu/v3/share_src_kdissert.rb
@@ -71,12 +71,12 @@ module SiSU_Kdi_source
def read
SiSU_Screen::Ansi.new(@opt.cmd,'Share Kdissert Source Document!',@opt.fnb).green_hi_blue unless @opt.cmd =~/q/
SiSU_Screen::Ansi.new(@opt.cmd,"Copy kdissert file to output directory","#{@opt.fnb} -> #{@output_path}").warn unless @opt.cmd =~/q/
- mkdir_p(@env.path.output) unless FileTest.directory?(@env.path.output)
- mkdir_p(@output_path) unless FileTest.directory?(@output_path)
+ FileUtils::mkdir_p(@env.path.output) unless FileTest.directory?(@env.path.output)
+ FileUtils::mkdir_p(@output_path) unless FileTest.directory?(@output_path)
if FileTest.directory?(@output_path)
if @opt.fns =~/\.kdi\._sst$/ \
and FileTest.file?(@opt.fnb)
- cp(@opt.fnb,@output_path)
+ FileUtils::cp(@opt.fnb,@output_path)
end
else
SiSU_Screen::Ansi.new(@opt.cmd,"Output directory does not exist","#{@opt.fnb} -> #{@output_path}").warn unless @opt.cmd =~/q/
diff --git a/lib/sisu/v3/sisupod_make.rb b/lib/sisu/v3/sisupod_make.rb
index e2ac4f51..698d5ae1 100644
--- a/lib/sisu/v3/sisupod_make.rb
+++ b/lib/sisu/v3/sisupod_make.rb
@@ -57,10 +57,8 @@
=end
module SiSU_Doc
- require 'fileutils'
include SiSU_Env
class Source
- include FileUtils #::Verbose
require_relative 'sysenv' # sysenv.rb
require_relative 'response' # response.rb
require_relative 'particulars' # particulars.rb
@@ -79,8 +77,8 @@ module SiSU_Doc
@zipfile=(@opt.fns =~/\.ssm\.sst$/) \
? @opt.fns.gsub(/(?:\~\S{2,3})?\.ssm\.sst$/,'.ssm')
: @opt.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1')
- mkdir_p(pod_path) unless FileTest.directory?(pod_path)
- rm_rf("#{@env.processing_path.processing}sisupod/*") if FileTest.directory?("#{@env.processing_path.processing}sisupod")
+ FileUtils::mkdir_p(pod_path) unless FileTest.directory?(pod_path)
+ FileUtils::rm_rf("#{@env.processing_path.processing}sisupod/*") if FileTest.directory?("#{@env.processing_path.processing}sisupod")
end
def read
unless @opt.cmd =~/q/
@@ -224,7 +222,7 @@ module SiSU_Doc
and docskin #imperfect, revisit
unless skin_source[:name].nil? \
or skin_source[:name].empty?
- cp_r(skin_source[:name],"#{docskin_place}/#{docskin}.rb")
+ FileUtils::cp_r(skin_source[:name],"#{docskin_place}/#{docskin}.rb")
skinfile_array=IO.readlines(skin_source[:name],'')
para_images=[]
skinfile_array.each do |f| #% work area
@@ -255,13 +253,13 @@ module SiSU_Doc
#Dir.chdir(image_source_base)
#base_images=Dir.glob('*')
#base_images.each do |i|
- # cp_r(i,"#{images_path_pod}/#{i}")
+ # FileUtils::cp_r(i,"#{images_path_pod}/#{i}")
#end
#Dir.chdir(dir_pwd)
if FileTest.directory?(images_pwd)
images=images.uniq
images.each do |i|
- cp_r("#{images_pwd}/#{i}","#{images_path_pod}/#{i}") if FileTest.file?("#{images_pwd}/#{i}")
+ FileUtils::cp_r("#{images_pwd}/#{i}","#{images_path_pod}/#{i}") if FileTest.file?("#{images_pwd}/#{i}")
end
else puts "\tWARN, did not find - #{images_pwd} #{images_path_pod}"
end
@@ -269,7 +267,7 @@ module SiSU_Doc
if doc_import.length > 0 \
and use_file =~/\.ssm$/
doc_import.each do |f|
- cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f}","#{@env.processing_path.processing}/sisupod/doc/#{@opt.lng}/#{f}")
+ FileUtils::cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f}","#{@env.processing_path.processing}/sisupod/doc/#{@opt.lng}/#{f}")
end
end
x=@env.document_language_versions_found #check multiple document language versions (param not used)
@@ -277,13 +275,13 @@ module SiSU_Doc
and x[:f].length > 0 #store multiple document language versions, sisupod
x[:f].each do |f|
(use_file =~/\.ssm$/) \
- ? cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}","#{@env.processing_path.processing}/sisupod/doc/#{f[:l]}/#{f[:n]}")
- : cp_r("#{@env.path.pwd}/#{f[:f]}","#{@env.processing_path.processing}/sisupod/doc/#{f[:l]}/#{f[:n]}")
+ ? FileUtils::cp_r("#{@env.path.pwd}#{doc_import_dir}/#{f[:f]}","#{@env.processing_path.processing}/sisupod/doc/#{f[:l]}/#{f[:n]}")
+ : FileUtils::cp_r("#{@env.path.pwd}/#{f[:f]}","#{@env.processing_path.processing}/sisupod/doc/#{f[:l]}/#{f[:n]}")
end
end #NB not all possibilies met, revisit, also in case of composite file may wish to add README
end
def sisupod_xz
- mkdir_p(@file.output_path.sisupod.dir) unless FileTest.directory?(@file.output_path.sisupod.dir)
+ FileUtils::mkdir_p(@file.output_path.sisupod.dir) unless FileTest.directory?(@file.output_path.sisupod.dir)
tree=(@opt.cmd =~/[vVM]/ \
&& SiSU_Env::System_call.new.program_found?('tree')) \
? 'tree sisupod'
diff --git a/lib/sisu/v3/sitemaps.rb b/lib/sisu/v3/sitemaps.rb
index 1b7847da..b92ec05d 100644
--- a/lib/sisu/v3/sitemaps.rb
+++ b/lib/sisu/v3/sitemaps.rb
@@ -64,8 +64,6 @@ module SiSU_Sitemaps
require_relative 'shared_xml' # shared_xml.rb
include SiSU_XML_munge
class Source
- require 'fileutils'
- include FileUtils
def initialize(opt)
@opt=opt
end
@@ -111,7 +109,7 @@ module SiSU_Sitemaps
file=SiSU_Env::SiSU_file.new(@md).make_file(path,filename)
file << sitemap
if FileTest.file?("#{touch_path}/#{touch_filename}")
- rm("#{touch_path}/#{touch_filename}")
+ FileUtils::rm("#{touch_path}/#{touch_filename}")
end
end
def output_idx(sitemap)
diff --git a/lib/sisu/v3/sst_convert_markup.rb b/lib/sisu/v3/sst_convert_markup.rb
index 6a3a9851..fe520d32 100644
--- a/lib/sisu/v3/sst_convert_markup.rb
+++ b/lib/sisu/v3/sst_convert_markup.rb
@@ -63,8 +63,6 @@ module SiSU_Modify
require_relative 'sst_from_xml' # sst_from_xml.rb
require_relative 'response' # response.rb
class Convert_markup
- require 'fileutils'
- include FileUtils #::Verbose
def initialize(opt)
@opt=opt
@description='This is a script that contains canned text conversions for reuse'
@@ -168,7 +166,7 @@ WOK
unless f==s
unless File.exist?("#{pwd}/#{s}")
puts "./#{f} -> ./#{s}"
- cp("#{pwd}/#{f}","#{pwd}/#{s}")
+ FileUtils::cp("#{pwd}/#{f}","#{pwd}/#{s}")
else "File already exists, < #{s} > will not overwrite"
end
end
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index cb7b94df..dd17b41e 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -838,10 +838,10 @@ module SiSU_Env
end
end
def rm
- if @cmd =~/^-Z[mMvVq]*$/; rm_rf(@input)
- elsif @cmd =~/V/; rm(@input)
- elsif @cmd !~/q/; rm(@input)
- elsif @cmd =~/q/; rm(@input)
+ if @cmd =~/^-Z[mMvVq]*$/; FileUtils::rm_rf(@input)
+ elsif @cmd =~/V/; FileUtils::rm(@input)
+ elsif @cmd !~/q/; FileUtils::rm(@input)
+ elsif @cmd =~/q/; FileUtils::rm(@input)
else puts "\tWARN: operation ignored"
end
end
@@ -1113,7 +1113,7 @@ module SiSU_Env
lng_dirs=[]
if FileTest.directory?(spp) \
or FileTest.file?(spp)
- rm_rf(spp)
+ FileUtils::rm_rf(spp)
end
paths=[]
flv=Env_call.new(opt.fns).document_language_versions_found
@@ -1131,7 +1131,7 @@ module SiSU_Env
#<< "#{spp}/video" \
paths.each do |x|
unless FileTest.directory?(x)
- mkdir_p(x)
+ FileUtils::mkdir_p(x)
end
end
if FileTest.directory?(sppc)
@@ -1157,7 +1157,7 @@ module SiSU_Env
sisupod_processing_path="#{processing_path.processing}/sisupod"
if FileTest.directory?(sisupod_processing_path) \
or FileTest.file?(sisupod_processing_path)
- rm_rf(sisupod_processing_path)
+ FileUtils::rm_rf(sisupod_processing_path)
end
paths=[]
paths=[
@@ -1166,7 +1166,7 @@ module SiSU_Env
"#{processing_path.processing}/sisupod/_sisu/skin/site",
"#{processing_path.processing}/sisupod/_sisu/image"
]
- paths.each {|x| mkdir_p(x) unless FileTest.directory?(x) }
+ paths.each {|x| FileUtils::mkdir_p(x) unless FileTest.directory?(x) }
end
def defaults #multiple default directories
@default_dir ||=@sys.default_dir #DEFAULT_DIR
@@ -1712,7 +1712,7 @@ WOK
end
man_path_head=man_path.gsub(/(\S+)\/[^\/\s]+$/,'\1')
unless FileTest.directory?(man_path)
- mkdir_p(man_path) if File.writable?("#{man_path_head}/.")
+ FileUtils::mkdir_p(man_path) if File.writable?("#{man_path_head}/.")
end
@webserv_path=if defined? man_path \
and File.writable?("#{man_path}/.")
@@ -1722,14 +1722,14 @@ WOK
defaults[:webserv_path]
else #create default directory under home and place output there
unless FileTest.directory?(defaults[:output_local])
- mkdir_p(defaults[:output_local])
+ FileUtils::mkdir_p(defaults[:output_local])
end
defaults[:output_local]
end
end
def webserv_stub_ensure
- mkdir_p(path.webserv) unless FileTest.directory?(path.webserv)
- mkdir_p("#{path.webserv}/#{@stub_pwd}") unless FileTest.directory?("#{path.webserv}/#{@stub_pwd}")
+ FileUtils::mkdir_p(path.webserv) unless FileTest.directory?(path.webserv)
+ FileUtils::mkdir_p("#{path.webserv}/#{@stub_pwd}") unless FileTest.directory?("#{path.webserv}/#{@stub_pwd}")
end
def webserv_map_pwd #dir
"#{path.webserv}/#{stub_pwd}"
@@ -1814,7 +1814,7 @@ WOK
def processing_path
def encoding
pth="#{processing}/#{defaults[:processing_encoding]}"
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def processing_base_tmp
@@ -1863,15 +1863,15 @@ WOK
end
def processing #processing directory, used/needed for sisu work files, has sub-directories (dal,tex etc)
unless FileTest.directory?(root_dir)
- mkdir_p(root_dir)
+ FileUtils::mkdir_p(root_dir)
File.chmod(0777,root_dir)
end
if usr_dir?
processing_path_usr="#{root_dir}/#{user}"
- mkdir_p(processing_path_usr) unless FileTest.directory?(processing_path_usr)
+ FileUtils::mkdir_p(processing_path_usr) unless FileTest.directory?(processing_path_usr)
File.chmod(0700,processing_path_usr)
end
- mkdir_p(stub_dir) unless FileTest.directory?(stub_dir)
+ FileUtils::mkdir_p(stub_dir) unless FileTest.directory?(stub_dir)
File.chmod(0700,stub_dir)
path_processing=[stub_dir,defaults[:processing_path],defaults[:processing_path_home]]
processing=nil
@@ -1879,7 +1879,7 @@ WOK
processing=v
unless FileTest.directory?(processing)
puts "a processing directory (#{processing}) is being created for use by sisu"
- mkdir_p(processing)
+ FileUtils::mkdir_p(processing)
File.chmod(0700,processing)
end
break
@@ -1893,7 +1893,7 @@ WOK
"#{processing}/#{@rc['processing']['dal']}"
else "#{processing}/#{defaults[:processing_dal]}"
end
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def tune
@@ -1903,12 +1903,12 @@ WOK
"#{processing}/#{@rc['processing']['tune']}"
else "#{processing}/#{defaults[:processing_tune]}"
end
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def composite_file
pth=processing_path.dal #"#{processing}/composite"
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def git
@@ -1921,7 +1921,7 @@ WOK
else defaults[:processing_git]
end
unless FileTest.directory?(pth)
- mkdir_p(pth)
+ FileUtils::mkdir_p(pth)
File.chmod(0700,pth)
end
pth
@@ -1935,42 +1935,42 @@ WOK
end
def odt
pth=odf_pth + '/odt'
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def odf
pth="#{processing}/odf"
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def odt_bld
- rm_rf(processing_path.odt)
- mkdir_p(processing_path.odt) unless FileTest.directory?(processing_path.odt)
- mkdir_p("#{processing_path.odt}/Configurations2") unless FileTest.directory?("#{processing_path.odt}/Configurations2")
- mkdir_p("#{processing_path.odt}/META-INF") unless FileTest.directory?("#{processing_path.odt}/META-INF")
- mkdir_p("#{processing_path.odt}/Pictures") unless FileTest.directory?("#{processing_path.odt}/Pictures")
- mkdir_p("#{processing_path.odt}/Thumbnails") unless FileTest.directory?("#{processing_path.odt}/Thumbnails")
+ FileUtils::rm_rf(processing_path.odt)
+ FileUtils::mkdir_p(processing_path.odt) unless FileTest.directory?(processing_path.odt)
+ FileUtils::mkdir_p("#{processing_path.odt}/Configurations2") unless FileTest.directory?("#{processing_path.odt}/Configurations2")
+ FileUtils::mkdir_p("#{processing_path.odt}/META-INF") unless FileTest.directory?("#{processing_path.odt}/META-INF")
+ FileUtils::mkdir_p("#{processing_path.odt}/Pictures") unless FileTest.directory?("#{processing_path.odt}/Pictures")
+ FileUtils::mkdir_p("#{processing_path.odt}/Thumbnails") unless FileTest.directory?("#{processing_path.odt}/Thumbnails")
processing_path.odt
end
def epub
"#{processing}/epub/#{@fnb}"
end
def epub_bld #(md)
- rm_rf(processing_path.epub) if FileTest.directory?(processing_path.epub)
- mkdir_p(processing_path.epub) unless FileTest.directory?(processing_path.epub)
- mkdir_p("#{processing_path.epub}/META-INF") unless FileTest.directory?("#{processing_path.epub}/META-INF")
- mkdir_p("#{processing_path.epub}/#{Ep[:d_oebps]}/image") unless FileTest.directory?("#{processing_path.epub}/#{Ep[:d_oebps]}/image")
- mkdir_p("#{processing_path.epub}/#{Ep[:d_oebps]}/css") unless FileTest.directory?("#{processing_path.epub}/#{Ep[:d_oebps]}/css")
+ FileUtils::rm_rf(processing_path.epub) if FileTest.directory?(processing_path.epub)
+ FileUtils::mkdir_p(processing_path.epub) unless FileTest.directory?(processing_path.epub)
+ FileUtils::mkdir_p("#{processing_path.epub}/META-INF") unless FileTest.directory?("#{processing_path.epub}/META-INF")
+ FileUtils::mkdir_p("#{processing_path.epub}/#{Ep[:d_oebps]}/image") unless FileTest.directory?("#{processing_path.epub}/#{Ep[:d_oebps]}/image")
+ FileUtils::mkdir_p("#{processing_path.epub}/#{Ep[:d_oebps]}/css") unless FileTest.directory?("#{processing_path.epub}/#{Ep[:d_oebps]}/css")
images=%W[bullet_09.png arrow_next_red.png arrow_prev_red.png arrow_up_red.png]
processing_path.epub
end
def epub_cp_images(md)
pth="#{processing_path.epub}/#{Ep[:d_oebps]}/image"
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
src="#{path.share}/image"
images=%W[bullet_09.png arrow_next_red.png arrow_prev_red.png arrow_up_red.png]
images.each do |i| #move to avoid repeated tests
- cp("#{src}/#{i}","#{pth}/#{i}") unless FileTest.file?("#{pth}/#{i}")
+ FileUtils::cp("#{src}/#{i}","#{pth}/#{i}") unless FileTest.file?("#{pth}/#{i}")
end
pth
end
@@ -1981,7 +1981,7 @@ WOK
"#{processing}/#{@rc['processing']['latex']}"
else "#{processing}/#{defaults[:processing_latex]}"
end
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def texi
@@ -1991,7 +1991,7 @@ WOK
"#{processing}/#{@rc['processing']['texinfo']}"
else "#{processing}/#{defaults[:processing_texinfo]}"
end
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def texinfo #texinfo webserv, check
@@ -2007,12 +2007,12 @@ WOK
"#{processing}/#{@rc['processing']['lout']}"
else "#{processing}/#{defaults[:processing_lout]}"
end
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def sql
pth="#{processing}/sql"
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def sqlite
@@ -2022,7 +2022,7 @@ WOK
"#{processing}/#{@rc['processing']['sqlite']}"
else "#{processing}/#{defaults[:processing_sqlite]}"
end
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
def postgresql
@@ -2032,7 +2032,7 @@ WOK
"#{processing}/#{@rc['processing']['postgresql']}"
else "#{processing}/#{defaults[:processing_postgresql]}"
end
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
self
@@ -2275,7 +2275,7 @@ WOK
if @@image_flag
images=Dir.glob("#{image_external}/*.{png,jpg,gif}")
pth="#{path.webserv}/#{@stub_pwd}"
- mkdir_p("#{pth}/_sisu/image_external") unless FileTest.directory?("#{pth}/_sisu/image_external")
+ FileUtils::mkdir_p("#{pth}/_sisu/image_external") unless FileTest.directory?("#{pth}/_sisu/image_external")
images.each { |i| File.install(i,"#{pth}/#{i}") } unless images.length > 0
@@image_flag=false
end
@@ -2489,8 +2489,8 @@ WOK
: (defaults[:papersize].downcase)
end
def odf_structure
- rm_rf(processing_path.processing_path.odf_pth)
- mkdir_p(processing_path.processing_path.odf_pth)
+ FileUtils::rm_rf(processing_path.processing_path.odf_pth)
+ FileUtils::mkdir_p(processing_path.processing_path.odf_pth)
system("unzip -q #{path.share}/#{SiSU_version_dir}/odf/odt.zip -d #{processing_path.odf_pth}")
end
def sisupod_gen(fns_pod)
@@ -2501,10 +2501,10 @@ WOK
sisupod_processing_path="#{processing_path.processing}/sisupod"
if FileTest.directory?(sisupod_processing_path) \
or FileTest.file?(sisupod_processing_path)
- rm_rf(sisupod_processing_path)
+ FileUtils::rm_rf(sisupod_processing_path)
end
unless FileTest.directory?(sisupod_processing_path)
- mkdir_p(sisupod_processing_path)
+ FileUtils::mkdir_p(sisupod_processing_path)
end
f_pod=if FileTest.file?("#{Dir.pwd}/#{fns_pod}")
"#{Dir.pwd}/#{fns_pod}"
@@ -2532,10 +2532,10 @@ WOK
sisupod_processing_path="#{processing_path.processing}/sisupod"
if FileTest.directory?(sisupod_processing_path) \
or FileTest.file?(sisupod_processing_path)
- rm_rf(sisupod_processing_path)
+ FileUtils::rm_rf(sisupod_processing_path)
end
unless FileTest.directory?(sisupod_processing_path)
- mkdir_p(sisupod_processing_path)
+ FileUtils::mkdir_p(sisupod_processing_path)
end
(FileTest.file?(fns_pod)) \
? system("unzip -q #{fns_pod} -d #{processing_path.processing}")
@@ -2754,30 +2754,30 @@ WOK
def zap
def main_output
(@zap !~/\/\//) \
- ? (rm_rf(@zap) if FileTest.directory?(@zap))
+ ? (FileUtils::rm_rf(@zap) if FileTest.directory?(@zap))
: (puts 'suspect zap request, ignored')
end
def site_map
if @opt.fnb \
and not @opt.fnb.empty?
sm="#{@env.path.output}/sitemaps/sitemap_#{@opt.fnb}.xml"
- rm(sm) if FileTest.file?(sm)
+ FileUtils::rm(sm) if FileTest.file?(sm)
end
end
def epub
if @opt.fnb \
and not @opt.fnb.empty?
sm="#{@env.path.output}/epub/#{@opt.fnb}.epub"
- rm(sm) if FileTest.file?(sm)
+ FileUtils::rm(sm) if FileTest.file?(sm)
end
end
def src # consider
if @opt.fnb \
and not @opt.fnb.empty?
sm="#{@env.path.output}/src/pod/#{@opt.fns}.txz"
- rm(sm) if FileTest.file?(sm)
+ FileUtils::rm(sm) if FileTest.file?(sm)
sm="#{@env.path.output}/src/#{@opt.fns}"
- rm(sm) if FileTest.file?(sm)
+ FileUtils::rm(sm) if FileTest.file?(sm)
end
end
self
@@ -3236,7 +3236,7 @@ WOK
end
def images
unless FileTest.directory?("#{@env.path.output}/_sisu")
- mkdir_p("#{@env.path.output}/_sisu")
+ FileUtils::mkdir_p("#{@env.path.output}/_sisu")
end
unless File.exist?("#{@env.path.output}/_sisu/image_sys") \
or File.symlink?("#{@env.path.output}/_sisu/image_sys")
@@ -3278,7 +3278,7 @@ WOK
end
end
def make_path(path)
- mkdir_p(path) unless FileTest.directory?(path)
+ FileUtils::mkdir_p(path) unless FileTest.directory?(path)
end
def marshal
def dal_content
@@ -3319,10 +3319,10 @@ WOK
def mkdir #check moved from SiSU_file, existing mkdir
def processing
def dal
- mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal)
+ FileUtils::mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal)
end
def tune
- mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune)
+ FileUtils::mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune)
end
self
end
@@ -3354,20 +3354,20 @@ WOK
self
end
def mkdir_initialize # not used but consider using
- mkdir_p(output_path.base.dir) unless FileTest.directory?(output_path.base.dir)
- mkdir_p("#{output_path.base.dir}/#{@md.fnb}") unless FileTest.directory?("#{output_path.base.dir}/#{@md.fnb}")
- mkdir_p("#{output_path.base.dir}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base.dir}/#{@env.path.style}")
- mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal)
- mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune)
+ FileUtils::mkdir_p(output_path.base.dir) unless FileTest.directory?(output_path.base.dir)
+ FileUtils::mkdir_p("#{output_path.base.dir}/#{@md.fnb}") unless FileTest.directory?("#{output_path.base.dir}/#{@md.fnb}")
+ FileUtils::mkdir_p("#{output_path.base.dir}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base.dir}/#{@env.path.style}")
+ FileUtils::mkdir_p(@env.processing_path.dal) unless FileTest.directory?(@env.processing_path.dal)
+ FileUtils::mkdir_p(@env.processing_path.tune) unless FileTest.directory?(@env.processing_path.tune)
end
def mkdir
txt_path="#{output_path.base.dir}/#{@md.fnb}"
def output
def base
- mkdir_p(output_path.base.dir) unless FileTest.directory?(output_path.base.dir)
+ FileUtils::mkdir_p(output_path.base.dir) unless FileTest.directory?(output_path.base.dir)
end
def css
- mkdir_p("#{output_path.base.dir}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base.dir}/#{@env.path.style}")
+ FileUtils::mkdir_p("#{output_path.base.dir}/#{@env.path.style}") unless FileTest.directory?("#{output_path.base.dir}/#{@env.path.style}")
end
def epub
path=output_path.epub.dir
@@ -4258,7 +4258,7 @@ WOK
end
def dir
pth=@env.processing_path.git + '/' + @md.fnb + '/' + ft + '/' + @md.opt.lng
- mkdir_p(pth) unless FileTest.directory?(pth)
+ FileUtils::mkdir_p(pth) unless FileTest.directory?(pth)
pth
end
self
@@ -5166,11 +5166,11 @@ WOK
break
end
end
- mkdir_p("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}")
+ FileUtils::mkdir_p("#{@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)
- cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/index.html")
- cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/toc.html")
+ FileUtils::cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/index.html")
+ FileUtils::cp(homepage_path,"#{@env.path.webserv}/#{@env.path.stub_pwd}/toc.html")
else
doc_skin=nil
sk_doc='doc/skin_sisu.rb'
@@ -5189,15 +5189,15 @@ WOK
end
def cp_images(src_path,dest_path)
if FileTest.directory?(src_path)
- cd(src_path)
+ FileUtils::cd(src_path)
source=Dir.glob("*.{png,jpg,gif,ico}")
- mkdir_p(dest_path) unless FileTest.directory?(dest_path)
- chmod(0755,dest_path)
+ FileUtils::mkdir_p(dest_path) unless FileTest.directory?(dest_path)
+ FileUtils::chmod(0755,dest_path)
source.each do |i|
- cp_r(i,"#{dest_path}/#{i}")
- chmod(0644,"#{dest_path}/#{i}")
+ FileUtils::cp_r(i,"#{dest_path}/#{i}")
+ FileUtils::chmod(0644,"#{dest_path}/#{i}")
end
- cd(@pwd)
+ FileUtils::cd(@pwd)
else puts "\tWARN, did not find - #{src_path}"
end
end
@@ -5227,19 +5227,19 @@ WOK
cp_images(src,dest)
end
def cp_css
- mkdir_p("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}")
+ FileUtils::mkdir_p("#{@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']
SiSU_Screen::Ansi.new(@cmd,"modify is css set to: #{@rc['permission_set']['css_modify']}").warn if @cmd=~/[MV]/
css_path.each do |x|
if FileTest.directory?(x)
- cd(x)
+ FileUtils::cd(x)
source=Dir.glob("*.{css}")
source.each do |i|
- cp(i,"#{@env.path.output}/#{@env.path.style}")
+ FileUtils::cp(i,"#{@env.path.output}/#{@env.path.style}")
end
- cd(@pwd)
+ 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]/
@@ -5247,7 +5247,7 @@ WOK
fn_css=SiSU_Env::CSS_default.new
css=SiSU_Style::CSS.new
path_style="#{@env.path.output}/#{@env.path.style}"
- mkdir_p(path_style) unless FileTest.directory?(path_style)
+ FileUtils::mkdir_p(path_style) unless FileTest.directory?(path_style)
style=File.new("#{path_style}/#{fn_css.homepage}",'w')
style << css.homepage
style.close
diff --git a/lib/sisu/v3/termsheet.rb b/lib/sisu/v3/termsheet.rb
index b09bd5ac..455772c4 100644
--- a/lib/sisu/v3/termsheet.rb
+++ b/lib/sisu/v3/termsheet.rb
@@ -72,7 +72,7 @@ def talent(termsheet,flag)
@@info=termsheet.gsub(/(.+?)\.termsheet\.rb/,'../facility_data/\1.html')
@env=SiSU_Env::Info_env.new
@dir_fd="#{@env.path.output}/facility_data"
- mkdir_p(@dir_fd) unless FileTest.directory?(@dir_fd)==true
+ FileUtils::mkdir_p(@dir_fd) unless FileTest.directory?(@dir_fd)==true
html_output=[]
case termsheet
when /.+?\.(termsheet)\.rb$/
diff --git a/lib/sisu/v3/texinfo.rb b/lib/sisu/v3/texinfo.rb
index f0331513..06a921be 100644
--- a/lib/sisu/v3/texinfo.rb
+++ b/lib/sisu/v3/texinfo.rb
@@ -387,7 +387,7 @@ module SiSU_TexInfo
end
def place_info
unless FileTest.directory?(@f.output_path.texinfo.dir)
- mkdir_p(@f.output_path.texinfo.dir)
+ FileUtils::mkdir_p(@f.output_path.texinfo.dir)
end
info_src=%{#{@env.processing_path.texi}/#{@md.fnb}.info}
system("cp #{info_src} #{@f.place_file.info.dir}")
diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb
index ab7995f4..5f6674e5 100644
--- a/lib/sisu/v3/texpdf.rb
+++ b/lib/sisu/v3/texpdf.rb
@@ -145,8 +145,6 @@ module SiSU_TeX
end
private
class LaTeX_to_pdf
- require 'fileutils'
- include FileUtils #::Verbose
@@n_lpdf||=0 #change
def initialize(md,env)
@md,@env=md,env
@@ -184,15 +182,15 @@ module SiSU_TeX
when /legal/; pdf_p=@f.pdf_p_legal; pdf_l=@f.pdf_l_legal
else pdf_p=@f.pdf_p_a4; pdf_l=@f.pdf_l_a4
end
- mkdir_p(@md.file.output_path.pdf.dir) unless FileTest.directory?(@md.file.output_path.pdf.dir)
+ FileUtils::mkdir_p(@md.file.output_path.pdf.dir) unless FileTest.directory?(@md.file.output_path.pdf.dir)
if FileTest.file?(portrait_pdf)
- cp(portrait_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_p}")
- rm(portrait_pdf)
+ FileUtils::cp(portrait_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_p}")
+ FileUtils::rm(portrait_pdf)
else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{portrait_pdf}" if @md.opt.cmd.inspect =~/M/
end
if FileTest.file?(landscape_pdf)
- cp(landscape_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_l}")
- rm(landscape_pdf)
+ FileUtils::cp(landscape_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_l}")
+ FileUtils::rm(landscape_pdf)
else p "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.opt.cmd.inspect =~/M/
end
SiSU_Screen::Ansi.new(@md.opt.cmd,@@n_lpdf,'processed (SiSU LaTeX to pdf - using pdfetex aka. pdftex or pdflatex)').generic_number if @md.opt.cmd =~/[MVv]/
diff --git a/lib/sisu/v3/webrick.rb b/lib/sisu/v3/webrick.rb
index 55157c4f..9d827c17 100644
--- a/lib/sisu/v3/webrick.rb
+++ b/lib/sisu/v3/webrick.rb
@@ -83,8 +83,6 @@ begin #
require 'webrick'
include WEBrick
require 'time'
- require 'fileutils'
- include FileUtils
require_relative 'sysenv' # sysenv.rb
include SiSU_Env; include SiSU_Screen
@cX=SiSU_Screen::Ansi.new('yes').cX
@@ -163,7 +161,7 @@ WOK
filename << wb_s2
filename << wb_end
filename.close
- chmod(0755,"#{y}/wb.cgi &") if FileTest.file?("#{y}/wb.cgi &")
+ FileUtils::chmod(0755,"#{y}/wb.cgi &") if FileTest.file?("#{y}/wb.cgi &")
}
puts " #{@cX.off}"
get=@argv.shift if @argv[0] =~/pwd/ #% argv