diff options
author | Ralph Amissah <ralph@amissah.com> | 2008-01-19 03:19:08 +0000 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2008-01-19 03:35:04 +0000 |
commit | d6b580c9f67a9ee4b5f57310f34c28799d616da1 (patch) | |
tree | 37fab43f2d367e59cc5bcee178a844e176f7f97c | |
parent | permit to run on ruby 1.9, debian unstable requires it (diff) |
mkdir_p, and again close running of ruby 1.9
* mkdir_p, [instead of ftools file.mkpath]
* running against ruby 1.9 closed for now
raise request for use of version 1.8 branch
* manual update version
-rw-r--r-- | CHANGELOG | 12 | ||||
-rwxr-xr-x | bin/sisu | 4 | ||||
-rwxr-xr-x | bin/sisu_termsheet | 4 | ||||
-rwxr-xr-x | bin/sisu_webrick | 4 | ||||
-rw-r--r-- | data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi | 24 | ||||
-rw-r--r-- | lib/sisu/v0/composite.rb | 10 | ||||
-rw-r--r-- | lib/sisu/v0/concordance.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v0/conf.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v0/embedded.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v0/html_segments.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v0/param.rb | 3 | ||||
-rw-r--r-- | lib/sisu/v0/share_src.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v0/share_src_kdissert.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v0/sisupod_make.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v0/sitemaps.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v0/sysenv.rb | 77 | ||||
-rw-r--r-- | lib/sisu/v0/termsheet.rb | 2 |
17 files changed, 78 insertions, 90 deletions
@@ -9,17 +9,17 @@ Reverse Chronological: %% STABLE MANIFEST -%% sisu_0.64.2.orig.tar.gz (2008-01-18:02/5) +%% sisu_0.64.2.orig.tar.gz (2008-01-19:02/6) http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.2.orig.tar.gz sisu_0.64.2.orig.tar.gz sisu_0.64.2-1.dsc sisu_0.64.2-1.diff.gz - * permit running on ruby 1.9 - (not advised as there are likely to be issues with libraries (however - debian unstable requires this for install/upgrade)) - * bin/sisu, bin/sisu_webrick, bin/sisu_termsheet - * debian/control + * Dir.mkdir [instead of ftools File.mkpath], ruby 1.9 + + * debian/control, permit running on ruby 1.9, needed for debian unstable + install of current ruby (running remains stopped for the time being in + bin/sisu, bin/sisu_webrick, bin/sisu_termsheet [details remain]) %% sisu_0.64.1.orig.tar.gz (2008-01-09:01/3) http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.1.orig.tar.gz @@ -1,7 +1,7 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2008 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' -#raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' +raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' +#raise "Please, use Ruby1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' $VERBOSE=nil $KCODE='u' branch='v0' diff --git a/bin/sisu_termsheet b/bin/sisu_termsheet index 0424bcdb..e9b81374 100755 --- a/bin/sisu_termsheet +++ b/bin/sisu_termsheet @@ -1,7 +1,7 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2008 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' -#raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' +raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' +#raise "Please, use Ruby1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' $VERBOSE=nil branch='v0' SiSU_lib="sisu/#{branch}" diff --git a/bin/sisu_webrick b/bin/sisu_webrick index 867587b4..3c483581 100755 --- a/bin/sisu_webrick +++ b/bin/sisu_webrick @@ -1,7 +1,7 @@ #!/usr/bin/env ruby #SiSU: copyright (C) 1997..2008 Ralph Amissah; License GPL, see appended program information -raise "Please, use Ruby1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' -#raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' +raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9' +#raise "Please, use Ruby1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' $VERBOSE=nil branch='v0' SiSU_lib="sisu/#{branch}" diff --git a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi index 479e294b..73a0b136 100644 --- a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi +++ b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi @@ -18,9 +18,9 @@ @date.available: 2007-08-28 -@date.modified: 2008-01-09 +@date.modified: 2008-01-19 -@date: 2008-01-09 +@date: 2008-01-19 @level: new=C; break=1; num_top=1 @@ -55,7 +55,7 @@ Download the latest version of SiSU (and SiSU markup samples):~{ Breakage and Fixes Report<br> http://www.jus.uio.no/sisu/SiSU/breakage_and_fixes.html }~ -_* {~^ sisu_0.64.1.orig.tar.gz (of 2008-01-09:01/3) }http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.1.orig.tar.gz +_* {~^ sisu_0.64.2.orig.tar.gz (of 2008-01-19:02/6) }http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.2.orig.tar.gz _* {~^ sisu-markup-samples_1.0.8.orig.tar.gz (of 2007-08-19:33/7 ) }http://www.jus.uio.no/sisu/pkg/src/sisu-markup-samples_1.0.8.orig.tar.gz *~sisu-markup-samples @@ -90,23 +90,23 @@ deb-src http://www.jus.uio.no/sisu/archive unstable main non-free !_ Source -_* {~^ sisu_0.64.1.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.1.orig.tar.gz +_* {~^ sisu_0.64.2.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.2.orig.tar.gz -_* {~^ sisu_0.64.1-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.1-1.diff.gz +_* {~^ sisu_0.64.2-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.2-1.diff.gz -_* {~^ sisu_0.64.1-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.1-1.dsc +_* {~^ sisu_0.64.2-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_0.64.2-1.dsc !_ Debs -_* {~^ sisu_0.64.1-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_0.64.1-1_all.deb ~{ <br>sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies <br>Depends: ruby (>=1.8.2), libwebrick-ruby<br>Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~ +_* {~^ sisu_0.64.2-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_0.64.2-1_all.deb ~{ <br>sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies <br>Depends: ruby (>=1.8.2), libwebrick-ruby<br>Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~ -_* {~^ sisu-complete_0.64.1-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_0.64.1-1_all.deb ~{ <br>a package that pulls in other packages to build the whole of sisu (excluding sisu-examples) <br>Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu<br>Recommends: sisu-examples }~ +_* {~^ sisu-complete_0.64.2-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_0.64.2-1_all.deb ~{ <br>a package that pulls in other packages to build the whole of sisu (excluding sisu-examples) <br>Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu<br>Recommends: sisu-examples }~ -_* {~^ sisu-pdf_0.64.1-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_0.64.1-1_all.deb ~{ <br>dependencies used by sisu to produce pdf from LaTeX generated <br>Depends: sisu, tetex-bin, tetex-extra, latex-ucs<br>Suggests: evince, xpdf }~ +_* {~^ sisu-pdf_0.64.2-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_0.64.2-1_all.deb ~{ <br>dependencies used by sisu to produce pdf from LaTeX generated <br>Depends: sisu, tetex-bin, tetex-extra, latex-ucs<br>Suggests: evince, xpdf }~ -_* {~^ sisu-postgresql_0.64.1-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_0.64.1-1_all.deb ~{ <br>dependencies used by sisu to populate postgresql database (further configuration is necessary) <br>Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby<br>Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~ +_* {~^ sisu-postgresql_0.64.2-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_0.64.2-1_all.deb ~{ <br>dependencies used by sisu to populate postgresql database (further configuration is necessary) <br>Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby<br>Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~ -_* {~^ sisu-sqlite_0.64.1-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_0.64.1-1_all.deb ~{ <br>dependencies used by sisu to populate sqlite database <br>Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby<br>Suggests: libdbd-sqlite }~ +_* {~^ sisu-sqlite_0.64.2-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_0.64.2-1_all.deb ~{ <br>dependencies used by sisu to populate sqlite database <br>Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby<br>Suggests: libdbd-sqlite }~ For changelogs see: @@ -132,7 +132,7 @@ _1 http://www.jus.uio.no/sisu/sisu_markup_samples_changelog/changelog_markup_sam The RPM is generated Alien~{ http://www.kitenet.net/programs/alien/ }~ from two deb packages (sisu and sisu-doc). Dependencies are not handled, not even that of the essential Ruby. -_* {~^ sisu-0.64.1-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-0.64.1-2.noarch.rpm ~{ untested, created using: alien -r sisu_0.64.1-1_all.deb }~ +_* {~^ sisu-0.64.2-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-0.64.2-2.noarch.rpm ~{ untested, created using: alien -r sisu_0.64.2-1_all.deb }~ _* {~^ sisu-markup-samples_1.0.8.orig-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-markup-samples_1.0.6.orig-2.noarch.rpm ~{ <br> untested, created using alien }~ diff --git a/lib/sisu/v0/composite.rb b/lib/sisu/v0/composite.rb index fb393384..e0b53bb5 100644 --- a/lib/sisu/v0/composite.rb +++ b/lib/sisu/v0/composite.rb @@ -71,7 +71,7 @@ module SiSU_Assemble end def download_images(download_from,images_array) path="#{@env.path.processing}/external_document/image" - File.mkpath(path) unless FileTest.directory?(path) + mkdir_p(path) unless FileTest.directory?(path) images_array.each do |i| image="#{path}/#{i}" imagefile=File.new(image,'w+') @@ -81,12 +81,12 @@ module SiSU_Assemble imagefile.close end output_path="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_external" - File.mkpath(output_path) unless FileTest.directory?(output_path) + 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.path.processing}/external_document/skin/doc" - File.mkpath(path) unless FileTest.directory?(path) + mkdir_p(path) unless FileTest.directory?(path) download_from=doc_skin.shift doc_skin.each do |i| skin="#{path}/#{i}.rb" @@ -122,7 +122,7 @@ module SiSU_Assemble end def download_images(download_from,images_array) path="#{@env.path.processing}/external_document/image" - File.mkpath(path) unless FileTest.directory?(path) + mkdir_p(path) unless FileTest.directory?(path) images_array.each do |i| image="#{path}/#{i}" unless FileTest.exists?(image) @@ -136,7 +136,7 @@ module SiSU_Assemble end def download_doc_skin(doc_skin) #first element in array is source url path="#{@env.path.processing}/external_document/skin/doc" - File.mkpath(path) unless FileTest.directory?(path) + 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/v0/concordance.rb b/lib/sisu/v0/concordance.rb index 814e2b88..8408deaf 100644 --- a/lib/sisu/v0/concordance.rb +++ b/lib/sisu/v0/concordance.rb @@ -208,7 +208,7 @@ WOK end def songsheet begin - File.mkpath(@path) unless FileTest.directory?(@path) + mkdir_p(@path) unless FileTest.directory?(@path) @file_index_all=File.open("#@path/#{@md.fn[:concordance]}",'w') map_para rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error diff --git a/lib/sisu/v0/conf.rb b/lib/sisu/v0/conf.rb index a11cb807..2e76d3de 100644 --- a/lib/sisu/v0/conf.rb +++ b/lib/sisu/v0/conf.rb @@ -139,7 +139,7 @@ module SiSU_Initialize tell=SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring DTDs','') tell.colorize unless @opt.cmd =~/q/ @rxng=SiSU_relaxng::RelaxNG.new - @path.each { |d| File.mkpath(d[1]) unless FileTest.directory?(d[1]) } + @path.each { |d| 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 diff --git a/lib/sisu/v0/embedded.rb b/lib/sisu/v0/embedded.rb index 82c0317f..2bd295e2 100644 --- a/lib/sisu/v0/embedded.rb +++ b/lib/sisu/v0/embedded.rb @@ -90,7 +90,7 @@ module SiSU_Embedded 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) + mkdir_p(ldest) unless FileTest.directory?(ldest) src_ec="#{src}/" + @md.ec[:image].join(" #{src}/") unless @opt.fns =~/\.-sst$/ SiSU_Env::System_call.new(src_ec,"#{ldest}/.",'q').rsync @@ -109,7 +109,7 @@ module SiSU_Embedded 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) + 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.cmd.inspect =~/R/ #rsync to remote audio directory @@ -126,7 +126,7 @@ module SiSU_Embedded 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) + 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.cmd.inspect =~/R/ #rsync to remote video directory diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index c170aa81..7972619a 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -146,7 +146,7 @@ module SiSU_HTML_seg if para =~/^4~\S+/ \ or para =~/^<ENDNOTES>|^<EOF>/ # @@level4 if tracking != 0 - File.mkpath(@md.dir_out) unless FileTest.directory?(@md.dir_out) #bug - added specifically for nav! not needed by regular seg, check !!! + mkdir_p(@md.dir_out) unless FileTest.directory?(@md.dir_out) #bug - added specifically for nav! not needed by regular seg, check !!! Seg.new('',@md).tail segfilename="#{@md.dir_out}/#{@md.fnl[:pre]}#{@@seg_name_html[tracking-1]}#{@md.fnl[:mid]}#@h_sfx#{@md.fnl[:post]}" @@filename_seg=File.new(segfilename,'w') if @@seg_name_html[tracking-1] diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb index 2f2043fb..546606af 100644 --- a/lib/sisu/v0/param.rb +++ b/lib/sisu/v0/param.rb @@ -60,9 +60,6 @@ module SiSU_Param require 'uri' require 'pstore' - if RUBY_VERSION < '1.9' - require 'ftools' - end require "#{SiSU_lib}/sysenv" include SiSU_Env require "#{SiSU_lib}/param_identify_markup" diff --git a/lib/sisu/v0/share_src.rb b/lib/sisu/v0/share_src.rb index 81897bcb..e7a23e6c 100644 --- a/lib/sisu/v0/share_src.rb +++ b/lib/sisu/v0/share_src.rb @@ -76,8 +76,8 @@ module SiSU_Markup tell.green_hi_blue unless @opt.cmd =~/q/ tell=SiSU_Screen::Ansi.new(@opt.cmd,"Copy sisu markup file to output directory","#{@opt.fns} -> #@output_path") tell.warn unless @opt.cmd =~/q/ - File.mkpath("#{@env.path.output}/src") unless FileTest.directory?("#{@env.path.output}/src") - File.mkpath(@output_path) unless FileTest.directory?(@output_path) + mkdir_p("#{@env.path.output}/src") unless FileTest.directory?("#{@env.path.output}/src") + mkdir_p(@output_path) unless FileTest.directory?(@output_path) if FileTest.directory?(@output_path) unless @opt.fns =~/\.ssm$/; cp(@opt.fns,@output_path) else diff --git a/lib/sisu/v0/share_src_kdissert.rb b/lib/sisu/v0/share_src_kdissert.rb index 43814331..fe7985fd 100644 --- a/lib/sisu/v0/share_src_kdissert.rb +++ b/lib/sisu/v0/share_src_kdissert.rb @@ -74,8 +74,8 @@ module SiSU_Kdi_source tell.green_hi_blue unless @opt.cmd =~/q/ tell=SiSU_Screen::Ansi.new(@opt.cmd,"Copy kdissert file to output directory","#{@opt.fnb} -> #@output_path") tell.warn unless @opt.cmd =~/q/ - File.mkpath(@env.path.output) unless FileTest.directory?(@env.path.output) - File.mkpath(@output_path) unless FileTest.directory?(@output_path) + mkdir_p(@env.path.output) unless FileTest.directory?(@env.path.output) + mkdir_p(@output_path) unless FileTest.directory?(@output_path) if FileTest.directory?(@output_path) if @opt.fns =~/\.kdi\._sst$/ \ and FileTest.file?(@opt.fnb) diff --git a/lib/sisu/v0/sisupod_make.rb b/lib/sisu/v0/sisupod_make.rb index a4a97241..669ff49f 100644 --- a/lib/sisu/v0/sisupod_make.rb +++ b/lib/sisu/v0/sisupod_make.rb @@ -79,7 +79,7 @@ module SiSU_Doc @zipfile=if @opt.fns =~/\.ssm\.sst$/; @opt.fns.gsub(/(?:\~\S{2,3})?\.ssm\.sst$/,'.ssm') else @opt.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1') end - File.mkpath(pod_path) unless FileTest.directory?(pod_path) + mkdir_p(pod_path) unless FileTest.directory?(pod_path) rm_rf("#{@env.path.processing}sisupod/*") if FileTest.directory?("#{@env.path.processing}sisupod") end def read @@ -260,7 +260,7 @@ module SiSU_Doc end #NB not all possibilies met, revisit, also in case of composite file may wish to add README end def sisupod_7zip #look at later - File.mkpath(@local_path) unless FileTest.directory?(@local_path) + mkdir_p(@local_path) unless FileTest.directory?(@local_path) system(%{ cd #{@env.path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt @@ -275,7 +275,7 @@ module SiSU_Doc tell.blue_tab unless @opt.cmd =~/q/ end def sisupod_zip - File.mkpath(@local_path) unless FileTest.directory?(@local_path) + mkdir_p(@local_path) unless FileTest.directory?(@local_path) system(%{ cd #{@env.path.processing} echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt diff --git a/lib/sisu/v0/sitemaps.rb b/lib/sisu/v0/sitemaps.rb index 9838e60b..3742a786 100644 --- a/lib/sisu/v0/sitemaps.rb +++ b/lib/sisu/v0/sitemaps.rb @@ -104,7 +104,7 @@ module SiSU_Sitemaps end end def make_path(path) - File.mkpath(path) unless FileTest.directory?(path) + mkdir_p(path) unless FileTest.directory?(path) end def output_map(sitemap) path="#{@env.path.output}/#{@md.fnb}" diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index 4187f6e9..28dc088b 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -869,7 +869,7 @@ module SiSU_Env 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) } + paths.each {|x| mkdir_p(x) unless FileTest.directory?(x) } end def defaults #multiple default directories @default_dir ||=@sys.default_dir #DEFAULT_DIR @@ -1290,14 +1290,14 @@ WOK defaults[:webserv_path] else #create default directory under home and place output there unless FileTest.directory?(defaults[:output_local]) - File.mkpath(defaults[:output_local]) + mkdir_p(defaults[:output_local]) end defaults[:output_local] end end def webserv_stub_ensure - File.mkpath(path.webserv) unless FileTest.directory?(path.webserv) - File.mkpath("#{path.webserv}/#@stub_pwd") unless FileTest.directory?("#{path.webserv}/#@stub_pwd") + mkdir_p(path.webserv) unless FileTest.directory?(path.webserv) + mkdir_p("#{path.webserv}/#@stub_pwd") unless FileTest.directory?("#{path.webserv}/#@stub_pwd") end def webserv_map_pwd #dir "#{path.webserv}/#{stub_pwd}" @@ -1329,7 +1329,7 @@ WOK end def encoding pth="#{processing}/#{defaults[:processing_encoding]}" - File.mkpath(pth) unless FileTest.directory?(pth) + mkdir_p(pth) unless FileTest.directory?(pth) pth end def processing_base_tmp @@ -1380,15 +1380,15 @@ WOK end def processing #processing directory, used/needed for sisu work files, has sub-directories (dal,tex etc) unless FileTest.directory?(processing_path_root) - File.mkpath(processing_path_root) + mkdir_p(processing_path_root) File.chmod(0777,processing_path_root) end if processing_path_usr? processing_path_usr="#{processing_path_root}/#{user}" - File.mkpath(processing_path_usr) unless FileTest.directory?(processing_path_usr) + mkdir_p(processing_path_usr) unless FileTest.directory?(processing_path_usr) File.chmod(0700,processing_path_usr) end - File.mkpath(processing_path) unless FileTest.directory?(processing_path) + mkdir_p(processing_path) unless FileTest.directory?(processing_path) File.chmod(0700,processing_path) path_processing=[processing_path,defaults[:processing_path],defaults[:processing_path_home]] processing=nil @@ -1396,7 +1396,7 @@ WOK processing=v unless FileTest.directory?(processing) puts "a processing directory (#{processing}) is being created for use by sisu" - File.mkpath(processing) + mkdir_p(processing) File.chmod(0700,processing) end break @@ -1405,21 +1405,21 @@ WOK end def composite_file pth=path.dal #"#{processing}/composite" - File.mkpath(pth) unless FileTest.directory?(pth) + mkdir_p(pth) unless FileTest.directory?(pth) pth end def dal pth=if defined? @rc['processing']['dal']; "#{processing}/#{@rc['processing']['dal']}" else "#{processing}/#{defaults[:processing_dal]}" end - File.mkpath(pth) unless FileTest.directory?(pth) + mkdir_p(pth) unless FileTest.directory?(pth) pth end def tune pth=if defined? @rc['processing']['tune']; "#{processing}/#{@rc['processing']['tune']}" else "#{processing}/#{defaults[:processing_tune]}" end - File.mkpath(pth) unless FileTest.directory?(pth) + mkdir_p(pth) unless FileTest.directory?(pth) pth end def odf @@ -1429,14 +1429,14 @@ WOK pth=if defined? @rc['processing']['latex']; "#{processing}/#{@rc['processing']['latex']}" else "#{processing}/#{defaults[:processing_latex]}" end - File.mkpath(pth) unless FileTest.directory?(pth) + mkdir_p(pth) unless FileTest.directory?(pth) pth end def texi pth=if defined? @rc['processing']['texinfo']; "#{processing}/#{@rc['processing']['texinfo']}" else "#{processing}/#{defaults[:processing_texinfo]}" end - File.mkpath(pth) unless FileTest.directory?(pth) + mkdir_p(pth) unless FileTest.directory?(pth) pth end def texinfo #texinfo webserv, check @@ -1446,7 +1446,7 @@ WOK pth=if defined? @rc['processing']['lout']; "#{processing}/#{@rc['processing']['lout']}" else "#{processing}/#{defaults[:processing_lout]}" end - File.mkpath(pth) unless FileTest.directory?(pth) + mkdir_p(pth) unless FileTest.directory?(pth) pth end def feed @@ -1705,12 +1705,9 @@ WOK def images_local if FileTest.directory?(defaults[:image_local]) if @@image_flag - if RUBY_VERSION < '1.9' - require 'ftools' - end images=Dir.glob("#{defaults[:image_local]}/*.{png,jpg,gif}") pth="#{path.webserv}/#@stub_pwd" - File.mkpath("#{pth}/_sisu/image") unless FileTest.directory?("#{pth}/_sisu/image") + mkdir_p("#{pth}/_sisu/image") unless FileTest.directory?("#{pth}/_sisu/image") images.each { |i| File.install(i,"#{pth}/#{i}") } unless images.length > 0 @@image_flag=false end @@ -1733,12 +1730,9 @@ WOK def images_external if FileTest.directory?(image_external) if @@image_flag - if RUBY_VERSION < '1.9' - require 'ftools' - end images=Dir.glob("#{image_external}/*.{png,jpg,gif}") pth="#{path.webserv}/#@stub_pwd" - File.mkpath("#{pth}/_sisu/image_external") unless FileTest.directory?("#{pth}/_sisu/image_external") + 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 @@ -2002,7 +1996,7 @@ WOK rm_rf(sisupod_processing_path) end unless FileTest.directory?(sisupod_processing_path) - File.mkpath(sisupod_processing_path) + mkdir_p(sisupod_processing_path) end if FileTest.file?("#{Dir.pwd}/#{fns_pod}") system("unzip -q #{Dir.pwd}/#{fns_pod} -d #{path.processing}") @@ -2537,9 +2531,6 @@ WOK class Info_version <Info_env require 'rbconfig' def get_version - if RUBY_VERSION < '1.9' - require 'ftools' - end @version={} @pwd=ENV['PWD'] yst_etc="#{defaults[:sisu_etc]}/version.yml" @@ -2559,7 +2550,7 @@ WOK end def images unless FileTest.directory?("#{@env.path.output}/_sisu") - File.mkpath("#{@env.path.output}/_sisu") + 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") @@ -2882,23 +2873,23 @@ WOK end end def make_path(path) - File.mkpath(path) unless FileTest.directory?(path) + mkdir_p(path) unless FileTest.directory?(path) end def mkdir_initialize # not used but consider using - File.mkpath(@env.path.output) unless FileTest.directory?(@env.path.output) - File.mkpath("#{@env.path.output}/#@fnb") unless FileTest.directory?("#{@env.path.output}/#@fnb") - File.mkpath("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}") - File.mkpath(@env.path.dal) unless FileTest.directory?(@env.path.dal) - File.mkpath(@env.path.tune) unless FileTest.directory?(@env.path.tune) + mkdir_p(@env.path.output) unless FileTest.directory?(@env.path.output) + mkdir_p("#{@env.path.output}/#@fnb") unless FileTest.directory?("#{@env.path.output}/#@fnb") + mkdir_p("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}") + mkdir_p(@env.path.dal) unless FileTest.directory?(@env.path.dal) + mkdir_p(@env.path.tune) unless FileTest.directory?(@env.path.tune) end def mkdir dir=@env.path.output txt_path="#{dir}/#@fnb" - File.mkpath(dir) unless FileTest.directory?(dir) - File.mkpath(txt_path) unless FileTest.directory?(txt_path) - File.mkpath("#{dir}/#{@env.path.style}") unless FileTest.directory?("#{dir}/#{@env.path.style}") - File.mkpath(@env.path.dal) unless FileTest.directory?(@env.path.dal) - File.mkpath(@env.path.tune) unless FileTest.directory?(@env.path.tune) + mkdir_p(dir) unless FileTest.directory?(dir) + mkdir_p(txt_path) unless FileTest.directory?(txt_path) + mkdir_p("#{dir}/#{@env.path.style}") unless FileTest.directory?("#{dir}/#{@env.path.style}") + mkdir_p(@env.path.dal) unless FileTest.directory?(@env.path.dal) + mkdir_p(@env.path.tune) unless FileTest.directory?(@env.path.tune) end def mkfile #consider using more path="#{@env.path.output}/#@fnb" @@ -3024,7 +3015,7 @@ WOK break end end - File.mkpath("#{@env.path.webserv}/#{@env.path.stub_pwd}") unless FileTest.directory?("#{@env.path.webserv}/#{@env.path.stub_pwd}") + 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") @@ -3049,7 +3040,7 @@ WOK if FileTest.directory?(src_path) cd(src_path) source=Dir.glob("*.{png,jpg,gif,ico}") - File.mkpath(dest_path) unless FileTest.directory?(dest_path) + mkdir_p(dest_path) unless FileTest.directory?(dest_path) chmod(0755,dest_path) source.each do |i| cp_r(i,"#{dest_path}/#{i}") @@ -3080,7 +3071,7 @@ WOK cp_images(src,dest) end def cp_css - File.mkpath("#{@env.path.output}/#{@env.path.style}") unless FileTest.directory?("#{@env.path.output}/#{@env.path.style}") + 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'] @@ -3101,7 +3092,7 @@ WOK fn_css=SiSU_Env::CSS_default.new css=SiSU_Style::CSS.new path_style="#{@env.path.output}/#{@env.path.style}" - File.mkpath(path_style) unless FileTest.directory?(path_style) + 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/v0/termsheet.rb b/lib/sisu/v0/termsheet.rb index 54c92a81..2a50eb4f 100644 --- a/lib/sisu/v0/termsheet.rb +++ b/lib/sisu/v0/termsheet.rb @@ -73,7 +73,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" - File.mkpath(@dir_fd) unless FileTest.directory?(@dir_fd)==true + mkdir_p(@dir_fd) unless FileTest.directory?(@dir_fd)==true html_output=[] case termsheet when /.+?\.(termsheet)\.rb$/ |