aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-06-03 22:29:09 -0400
committerRalph Amissah <ralph@amissah.com>2012-06-03 22:29:50 -0400
commit35e3bcae6aac45cdbcc1c7f63bbeb1870c171bff (patch)
tree0b67db48517527d39e4ef8e21a1653675bc93805 /lib
parentv3: images, regular & sisupod (diff)
v3: images, copy (system link removed)sisu_3.2.11
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v3/conf.rb1
-rw-r--r--lib/sisu/v3/dal.rb1
-rw-r--r--lib/sisu/v3/epub.rb5
-rw-r--r--lib/sisu/v3/html.rb5
-rw-r--r--lib/sisu/v3/shared_images.rb7
-rw-r--r--lib/sisu/v3/sst_do_inline_footnotes.rb1
-rw-r--r--lib/sisu/v3/sysenv.rb46
7 files changed, 24 insertions, 42 deletions
diff --git a/lib/sisu/v3/conf.rb b/lib/sisu/v3/conf.rb
index 8a323ac4..8cd3e2ef 100644
--- a/lib/sisu/v3/conf.rb
+++ b/lib/sisu/v3/conf.rb
@@ -108,7 +108,6 @@ module SiSU_Initialize
def cp_webserver_images
SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy webserver/output file images','').colorize unless @opt.cmd =~/q/
SiSU_Env::CreateSite.new(@opt.cmd).cp_webserver_images
- SiSU_Env::CreateSystemLink.new.images
end
def css
SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring CSSs','').colorize unless @opt.cmd =~/q/
diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb
index dd1ec494..24f29bd3 100644
--- a/lib/sisu/v3/dal.rb
+++ b/lib/sisu/v3/dal.rb
@@ -105,7 +105,6 @@ module SiSU_DAL
@idx_xhtml=@make_fns.marshal.dal_idx_xhtml
@map_nametags=@make_fns.marshal.dal_map_nametags
@map_ocn_htmlseg=@make_fns.marshal.dal_map_ocn_htmlseg
- SiSU_Env::CreateSystemLink.new.images
@env=SiSU_Env::InfoEnv.new
end
def read #creates dal
diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb
index a2530cbb..06021574 100644
--- a/lib/sisu/v3/epub.rb
+++ b/lib/sisu/v3/epub.rb
@@ -133,10 +133,7 @@ module SiSU_EPUB
@particulars=particulars
@md,@env=particulars.md,particulars.env
@vz=SiSU_Env::GetInit.instance.skin
- @env,@css,@symlnk=particulars.env,SiSU_Style::CSS.new,SiSU_Env::CreateSystemLink.new #home
- end
- def link_images
- @symlnk.images
+ @env,@css=particulars.env,SiSU_Style::CSS.new
end
def directories
title=File.basename(@md.fns,'.rb')
diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb
index 46f051c6..a5c1edb1 100644
--- a/lib/sisu/v3/html.rb
+++ b/lib/sisu/v3/html.rb
@@ -139,10 +139,7 @@ module SiSU_HTML
@particulars=particulars
@md,@env=particulars.md,particulars.env
@vz=SiSU_Env::GetInit.instance.skin
- @env,@css,@symlnk=particulars.env,SiSU_Style::CSS.new,SiSU_Env::CreateSystemLink.new #home
- end
- def link_images
- @symlnk.images
+ @env,@css=particulars.env,SiSU_Style::CSS.new
end
def tuned_file_instructions
@tell=SiSU_Screen::Ansi.new(@md.opt.cmd)
diff --git a/lib/sisu/v3/shared_images.rb b/lib/sisu/v3/shared_images.rb
index a5a412b8..03093c6a 100644
--- a/lib/sisu/v3/shared_images.rb
+++ b/lib/sisu/v3/shared_images.rb
@@ -85,8 +85,11 @@ module SiSU_Images
unless images
images=Dir.glob("*.{png,jpg,gif,ico}")
end
- FileUtils::mkdir_p(dest_path) unless FileTest.directory?(dest_path)
- FileUtils::chmod(0755,dest_path)
+ unless FileTest.directory?(dest_path) \
+ or FileTest.symlink?(dest_path)
+ FileUtils::mkdir_p(dest_path)
+ FileUtils::chmod(0755,dest_path)
+ end
if images.length > 0
images.each do |i|
if FileTest.file?(i)
diff --git a/lib/sisu/v3/sst_do_inline_footnotes.rb b/lib/sisu/v3/sst_do_inline_footnotes.rb
index ab9fbbce..4ceb54fa 100644
--- a/lib/sisu/v3/sst_do_inline_footnotes.rb
+++ b/lib/sisu/v3/sst_do_inline_footnotes.rb
@@ -85,7 +85,6 @@ module SiSU_ConvertFootnotes
@@fns||@opt.fns
@my_make=SiSU_Env::CreateFile.new(@opt.fns)
@fnm=SiSU_Env::InfoFile.new(@opt.fns).marshal.dal_content
- SiSU_Env::CreateSystemLink.new.images
end
def read #creates dal
begin
diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb
index f57185fc..b8dd37b0 100644
--- a/lib/sisu/v3/sysenv.rb
+++ b/lib/sisu/v3/sysenv.rb
@@ -3404,28 +3404,6 @@ WOK
%x{ruby -v}.strip
end
end
- class CreateSystemLink #revisit problems created 2004w41
- require 'fileutils'
- include FileUtils::Verbose
- def initialize
- @env=SiSU_Env::InfoEnv.new
- end
- def images
- unless FileTest.directory?("#{@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")
- 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
- end
- def man_pdf
- #File.symlink("../../man/form", "#{@env.path.output}/man/pdf") unless File.symlink?("#{@env.path.output}/man/pdf")==true
- end
- end
class InfoFile <InfoEnv #todo unify with FileOp
def initialize(fns)
begin
@@ -5930,29 +5908,39 @@ WOK
def cp_local_images
src="#{@pwd}/_sisu/image"
dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image"
- cp_images(src,dest)
+ cp_images(src,dest) if FileTest.directory?(src)
end
def cp_external_images
src="#{@env.processing_path.processing}/external_document/image"
dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external"
if FileTest.directory?(src)
- cp_images(src,dest)
+ cp_images(src,dest) if FileTest.directory?(src)
end
end
def cp_webserver_images
src=@env.path.image_source
- dest="#{@env.path.webserv}/_sisu/image"
- cp_images(src,dest)
+ dest_arr=[
+ "#{@env.path.webserv}/_sisu/image",
+ "#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image"
+ ]
+ dest_arr.each do |dest|
+ cp_images(src,dest) if FileTest.directory?(src)
+ end
end
def cp_webserver_images_local #this should not have been necessary
src=@env.path.image_source
dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image"
- cp_images(src,dest)
+ cp_images(src,dest) if FileTest.directory?(src)
end
def cp_base_images #fix images
src="#{@env.path.share}/image"
- dest="#{@env.path.webserv}/_sisu/image_sys"
- cp_images(src,dest)
+ dest_arr=[
+ "#{@env.path.webserv}/_sisu/image_sys",
+ "#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_sys"
+ ]
+ dest_arr.each do |dest|
+ cp_images(src,dest) if FileTest.directory?(src)
+ end
end
def cp_css
FileUtils::mkdir_p("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}")