diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-08-08 00:21:14 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-08-08 00:21:14 -0400 |
commit | 03f79b10f928c7bb7791b7ea3ee9e8222eb15cc9 (patch) | |
tree | 9f1f7de42705f734d8d456f3708db19146804ecf | |
parent | debian/changelog (5.5.5-1) (diff) | |
parent | v6: hub, further changes related to use of opt.act; hub file split (diff) |
Merge tag 'sisu_5.5.6' into debian/sid
SiSU 5.5.6
203 files changed, 3716 insertions, 3021 deletions
diff --git a/conf/sisu/rc/sisurc_by_fn.yml b/conf/sisu/rc/sisurc_by_fn.yml index 2e48b7de..dfd8e1bd 100644 --- a/conf/sisu/rc/sisurc_by_fn.yml +++ b/conf/sisu/rc/sisurc_by_fn.yml @@ -49,12 +49,22 @@ show_output_on: 'filesystem_url' #% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default) flag: color: true # making colour default -c is toggle, and will now toggle colour off -# default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' -# i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' -# ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' -# iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' -# iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --postresql --update --manifest' -# v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act0: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' +# act1: '--digest --text --html --manifest' +# act2: '--digest --text --html --epub --pdf --manifest' +# act3: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' +# act4: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --manifest' +# act5: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --sqlite --manifest' +# act6: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' +# act7: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act8: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' +# act9: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --source --sisupod --manifest' +## default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' +## i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' +## ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' +## iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' +## iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' +## v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' #% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal default: diff --git a/conf/sisu/rc/sisurc_by_ft.yml b/conf/sisu/rc/sisurc_by_ft.yml index 09be296a..3b0db1d1 100644 --- a/conf/sisu/rc/sisurc_by_ft.yml +++ b/conf/sisu/rc/sisurc_by_ft.yml @@ -49,12 +49,22 @@ show_output_on: 'filesystem_url' #% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default) flag: color: true # making colour default -c is toggle, and will now toggle colour off -# default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' -# i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' -# ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' -# iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' -# iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --postresql --update --manifest' -# v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act0: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' +# act1: '--digest --text --html --manifest' +# act2: '--digest --text --html --epub --pdf --manifest' +# act3: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' +# act4: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --manifest' +# act5: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --sqlite --manifest' +# act6: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' +# act7: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act8: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' +# act9: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --source --sisupod --manifest' +## default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' +## i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' +## ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' +## iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' +## iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' +## v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' #% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal default: diff --git a/conf/sisu/rc/sisurc_by_lng.yml b/conf/sisu/rc/sisurc_by_lng.yml index 18bfc313..4b2d110e 100644 --- a/conf/sisu/rc/sisurc_by_lng.yml +++ b/conf/sisu/rc/sisurc_by_lng.yml @@ -49,12 +49,22 @@ show_output_on: 'filesystem_url' #% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default) flag: color: true # making colour default -c is toggle, and will now toggle colour off -# default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' -# i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' -# ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' -# iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' -# iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --postresql --update --manifest' -# v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act0: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' +# act1: '--digest --text --html --manifest' +# act2: '--digest --text --html --epub --pdf --manifest' +# act3: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' +# act4: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --manifest' +# act5: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --sqlite --manifest' +# act6: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' +# act7: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act8: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' +# act9: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --source --sisupod --manifest' +## default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' +## i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' +## ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' +## iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' +## iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' +## v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' #% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal default: diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index e3646e86..a4e158bb 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -31,6 +31,17 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 5.5.6.orig.tar.xz (2014-08-08:31/5) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.5.6 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.5.6-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_5.5.6.orig.tar.xz + sisu_5.5.6.orig.tar.xz + sisu_5.5.6-1.dsc + +* remains as 5.5.5 changes for easier comparison with v6 + * file renames + * dp, indentation changed + %% 5.5.5.orig.tar.xz (2014-07-29:30/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.5.5 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.5.5-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index cc2f9321..dd8a38b0 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -21,6 +21,25 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 6.2.0.orig.tar.xz (2014-08-08:31/5) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.2.0 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.2.0-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.0.orig.tar.xz + sisu_6.2.0.orig.tar.xz + sisu_6.2.0-1.dsc + +* some file renames, fairly extensive + +* commandline, --act0 to --act9 & rc-config with act instead of roman numeral + * configurable command line options increased to 0 - 9 (instead of 0 - 5) + * use --act0 to --act9 + * default --act0 + * rc config with flag:act0 to flag:act9 + * legacy roman numeral configuration works (for now) + +* internally use opt.act (simplify, cleaner, instead of opt.cmd & opt.mod, now + removed) + %% 6.1.5.orig.tar.xz (2014-07-29:30/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.1.5 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.1.5-1 diff --git a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn.yml b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn.yml index 1f0a7981..e8d42695 100644 --- a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn.yml +++ b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_fn.yml @@ -49,12 +49,16 @@ show_output_on: 'filesystem_url' #% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default) flag: color: true # making colour default -c is toggle, and will now toggle colour off -# default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' -# i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' -# ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' -# iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' -# iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --postresql --update --manifest' -# v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act0: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' +# act1: '--digest --text --html --manifest' +# act2: '--digest --text --html --epub --pdf --manifest' +# act3: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' +# act4: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --manifest' +# act5: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --sqlite --manifest' +# act6: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' +# act7: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act8: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' +# act9: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --source --sisupod --manifest' #% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal default: diff --git a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft.yml b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft.yml index 8a9f13d8..b80808fc 100644 --- a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft.yml +++ b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_ft.yml @@ -49,12 +49,16 @@ show_output_on: 'filesystem_url' #% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default) flag: color: true # making colour default -c is toggle, and will now toggle colour off -# default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' -# i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' -# ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' -# iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' -# iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --postresql --update --manifest' -# v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act0: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' +# act1: '--digest --text --html --manifest' +# act2: '--digest --text --html --epub --pdf --manifest' +# act3: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' +# act4: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --manifest' +# act5: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --sqlite --manifest' +# act6: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' +# act7: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act8: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' +# act9: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --source --sisupod --manifest' #% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal default: diff --git a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_lng.yml b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_lng.yml index 364532df..62fb7624 100644 --- a/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_lng.yml +++ b/data/doc/sisu/markup-samples/manual/_sisu/rc/sisurc_by_lng.yml @@ -14,10 +14,9 @@ # public: '_sisu/image' # #all: 'image' #% presentation/web directory, main path and subdirectories (most subdirectories are created automatically based on markup directory name) -webserv: -# url_root: 'http://www.sisudoc.org' #url to document root, without dir stub - url_root: 'http://192.168.1.108' #url to document root, without dir stub - path: '/srv/www' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home +#webserv: +# url_root: 'http://www.your.url' #url to document root, without dir stub +# path: '/var/www' #either (i) / [full path from root] or (ii) ~/ [home] or (iii) ./ [pwd] or (iv) will be made from home # images: '_sisu/image' # man: 'man' # cgi: '/usr/local/lib/sisu-cgi' @@ -50,12 +49,16 @@ show_output_on: 'filesystem_url' #% flag - set (non-default) processing flag shortcuts -1, -2 etc. (here adding colour and verbosity as default) flag: color: true # making colour default -c is toggle, and will now toggle colour off -# default: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' -# i: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' -# ii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' -# iii: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' -# iv: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --postresql --update --manifest' -# v: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act0: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' +# act1: '--digest --text --html --manifest' +# act2: '--digest --text --html --epub --pdf --manifest' +# act3: '--digest --qrcode --text --html --epub --concordance --pdf --manifest' +# act4: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --manifest' +# act5: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --sqlite --manifest' +# act6: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' +# act7: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' +# act8: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' +# act9: '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --source --sisupod --manifest' #% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal default: diff --git a/data/sisu/v5/v/version.yml b/data/sisu/v5/v/version.yml index c24ba869..7a1d9a77 100644 --- a/data/sisu/v5/v/version.yml +++ b/data/sisu/v5/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 5.5.5 -:date_stamp: 2014w30/2 -:date: "2014-07-29" +:version: 5.5.6 +:date_stamp: 2014w31/5 +:date: "2014-08-08" diff --git a/data/sisu/v6/v/version.yml b/data/sisu/v6/v/version.yml index 03c4a1ab..19a7f741 100644 --- a/data/sisu/v6/v/version.yml +++ b/data/sisu/v6/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 6.1.5 -:date_stamp: 2014w30/2 -:date: "2014-07-29" +:version: 6.2.0 +:date_stamp: 2014w31/5 +:date: "2014-08-08" diff --git a/lib/sisu/v5/air.rb b/lib/sisu/v5/air.rb index 12ec9ed6..aaa4340f 100644 --- a/lib/sisu/v5/air.rb +++ b/lib/sisu/v5/air.rb @@ -61,7 +61,7 @@ =end module SiSU_Air - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb class Source @@ao_array=[] @@fns=nil diff --git a/lib/sisu/v5/ao.rb b/lib/sisu/v5/ao.rb index ee99805d..d7b418f5 100644 --- a/lib/sisu/v5/ao.rb +++ b/lib/sisu/v5/ao.rb @@ -64,9 +64,9 @@ module SiSU_AO require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'ao_doc_objects' # ao.rb require_relative 'ao_syntax' # ao_syntax.rb diff --git a/lib/sisu/v5/ao_composite.rb b/lib/sisu/v5/ao_composite.rb index 0d5905bc..af194db7 100644 --- a/lib/sisu/v5/ao_composite.rb +++ b/lib/sisu/v5/ao_composite.rb @@ -62,7 +62,7 @@ =end module SiSU_Assemble - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb class RemoteImage def initialize @env=SiSU_Env::InfoEnv.new diff --git a/lib/sisu/v5/cgi.rb b/lib/sisu/v5/cgi.rb index cd0175b5..efea863c 100644 --- a/lib/sisu/v5/cgi.rb +++ b/lib/sisu/v5/cgi.rb @@ -62,7 +62,7 @@ =end module SiSU_CGI #% database building documents - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb require_relative 'cgi_pgsql' # cgi_pgsql.rb require_relative 'cgi_sqlite' # cgi_sqlite.rb class SearchSQL diff --git a/lib/sisu/v5/cgi_pgsql.rb b/lib/sisu/v5/cgi_pgsql.rb index a65b8a97..633e20fc 100644 --- a/lib/sisu/v5/cgi_pgsql.rb +++ b/lib/sisu/v5/cgi_pgsql.rb @@ -61,7 +61,7 @@ =end module SiSU_CGI_PgSQL #% database building documents - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb require_relative 'cgi_sql_common' # cgi_sql_common.rb include SiSU_CGI_SQL class SearchPgSQL < CGI_Common diff --git a/lib/sisu/v5/cgi_sqlite.rb b/lib/sisu/v5/cgi_sqlite.rb index fc665074..531071c4 100644 --- a/lib/sisu/v5/cgi_sqlite.rb +++ b/lib/sisu/v5/cgi_sqlite.rb @@ -61,7 +61,7 @@ =end module SiSU_CGI_SQLite #% database building documents - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb require_relative 'cgi_sql_common' # cgi_sql_common.rb include SiSU_CGI_SQL class SearchSQLite < CGI_Common diff --git a/lib/sisu/v5/conf.rb b/lib/sisu/v5/conf.rb index 04ac5cfa..820d0941 100644 --- a/lib/sisu/v5/conf.rb +++ b/lib/sisu/v5/conf.rb @@ -61,7 +61,7 @@ =end module SiSU_Initialize - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Screen require_relative 'relaxng' # relaxng.rb @@ -82,7 +82,7 @@ module SiSU_Initialize end end class ConfigSite #config files such as css are not updated if they already exist unless forced using the --init=site modifier - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb def initialize(opt) @opt=opt @env=SiSU_Env::InfoEnv.new(@opt.fns) diff --git a/lib/sisu/v5/css.rb b/lib/sisu/v5/css.rb index d9b2aa8c..b99359aa 100644 --- a/lib/sisu/v5/css.rb +++ b/lib/sisu/v5/css.rb @@ -61,7 +61,7 @@ =end module SiSU_Style - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb require_relative 'defaults' # defaults.rb class CSS_HeadInfo def initialize(md,ft='html') diff --git a/lib/sisu/v5/db_columns.rb b/lib/sisu/v5/db_columns.rb index 04be289d..189e8acb 100644 --- a/lib/sisu/v5/db_columns.rb +++ b/lib/sisu/v5/db_columns.rb @@ -62,7 +62,7 @@ =end module SiSU_DbColumns - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb require_relative 'db_sqltxt' # db_sqltxt.rb class Columns < SiSU_DbText::Prepare def initialize(md=nil) diff --git a/lib/sisu/v5/db_create.rb b/lib/sisu/v5/db_create.rb index 142318f5..35b15ada 100644 --- a/lib/sisu/v5/db_create.rb +++ b/lib/sisu/v5/db_create.rb @@ -64,7 +64,7 @@ module SiSU_DbCreate require_relative 'db_columns' # db_columns.rb class Create < SiSU_DbColumns::Columns - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb @@dl=nil def initialize(opt,conn,file,sql_type=:pg) @opt,@conn,@file,@sql_type=opt,conn,file,sql_type diff --git a/lib/sisu/v5/db_drop.rb b/lib/sisu/v5/db_drop.rb index ba7b57cd..2106fe8f 100644 --- a/lib/sisu/v5/db_drop.rb +++ b/lib/sisu/v5/db_drop.rb @@ -63,7 +63,7 @@ =end module SiSU_DbDrop class Drop - require_relative 'response' # response.rb + require_relative 'utils_response' # utils_response.rb def initialize(opt,conn,db_info,sql_type) @opt,@conn,@db_info,@sql_type=opt,conn,db_info,sql_type @ans=SiSU_Response::Response.new diff --git a/lib/sisu/v5/db_load_tuple.rb b/lib/sisu/v5/db_load_tuple.rb index 750a47f0..98310bfd 100644 --- a/lib/sisu/v5/db_load_tuple.rb +++ b/lib/sisu/v5/db_load_tuple.rb @@ -64,7 +64,7 @@ module SiSU_DbTuple require_relative 'db_columns' # db_columns.rb class LoadDocuments - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param def initialize(conn,col,opt,file_maint) @conn,@col,@opt,@file_maint=conn,col,opt,file_maint diff --git a/lib/sisu/v5/dbi.rb b/lib/sisu/v5/dbi.rb index 83021b20..75b07372 100644 --- a/lib/sisu/v5/dbi.rb +++ b/lib/sisu/v5/dbi.rb @@ -61,9 +61,9 @@ =end module SiSU_DBI #% database building - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'db_dbi' # db_dbi.rb include SiSU_DbDBI diff --git a/lib/sisu/v5/dbi_discrete.rb b/lib/sisu/v5/dbi_discrete.rb index 9c4726c9..73976756 100644 --- a/lib/sisu/v5/dbi_discrete.rb +++ b/lib/sisu/v5/dbi_discrete.rb @@ -61,9 +61,9 @@ =end module SiSU_DBI_Discrete #% database building - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'db_dbi' # db_dbi.rb include SiSU_DbDBI diff --git a/lib/sisu/v5/defaults.rb b/lib/sisu/v5/defaults.rb index 25dd270a..c2f0f19c 100644 --- a/lib/sisu/v5/defaults.rb +++ b/lib/sisu/v5/defaults.rb @@ -67,7 +67,7 @@ module SiSU_Viz rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('uri NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'css' # css.rb include SiSU_Style diff --git a/lib/sisu/v5/digests.rb b/lib/sisu/v5/digests.rb index 662fa23d..83f26714 100644 --- a/lib/sisu/v5/digests.rb +++ b/lib/sisu/v5/digests.rb @@ -61,7 +61,7 @@ =end module SiSU_DigestView - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb require_relative 'prog_text_translation' # prog_text_translation.rb require_relative 'shared_markup_alt.rb' # shared_markup_alt.rb class Source diff --git a/lib/sisu/v5/param.rb b/lib/sisu/v5/dp.rb index 4621f460..0dde14b8 100644 --- a/lib/sisu/v5/param.rb +++ b/lib/sisu/v5/dp.rb @@ -51,13 +51,13 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/param.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/dp.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> <ralph.amissah@gmail.com> - ** Description: parameters extracted from input file(s) for program use + ** Description: document parameters extracted from input files for program use =end module SiSU_Param @@ -68,10 +68,10 @@ module SiSU_Param SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). error('uri or pstore NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param_make' # param_make.rb - require_relative 'param_identify_markup' # param_identify_markup.rb + require_relative 'dp_make' # dp_make.rb + require_relative 'dp_identify_markup' # dp_identify_markup.rb @@date=SiSU_Env::InfoDate.new @@proc= @@filename_txt= @@ -926,563 +926,566 @@ module SiSU_Param end #protected def extract - @user,@home,@hostname,@pwd=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD'] - @programs,@wc,@language,@language_original={},{},{},{} - @en={ sum: 0, mark: 0, note: 0, mismatch: 0 } - @prog=SiSU_Env::InfoSettings.new - @sys=SiSU_Env::SystemCall.new - @env=SiSU_Env::InfoEnv.new(@fns) #watch - if (@opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - puts 'system locale: ' + @sys.locale - end - if @prog.wc \ - and @sys.wc - wc=%x{wc #{fns}} - wca=wc.scan(/\d+/) - @wc_lines,@wc_words,@wc_bytes=wca[0].to_i,wca[1].to_i,wca[2].to_i - else - fns_a=@data.dup - tmp=fns_a.join - fns_a=tmp.scan(/\S+/) - @wc_words=fns_a.length - fns_a=tmp=nil - end - @concord_make=(@wc_words > @env.concord_max) ? false : true - @locale=@sys.locale - @file_encoding=@sys.file_encoding(fns,@opt.cmd) - # programs set here for things that affect output appearance only - @programs[:pdf]=SiSU_Env::SystemCall.new.program_found?('pdflatex') - if @opt.cmd =~/P/ #if @env.multilingual? - m=/((.+?)(?:\~\w\w(?:_\w\w)?)?)\.((?:-|ssm\.)?sst|ssm|ssi)$/ #watch added match for sss - @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3] - @flv=@env.document_language_versions_found[:f] - else - m=/((.+?)(?:\~\w\w(?:_\w\w)?)?)\.((?:-|ssm\.)?sst|ssm)$/ #watch added match for sss - @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3] - @flv=@env.document_language_versions_found[:f] - @fnz=(@fns =~/\.(?:ssm\.sst|ssm)$/) ? (@fnn + '.ssm.txz') : (@fnn + '.sst.txz') - end - @papersize=@env.papersize #'A4' #default size #get first from SiSU_Env:: # @env is probably no longer most appropriate name! as default info is more general - @sfx_src=@fns[m,2] - if @fns =~ /(?:-|ssm\.)?sst$/ \ - and not @opt.cmd =~/P/ #watch - @env_out_root=@env.path.output - @dir_out="#{@env.path.output}/#{@fnb}" - @dir_tex=@env.processing_path.tex - @dir_lout=@env.processing_path.lout - @@publisher='SiSU http://www.jus.uio.no/sisu' - end - @txt_path=@txt_path ||= @env.path.output - @stmp=%{#{@fns}}[/^(.+?)\..*/m,1] - @fnstex=@fns.gsub(/_/,'\_\-').gsub(/\./,'.\-') - @flag_endnotes,@flag_auto_endnotes,@flag_separate_endnotes=false,false,false - @flag_separate_endnotes_make=true - ver=SiSU_Env::InfoVersion.instance - @sisu_version=ver.get_version - @ruby_version=ver.rbversion - @generated=Time.now - fns_array=@data.dup - skip unless fns_array # consider - @code_flag=false - fns_array.each do |para| #% scan document - if para !~/^%+\s/ \ - and para =~/<![abcdeghijklmnopqrstuvwxyz]/i # <!f not included - raise "Old markup style in file #{@fns}, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n" + begin + @user,@home,@hostname,@pwd=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD'] + @programs,@wc,@language,@language_original={},{},{},{} + @en={ sum: 0, mark: 0, note: 0, mismatch: 0 } + @prog=SiSU_Env::InfoSettings.new + @sys=SiSU_Env::SystemCall.new + @env=SiSU_Env::InfoEnv.new(@fns) #watch + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + puts 'system locale: ' + @sys.locale end - @code_flag=case para - when /^code\{\s*$/ then true - when /^\}code\s*$/ then false - else @code_flag + if @prog.wc \ + and @sys.wc + wc=%x{wc #{fns}} + wca=wc.scan(/\d+/) + @wc_lines,@wc_words,@wc_bytes=wca[0].to_i,wca[1].to_i,wca[2].to_i + else + fns_a=@data.dup + tmp=fns_a.join + fns_a=tmp.scan(/\S+/) + @wc_words=fns_a.length + fns_a=tmp=nil end - regx_header=/^@\S+?:[+-]?\s/ - if para =~regx_header \ - and not @code_flag #or para=~/^(?:1|:?A)~/ - case para - when /^@title:(.+)/m #% * header metadata - title - @title=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).title - when /^@creator:(.+)/m #% * header metadata - creator - @creator=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).creator - @authorship=@author=@creator.author - @authors=@creator.author_detail - when /^@date:(.+)/m #% * header metadata - date - @date=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).date - when /^@publisher:\s+(.+)/m #% * header metadata - publisher - @publisher=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).current_publisher - @current_publisher=@publisher - when /^@rights:(.+)/m #% * header metadata - rights - @rights=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).rights - when /^@classify:(.+)/m #% * header metadata - classify - @classify=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).classify - when /^@identifier:(.+)/m #% * header metadata - identifier - @identifier=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).identifier - when /^@original:(.+)/m #% * header metadata - original (document) - @original=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).original - @source=@original.source - when /^@notes?:\s(.+)\Z/m #% * header metadata - notes - @notes=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).notes - when /^@links:\s+(.+?)\Z/m #% * header metadata - links - links=SiSU_Param::Parameters::MdMake.new($1.strip,@opt,@env).make_links.links - @lnk=@links=if @header_make_links_append == :yes - (links) \ - ? (links + @links) - : @links - else - (links) \ - ? (links) - : @links - end - when /^@make:(.+)/m #% * header processing - make - @make=SiSU_Param::Parameters::MdMake.new($1.strip,@opt,@env).make - makes=SiSU_Param_Make::MakeHead.new(@make).make_instruct - @pagenew=(makes[:pagenew]) \ - ? (makes[:pagenew]) \ - : @pagenew - @pagebreak=(makes[:pagebreak]) \ - ? (makes[:pagebreak]) \ - : @pagebreak - @pageline=(makes[:pageline]) \ - ? (makes[:pageline]) \ - : @pageline - @toc=(makes[:toc]) ? (makes[:toc]) : @toc - @lv0=(makes[:lv0]) ? (makes[:lv0]) : @lv0 - @lv1=(makes[:lv1]) ? (makes[:lv1]) : @lv1 - @lv2=(makes[:lv2]) ? (makes[:lv2]) : @lv2 - @lv3=(makes[:lv3]) ? (makes[:lv3]) : @lv3 - @lv4=(makes[:lv4]) ? (makes[:lv4]) : @lv4 - @lv5=(makes[:lv5]) ? (makes[:lv5]) : @lv5 - @lv6=(makes[:lv6]) ? (makes[:lv6]) : @lv6 - @num_top= - (makes[:num_top]) \ - ? (makes[:num_top]) \ - : @num_top - @substitution_match_list= - (makes[:substitution_match_list]) \ - ? (makes[:substitution_match_list]) \ - : @substitution_match_list - @bold_match_list= - (makes[:bold_match_list]) \ - ? (makes[:bold_match_list]) \ - : @bold_match_list - @italics_match_list= - (makes[:italics_match_list]) \ - ? (makes[:italics_match_list]) \ - : @italics_match_list - @emphasis_set_to= - (makes[:emphasis_set_to]) \ - ? (makes[:emphasis_set_to]) \ - : @emphasis_set_to - @i18n= - (makes[:i18n]) \ - ? (makes[:i18n]) \ - : @i18n - @man_section= - (makes[:man_section]) \ - ? (makes[:man_section]) \ - : @man_section - @footer_links= - (makes[:footer_links]) \ - ? (makes[:footer_links]) \ - : @footer_links - @home_button_links= - (makes[:home_button_links]) \ - ? (makes[:home_button_links]) \ - : @home_button_links - @home_button_image= - (makes[:home_button_image]) \ - ? (makes[:home_button_image]) \ - : @home_button_image - @cover_image= - (makes[:cover_image]) \ - ? (makes[:cover_image]) \ - : @cover_image + @concord_make=(@wc_words > @env.concord_max) ? false : true + @locale=@sys.locale + @file_encoding=@sys.file_encoding(fns,@opt.cmd) + # programs set here for things that affect output appearance only + @programs[:pdf]=SiSU_Env::SystemCall.new.program_found?('pdflatex') + if @opt.cmd =~/P/ #if @env.multilingual? + m=/((.+?)(?:\~\w\w(?:_\w\w)?)?)\.((?:-|ssm\.)?sst|ssm|ssi)$/ #watch added match for sss + @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3] + @flv=@env.document_language_versions_found[:f] + else + m=/((.+?)(?:\~\w\w(?:_\w\w)?)?)\.((?:-|ssm\.)?sst|ssm)$/ #watch added match for sss + @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3] + @flv=@env.document_language_versions_found[:f] + @fnz=(@fns =~/\.(?:ssm\.sst|ssm)$/) ? (@fnn + '.ssm.txz') : (@fnn + '.sst.txz') + end + @papersize=@env.papersize #'A4' #default size #get first from SiSU_Env:: # @env is probably no longer most appropriate name! as default info is more general + @sfx_src=@fns[m,2] + if @fns =~ /(?:-|ssm\.)?sst$/ \ + and not @opt.cmd =~/P/ #watch + @env_out_root=@env.path.output + @dir_out="#{@env.path.output}/#{@fnb}" + @dir_tex=@env.processing_path.tex + @dir_lout=@env.processing_path.lout + @@publisher='SiSU http://www.jus.uio.no/sisu' + end + @txt_path=@txt_path ||= @env.path.output + @stmp=%{#{@fns}}[/^(.+?)\..*/m,1] + @fnstex=@fns.gsub(/_/,'\_\-').gsub(/\./,'.\-') + @flag_endnotes,@flag_auto_endnotes,@flag_separate_endnotes=false,false,false + @flag_separate_endnotes_make=true + ver=SiSU_Env::InfoVersion.instance + @sisu_version=ver.get_version + @ruby_version=ver.rbversion + @generated=Time.now + fns_array=@data.dup + skip unless fns_array # consider + @code_flag=false + fns_array.each do |para| #% scan document + if para !~/^%+\s/ \ + and para =~/<![abcdeghijklmnopqrstuvwxyz]/i # <!f not included + raise "Old markup style in file #{@fns}, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n" + end + @code_flag=case para + when /^code\{\s*$/ then true + when /^\}code\s*$/ then false + else @code_flag end - @lv0 ||=/^0~/ - @lv1 ||=/^1~/ - @lv2 ||=/^2~/ - @lv3 ||=/^3~/ - @lv4 ||=/^4~/ - @lv5 ||=/^5~/ - @lv6 ||=/^6~/ - else #% * - l_0=l_1=l_2=l_3=l_4=l_5='' - if defined? @make.headings[0] - l_0=if defined? @make.headings[0][0] \ - and @make.headings[0][0] =~/\S+/ - "|^#{@make.headings[0][0]}" + regx_header=/^@\S+?:[+-]?\s/ + if para =~regx_header \ + and not @code_flag #or para=~/^(?:1|:?A)~/ + case para + when /^@title:(.+)/m #% * header metadata - title + @title=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).title + when /^@creator:(.+)/m #% * header metadata - creator + @creator=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).creator + @authorship=@author=@creator.author + @authors=@creator.author_detail + when /^@date:(.+)/m #% * header metadata - date + @date=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).date + when /^@publisher:\s+(.+)/m #% * header metadata - publisher + @publisher=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).current_publisher + @current_publisher=@publisher + when /^@rights:(.+)/m #% * header metadata - rights + @rights=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).rights + when /^@classify:(.+)/m #% * header metadata - classify + @classify=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).classify + when /^@identifier:(.+)/m #% * header metadata - identifier + @identifier=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).identifier + when /^@original:(.+)/m #% * header metadata - original (document) + @original=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).original + @source=@original.source + when /^@notes?:\s(.+)\Z/m #% * header metadata - notes + @notes=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).notes + when /^@links:\s+(.+?)\Z/m #% * header metadata - links + links=SiSU_Param::Parameters::MdMake.new($1.strip,@opt,@env).make_links.links + @lnk=@links=if @header_make_links_append == :yes + (links) \ + ? (links + @links) + : @links + else + (links) \ + ? (links) + : @links + end + when /^@make:(.+)/m #% * header processing - make + @make=SiSU_Param::Parameters::MdMake.new($1.strip,@opt,@env).make + makes=SiSU_Param_Make::MakeHead.new(@make).make_instruct + @pagenew=(makes[:pagenew]) \ + ? (makes[:pagenew]) \ + : @pagenew + @pagebreak=(makes[:pagebreak]) \ + ? (makes[:pagebreak]) \ + : @pagebreak + @pageline=(makes[:pageline]) \ + ? (makes[:pageline]) \ + : @pageline + @toc=(makes[:toc]) ? (makes[:toc]) : @toc + @lv0=(makes[:lv0]) ? (makes[:lv0]) : @lv0 + @lv1=(makes[:lv1]) ? (makes[:lv1]) : @lv1 + @lv2=(makes[:lv2]) ? (makes[:lv2]) : @lv2 + @lv3=(makes[:lv3]) ? (makes[:lv3]) : @lv3 + @lv4=(makes[:lv4]) ? (makes[:lv4]) : @lv4 + @lv5=(makes[:lv5]) ? (makes[:lv5]) : @lv5 + @lv6=(makes[:lv6]) ? (makes[:lv6]) : @lv6 + @num_top= + (makes[:num_top]) \ + ? (makes[:num_top]) \ + : @num_top + @substitution_match_list= + (makes[:substitution_match_list]) \ + ? (makes[:substitution_match_list]) \ + : @substitution_match_list + @bold_match_list= + (makes[:bold_match_list]) \ + ? (makes[:bold_match_list]) \ + : @bold_match_list + @italics_match_list= + (makes[:italics_match_list]) \ + ? (makes[:italics_match_list]) \ + : @italics_match_list + @emphasis_set_to= + (makes[:emphasis_set_to]) \ + ? (makes[:emphasis_set_to]) \ + : @emphasis_set_to + @i18n= + (makes[:i18n]) \ + ? (makes[:i18n]) \ + : @i18n + @man_section= + (makes[:man_section]) \ + ? (makes[:man_section]) \ + : @man_section + @footer_links= + (makes[:footer_links]) \ + ? (makes[:footer_links]) \ + : @footer_links + @home_button_links= + (makes[:home_button_links]) \ + ? (makes[:home_button_links]) \ + : @home_button_links + @home_button_image= + (makes[:home_button_image]) \ + ? (makes[:home_button_image]) \ + : @home_button_image + @cover_image= + (makes[:cover_image]) \ + ? (makes[:cover_image]) \ + : @cover_image end - l_1=if defined? @make.headings[0][1] \ - and @make.headings[0][1] =~/\S+/ - "|^#{@make.headings[0][1]}" + @lv0 ||=/^0~/ + @lv1 ||=/^1~/ + @lv2 ||=/^2~/ + @lv3 ||=/^3~/ + @lv4 ||=/^4~/ + @lv5 ||=/^5~/ + @lv6 ||=/^6~/ + else #% * + l_0=l_1=l_2=l_3=l_4=l_5='' + if defined? @make.headings[0] + l_0=if defined? @make.headings[0][0] \ + and @make.headings[0][0] =~/\S+/ + "|^#{@make.headings[0][0]}" + end + l_1=if defined? @make.headings[0][1] \ + and @make.headings[0][1] =~/\S+/ + "|^#{@make.headings[0][1]}" + end + l_2=if defined? @make.headings[0][2] \ + and @make.headings[0][2] =~/\S+/ + "|^#{@make.headings[0][2]}" + end + l_3=if defined? @make.headings[0][3] \ + and @make.headings[0][3] =~/\S+/ + "|^#{@make.headings[0][3]}" + end + l_4=if defined? @make.headings[0][4] \ + and @make.headings[0][4] =~/\S+/ + "|^#{@make.headings[0][4]}" + end + l_5=if defined? @make.headings[0][5] \ + and @make.headings[0][5] =~/\S+/ + "|^#{@make.headings[0][5]}" + end end - l_2=if defined? @make.headings[0][2] \ - and @make.headings[0][2] =~/\S+/ - "|^#{@make.headings[0][2]}" + case para + #when /^:?A~/ + when /^:?B~#{l_0}/ + @lvs[1]=1 + when /^:?C~#{l_1}/ + @lvs[2]=1 + when /^:?D~#{l_2}/ + @lvs[3]=1 + when /^1~#{l_3}/ + @lvs[4]=1 + when /^2~#{l_4}/ + @lvs[5]=1 + when /^3~#{l_5}/ + @lvs[6]=1 end - l_3=if defined? @make.headings[0][3] \ - and @make.headings[0][3] =~/\S+/ - "|^#{@make.headings[0][3]}" + if para =~ /^:?A~/ #% processing + if not defined? @title.full.nil? + tf=para[/^:A~\S*(.+)$/m,1] + tf="@title: #{tf}" + @title=SiSU_Param::Parameters::Md.new(tf.strip,@opt,@env).title + end + creator=(@creator.is_a?(SiSU_Param::Parameters::Md) \ + && defined? @creator.author \ + && @creator.author.is_a?(String)) \ + ? " #{@creator.author}" + : '' + title=@title.full.gsub(/\s*(?:<p>|<p \/>|<br>|<br \/>)\s*/,' '). + gsub(/~\{.+?\}~/,'') + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'Document Parameters', + %{#{title}#{creator}} + ).txt_grey if @opt.act[:verbose][:set]==:on end - l_4=if defined? @make.headings[0][4] \ - and @make.headings[0][4] =~/\S+/ - "|^#{@make.headings[0][4]}" + if not @book_idx \ + and para =~/^=\{(.+?)\}[\s`]*\Z/m + @book_idx=true end - l_5=if defined? @make.headings[0][5] \ - and @make.headings[0][5] =~/\S+/ - "|^#{@make.headings[0][5]}" + unless @code_flag + case para + when /~\{\s+.+?\}~/m #% processing + en=para.scan(/~\{.+?\}~/m) + en.each { |e| @en[:sum] +=1 } + when /~\^(?:\s|$)/m #% processing + mk=para.scan(/~\^(?:\s|$)/) + mk.each { |e| @en[:mark] +=1 } + when /^\^~\s+\S/ then @en[:note] +=1 #% processing + end end - end - case para - #when /^:?A~/ - when /^:?B~#{l_0}/ - @lvs[1]=1 - when /^:?C~#{l_1}/ - @lvs[2]=1 - when /^:?D~#{l_2}/ - @lvs[3]=1 - when /^1~#{l_3}/ - @lvs[4]=1 - when /^2~#{l_4}/ - @lvs[5]=1 - when /^3~#{l_5}/ - @lvs[6]=1 - end - if para =~ /^:?A~/ #% processing - if not defined? @title.full.nil? - tf=para[/^:A~\S*(.+)$/m,1] - tf="@title: #{tf}" - @title=SiSU_Param::Parameters::Md.new(tf.strip,@opt,@env).title + if para =~/~\{|\^~ |~\^|\{.+?\[[1-6]\]\}\S+?\.ss[tm]/m + @flag_auto_endnotes,@flag_endnotes=true,true end - creator=(@creator.is_a?(SiSU_Param::Parameters::Md) \ - && defined? @creator.author \ - && @creator.author.is_a?(String)) \ - ? " #{@creator.author}" - : '' - title=@title.full.gsub(/\s*(?:<p>|<p \/>|<br>|<br \/>)\s*/,' '). - gsub(/~\{.+?\}~/,'') - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - 'Parameters', - %{#{title}#{creator}} - ).txt_grey if @opt.act[:verbose][:set]==:on - end - if not @book_idx \ - and para =~/^=\{(.+?)\}[\s`]*\Z/m - @book_idx=true - end - unless @code_flag - case para - when /~\{\s+.+?\}~/m #% processing - en=para.scan(/~\{.+?\}~/m) - en.each { |e| @en[:sum] +=1 } - when /~\^(?:\s|$)/m #% processing - mk=para.scan(/~\^(?:\s|$)/) - mk.each { |e| @en[:mark] +=1 } - when /^\^~\s+\S/ then @en[:note] +=1 #% processing + if para =~/^(?:table\{|\{table)/i + @flag_tables=true end end - if para =~/~\{|\^~ |~\^|\{.+?\[[1-6]\]\}\S+?\.ss[tm]/m - @flag_auto_endnotes,@flag_endnotes=true,true + if para =~/^:?A~/ + @set_heading_top=true end - if para =~/^(?:table\{|\{table)/i - @flag_tables=true + if para =~/^1~/ + m=nil + if para =~/^1~(\S+)\s+(.+)$/ + m,t=$1,$2 + elsif para =~/^1~\s+(.+)$/ + t=$1 + end + unless @heading_seg_first_flag # extract first segment name + @heading_seg_first=t + @heading_seg_first_flag=true + end + if m # list all segment names + @seg_names << m + @set_heading_seg=true + if m=~/^\d{1,3}/ \ + and m !~/^0/ + @seg_autoname_safe=false + end + end end - end - if para =~/^:?A~/ - @set_heading_top=true - end - if para =~/^1~/ - m=nil - if para =~/^1~(\S+)\s+(.+)$/ - m,t=$1,$2 - elsif para =~/^1~\s+(.+)$/ - t=$1 + para=para.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) + if para !~/^%+\s/ \ + and para =~@rgx_image + @ec[:image] << para.scan(@rgx_image).uniq end - unless @heading_seg_first_flag # extract first segment name - @heading_seg_first=t - @heading_seg_first_flag=true + @ec[:audio] << para.scan(@rgx_audio).uniq if para =~@rgx_audio #embedded content + @ec[:multimedia] << para.scan(@rgx_mm).uniq if para =~@rgx_mm #embedded content + unless @sem_tag + @sem_tag=true if para=~/[:;]\{.+?\}[:;][a-z+]/ #refix later end - if m # list all segment names - @seg_names << m - @set_heading_seg=true - if m=~/^\d{1,3}/ \ - and m !~/^0/ - @seg_autoname_safe=false - end + end #% here endeth the document loop + unless @make + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + '@make:', + 'header absent' + ).warn end + @make=SiSU_Param::Parameters::MdMake.new('@make: ',@opt,@env).make end - para=para.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) - if para !~/^%+\s/ \ - and para =~@rgx_image - @ec[:image] << para.scan(@rgx_image).uniq + if @cover_image \ + and @cover_image.is_a?(Hash) \ + and (@cover_image[:cover] =~@rgx_image \ + or @cover_image[:cover] =~/\S+?.(?:jpg|png|gif)/) + @ec[:image] << @cover_image[:cover] end - @ec[:audio] << para.scan(@rgx_audio).uniq if para =~@rgx_audio #embedded content - @ec[:multimedia] << para.scan(@rgx_mm).uniq if para =~@rgx_mm #embedded content - unless @sem_tag - @sem_tag=true if para=~/[:;]\{.+?\}[:;][a-z+]/ #refix later + if @home_button_image \ + and @home_button_image.is_a?(Hash) \ + and (@home_button_image =~@rgx_image \ + or @home_button_image =~/\S+?\.(?:jpg|png|gif)/) + @ec[:image] << @home_button_image end - end #% here endeth the document loop - unless @make - if (@opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - '@make:', - 'header absent' - ).warn + if @ec[:image].length > 0 + @ec[:image]=@ec[:image].flatten.uniq + @ec[:image].delete_if {|x| x =~/https?:\/\// } + @ec[:image]=@ec[:image].sort end - @make=SiSU_Param::Parameters::MdMake.new('@make: ',@opt,@env).make - end - if @cover_image \ - and @cover_image.is_a?(Hash) \ - and (@cover_image[:cover] =~@rgx_image \ - or @cover_image[:cover] =~/\S+?.(?:jpg|png|gif)/) - @ec[:image] << @cover_image[:cover] - end - if @home_button_image \ - and @home_button_image.is_a?(Hash) \ - and (@home_button_image =~@rgx_image \ - or @home_button_image =~/\S+?\.(?:jpg|png|gif)/) - @ec[:image] << @home_button_image - end - if @ec[:image].length > 0 - @ec[:image]=@ec[:image].flatten.uniq - @ec[:image].delete_if {|x| x =~/https?:\/\// } - @ec[:image]=@ec[:image].sort - end - @ec[:audio]=@ec[:audio].uniq.flatten.sort - @ec[:multimedia]=@ec[:multimedia].uniq.flatten.sort - unless @rights - if defined? @creator.author \ - and @creator.author.is_a?(String) \ - and defined? @date.published \ - and @date.published.is_a?(String) - @rights=SiSU_Param::Parameters::MdDefault.new.rights(@creator.author,@date.published) - elsif defined? @creator.author \ - and @creator.author.is_a?(String) - @rights=SiSU_Param::Parameters::MdDefault.new.rights("[#{@creator.author}]",'') + @ec[:audio]=@ec[:audio].uniq.flatten.sort + @ec[:multimedia]=@ec[:multimedia].uniq.flatten.sort + unless @rights + if defined? @creator.author \ + and @creator.author.is_a?(String) \ + and defined? @date.published \ + and @date.published.is_a?(String) + @rights=SiSU_Param::Parameters::MdDefault.new.rights(@creator.author,@date.published) + elsif defined? @creator.author \ + and @creator.author.is_a?(String) + @rights=SiSU_Param::Parameters::MdDefault.new.rights("[#{@creator.author}]",'') + end end - end - if defined? @classify.topic_register \ - and @classify.topic_register.is_a?(String) \ - and @classify.topic_register.length >3 - topic_register=@classify.topic_register - u=topic_register.scan(/[^;]+/m).sort - v=[] - u.each do |l| - v << l.scan(/[^:]+/m) - end - v.each do |s| - s[-1]=s[-1].scan(/[^|]+/m) if s[-1] =~/[|]/m - @topic_register_array << s - end - @topic_register_array - end - if @i18n - @i18n=@i18n.uniq - @i18n << 'en' unless @i18n.find_index("en") - else - @i18n=[ 'en' ] - end - translated=[] - translate_list=[@pagenew,@pagebreak,@pageline,@num_top,@toc_lev_limit] - translate_list.each do |t| - translate=t.to_s if t - translated << if translate - translate.gsub!(/3/,'6') - translate.gsub!(/2/,'5') - translate.gsub!(/1/,'4') - translate.gsub!(/:?C/,'3') - translate.gsub!(/:?B/,'2') - translate.gsub!(/:?A/,'1') - # looks like an ok substituion for the above but is not, causes problems, check why - #translate=translate.gsub(/3/,'6'). - # gsub(/2/,'5'). - # gsub(/1/,'4'). - # gsub(/:?C/,'3'). - # gsub(/:?B/,'2'). - # gsub(/:?A/,'1') - translate=(translate =~/^\d+$/) \ - ? translate.to_i - : translate - else nil + if defined? @classify.topic_register \ + and @classify.topic_register.is_a?(String) \ + and @classify.topic_register.length >3 + topic_register=@classify.topic_register + u=topic_register.scan(/[^;]+/m).sort + v=[] + u.each do |l| + v << l.scan(/[^:]+/m) + end + v.each do |s| + s[-1]=s[-1].scan(/[^|]+/m) if s[-1] =~/[|]/m + @topic_register_array << s + end + @topic_register_array end - end - @pagenew,@pagebreak,@pageline,@num_top,@toc_lev_limit=translated - @markup=@markup.gsub(/page_new\s*=\s*([\dA-C])/,"page_new=#{@pagenew}"). - gsub(/page_break\s*=\s*([\dA-C])/,"page_break=#{@pagebreak}"). - gsub(/page_line\s*=\s*([\dA-C])/,"page_line=#{@pageline}"). - gsub(/num_top\s*=\s*([\dA-C])/,"num_top=#{@num_top}"). - gsub(/toc_lev_limit\s*=\s*([\dA-C])/,"toc_lev_limit=#{@toc_lev_limit}") - papersize_array_rc=@papersize.downcase.scan(/(?:a4|letter|legal|book|a5|b5)/) - papersize_array_opt=[ - ((@opt.act[:pdf_a4][:set]==:on) ? 'a4' : ''), - ((@opt.act[:pdf_a5][:set]==:on) ? 'a5' : ''), - ((@opt.act[:pdf_b5][:set]==:on) ? 'b5' : ''), - ((@opt.act[:pdf_letter][:set]==:on) ? 'letter' : ''), - ((@opt.act[:pdf_legal][:set]==:on) ? 'legal' : ''), - ] - [""] - @papersize_array=(papersize_array_opt.length > 0) \ - ? papersize_array_opt - : papersize_array_rc - fn=@opt.fno #decide what to do a filesize on .ssm tells very little about actual document size - @filesize=(File.size(fn)).to_s - if @sys.openssl !=false \ - and FileTest.file?(@env.source_file_with_path) - @dgst=[] - case @env.digest(@opt).type - when :sha512 - dgst=@sys.sha512(@env.source_file_with_path) - @dgst=dgst[1].length==128 ? dgst : nil - puts 'check document (sha512) digest' if not @dgst - when :sha256 - dgst=@sys.sha256(@env.source_file_with_path) - @dgst=dgst[1].length==64 ? dgst : nil - puts 'check document (sha256) digest' if not @dgst - when :md5 - dgst=@sys.md5(@env.source_file_with_path) - @dgst=dgst[1].length==32 ? dgst : nil - puts 'check document (md5) digest' if not @dgst + if @i18n + @i18n=@i18n.uniq + @i18n << 'en' unless @i18n.find_index("en") else - dgst=@sys.sha256(@env.source_file_with_path) - @dgst=dgst[1].length==64 ? dgst : nil - puts 'check document (sha256) digest' if not @dgst + @i18n=[ 'en' ] end - elsif not FileTest.file?(@env.source_file_with_path) - #puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) - end - @publisher ||= "#{@@publisher} (this copy)" - fn_set_lang=SiSU_Env::StandardiseLanguage.new(@opt.lng).language - unless @language[:code] \ - and @language[:name] - lang=@env.i18n.language #default language settings for directory by name, or in sysrc.yml - @language[:code] ||= lang.code - @language[:name] ||= lang.title - end - unless fn_set_lang[:d]==true #decide, naming convention overrides other settings, within document, etc. - @language[:code]=fn_set_lang[:c] - @language[:name]=fn_set_lang[:n] - end - @fnl=@env.i18n.lang_filename(fn_set_lang[:c]) - @lang=@lang.uniq - @fn=SiSU_Env::EnvCall.new(@fns).lang(fn_set_lang[:c]) - if @en[:note] > 0 \ - and @en[:sum] > 0 - if @en[:sum] > 0 - else - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - '*WARN* both endnote styles used', - "~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}" - ).warn unless @opt.act[:quiet][:set]==:on + translated=[] + translate_list=[@pagenew,@pagebreak,@pageline,@num_top,@toc_lev_limit] + translate_list.each do |t| + translate=t.to_s if t + translated << if translate + translate.gsub!(/3/,'6') + translate.gsub!(/2/,'5') + translate.gsub!(/1/,'4') + translate.gsub!(/:?C/,'3') + translate.gsub!(/:?B/,'2') + translate.gsub!(/:?A/,'1') + # looks like an ok substituion for the above but is not, causes problems, check why + #translate=translate.gsub(/3/,'6'). + # gsub(/2/,'5'). + # gsub(/1/,'4'). + # gsub(/:?C/,'3'). + # gsub(/:?B/,'2'). + # gsub(/:?A/,'1') + translate=(translate =~/^\d+$/) \ + ? translate.to_i + : translate + else nil + end end - end - if @en[:mark] != @en[:note] \ - and @en[:note] > 0 - @en[:mismatch]=@en[:note] - @en[:mark] - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - '*WARN* endnote number mismatch', - "endnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})" - ).warn unless @opt.act[:quiet][:set]==:on - footnote_conversion_errors=File.new("#{Dir.pwd}/footnote_conversion_errors.txt",'a') - footnote_conversion_errors << - "#{@fns}:\n\tendnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})\n" - end - if not @title \ - or not defined? @title.main \ - or @title.main !~/[\S]/ - if @fns =~/\.ssm$/ \ - and @opt.inspect =~/P/ - #@title=Md.new('Text Insert',@opt,@env).title - else - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - 'WARNING: Document Title missing', - 'please provide @title:' - ).warn unless @opt.act[:quiet][:set]==:on + @pagenew,@pagebreak,@pageline,@num_top,@toc_lev_limit=translated + @markup=@markup.gsub(/page_new\s*=\s*([\dA-C])/,"page_new=#{@pagenew}"). + gsub(/page_break\s*=\s*([\dA-C])/,"page_break=#{@pagebreak}"). + gsub(/page_line\s*=\s*([\dA-C])/,"page_line=#{@pageline}"). + gsub(/num_top\s*=\s*([\dA-C])/,"num_top=#{@num_top}"). + gsub(/toc_lev_limit\s*=\s*([\dA-C])/,"toc_lev_limit=#{@toc_lev_limit}") + papersize_array_rc=@papersize.downcase.scan(/(?:a4|letter|legal|book|a5|b5)/) + papersize_array_opt=[ + ((@opt.act[:pdf_a4][:set]==:on) ? 'a4' : ''), + ((@opt.act[:pdf_a5][:set]==:on) ? 'a5' : ''), + ((@opt.act[:pdf_b5][:set]==:on) ? 'b5' : ''), + ((@opt.act[:pdf_letter][:set]==:on) ? 'letter' : ''), + ((@opt.act[:pdf_legal][:set]==:on) ? 'legal' : ''), + ] - [""] + @papersize_array=(papersize_array_opt.length > 0) \ + ? papersize_array_opt + : papersize_array_rc + fn=@opt.fno #decide what to do a filesize on .ssm tells very little about actual document size + @filesize=(File.size(fn)).to_s + if @sys.openssl !=false \ + and FileTest.file?(@env.source_file_with_path) + @dgst=[] + case @env.digest(@opt).type + when :sha512 + dgst=@sys.sha512(@env.source_file_with_path) + @dgst=dgst[1].length==128 ? dgst : nil + puts 'check document (sha512) digest' if not @dgst + when :sha256 + dgst=@sys.sha256(@env.source_file_with_path) + @dgst=dgst[1].length==64 ? dgst : nil + puts 'check document (sha256) digest' if not @dgst + when :md5 + dgst=@sys.md5(@env.source_file_with_path) + @dgst=dgst[1].length==32 ? dgst : nil + puts 'check document (md5) digest' if not @dgst + else + dgst=@sys.sha256(@env.source_file_with_path) + @dgst=dgst[1].length==64 ? dgst : nil + puts 'check document (sha256) digest' if not @dgst + end + elsif not FileTest.file?(@env.source_file_with_path) + #puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) end - end - if @author !~/[\S]/ - if @fns =~/\.ssm$/ \ - and @opt.inspect =~/P/ - #@creator=SiSU_Param::Md.new('Text Insert',@opt,@env).creator - else + @publisher ||= "#{@@publisher} (this copy)" + fn_set_lang=SiSU_Env::StandardiseLanguage.new(@opt.lng).language + unless @language[:code] \ + and @language[:name] + lang=@env.i18n.language #default language settings for directory by name, or in sysrc.yml + @language[:code] ||= lang.code + @language[:name] ||= lang.title + end + unless fn_set_lang[:d]==true #decide, naming convention overrides other settings, within document, etc. + @language[:code]=fn_set_lang[:c] + @language[:name]=fn_set_lang[:n] + end + @fnl=@env.i18n.lang_filename(fn_set_lang[:c]) + @lang=@lang.uniq + @fn=SiSU_Env::EnvCall.new(@fns).lang(fn_set_lang[:c]) + if @en[:note] > 0 \ + and @en[:sum] > 0 + if @en[:sum] > 0 + else + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + '*WARN* both endnote styles used', + "~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}" + ).warn unless @opt.act[:quiet][:set]==:on + end + end + if @en[:mark] != @en[:note] \ + and @en[:note] > 0 + @en[:mismatch]=@en[:note] - @en[:mark] SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], - 'WARNING: Document Author missing', - 'please provide @creator: :author:' + '*WARN* endnote number mismatch', + "endnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})" ).warn unless @opt.act[:quiet][:set]==:on + footnote_conversion_errors=File.new("#{Dir.pwd}/footnote_conversion_errors.txt",'a') + footnote_conversion_errors << + "#{@fns}:\n\tendnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})\n" end - end - @struct={} - doc_struct=Hash.new(0) - if @lv1.nil? - fns_array.each do |para| - if para =~/^(Part|Chapter|Section|Article)\b/i - case para - when /^(Part|PART)\b/ - @struct[:part]=doc_struct[:part] - doc_struct[:part]=doc_struct[:part] + 1 - when /^(Chapter|CHAPTER)\b/ - @struct[:chapter]=doc_struct[:chapter] - doc_struct[:chapter]=doc_struct[:chapter] + 1 - when /^(Section|SECTION)\b/ - @struct[:section]=doc_struct[:section] - doc_struct[:section]=doc_struct[:section] + 1 - when /^(Article|ARTICLE)\b/ - @struct[:article]=doc_struct[:article] - doc_struct[:article]=doc_struct[:article] + 1 - when /^(Clause|CLAUSE)\b/ - @struct[:clause]=doc_struct[:clause] - doc_struct[:clause]=doc_struct[:clause] + 1 - when /^\d\..*[^\.]$/ - @struct[:number]=doc_struct[:number] - doc_struct[:number]=doc_struct[:number] + 1 - end + if not @title \ + or not defined? @title.main \ + or @title.main !~/[\S]/ + if @fns =~/\.ssm$/ \ + and @opt.inspect =~/P/ + #@title=Md.new('Text Insert',@opt,@env).title + else + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'WARNING: Document Title missing', + 'please provide @title:' + ).warn unless @opt.act[:quiet][:set]==:on end end - if doc_struct[:article] > 2 #%~level 4 - @lv4=/^(?:Article|ARTICLE)\b/ - elsif doc_struct[:chapter] > 2 \ - and doc_struct[:article] \ - and doc_struct[:article] < 3 - @lv4=/^(?:Chapter|CHAPTER)\b/ - elsif doc_struct[:clause] > 2 - @lv4=/^(?:Clause|CLAUSE)\b/ - elsif doc_struct[:number] > 2 - @lv4="^\d\..*[^\.]$" - end - if doc_struct[:section] > 2 #%~level 3 - @lv3=/^(?:Section|SECTION)\b/ - end - if doc_struct[:chapter] > 2 \ - and doc_struct[:article] \ - and doc_struct[:article] > 2 - @lv2=/^(?:Chapter|CHAPTER)\b/ - end - if doc_struct[:part] > 2 \ - and @lv[2].nil? - @lv2=/^(?:Part|PART)\b/ + if @author !~/[\S]/ + if @fns =~/\.ssm$/ \ + and @opt.inspect =~/P/ + #@creator=SiSU_Param::Md.new('Text Insert',@opt,@env).creator + else + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'WARNING: Document Author missing', + 'please provide @creator: :author:' + ).warn unless @opt.act[:quiet][:set]==:on + end end - if doc_struct[:part] > 2 \ - and @lv[2].inspect !~/Part/ \ - and @lv[1].nil? - @lv1=/^(Part|PART)\b/ + @struct={} + doc_struct=Hash.new(0) + if @lv1.nil? + fns_array.each do |para| + if para =~/^(Part|Chapter|Section|Article)\b/i + case para + when /^(Part|PART)\b/ + @struct[:part]=doc_struct[:part] + doc_struct[:part]=doc_struct[:part] + 1 + when /^(Chapter|CHAPTER)\b/ + @struct[:chapter]=doc_struct[:chapter] + doc_struct[:chapter]=doc_struct[:chapter] + 1 + when /^(Section|SECTION)\b/ + @struct[:section]=doc_struct[:section] + doc_struct[:section]=doc_struct[:section] + 1 + when /^(Article|ARTICLE)\b/ + @struct[:article]=doc_struct[:article] + doc_struct[:article]=doc_struct[:article] + 1 + when /^(Clause|CLAUSE)\b/ + @struct[:clause]=doc_struct[:clause] + doc_struct[:clause]=doc_struct[:clause] + 1 + when /^\d\..*[^\.]$/ + @struct[:number]=doc_struct[:number] + doc_struct[:number]=doc_struct[:number] + 1 + end + end + end + if doc_struct[:article] > 2 #%~level 4 + @lv4=/^(?:Article|ARTICLE)\b/ + elsif doc_struct[:chapter] > 2 \ + and doc_struct[:article] \ + and doc_struct[:article] < 3 + @lv4=/^(?:Chapter|CHAPTER)\b/ + elsif doc_struct[:clause] > 2 + @lv4=/^(?:Clause|CLAUSE)\b/ + elsif doc_struct[:number] > 2 + @lv4="^\d\..*[^\.]$" + end + if doc_struct[:section] > 2 #%~level 3 + @lv3=/^(?:Section|SECTION)\b/ + end + if doc_struct[:chapter] > 2 \ + and doc_struct[:article] \ + and doc_struct[:article] > 2 + @lv2=/^(?:Chapter|CHAPTER)\b/ + end + if doc_struct[:part] > 2 \ + and @lv[2].nil? + @lv2=/^(?:Part|PART)\b/ + end + if doc_struct[:part] > 2 \ + and @lv[2].inspect !~/Part/ \ + and @lv[1].nil? + @lv1=/^(Part|PART)\b/ + end end + @lnk=@lnk.compact if @lnk + @lv0 ||=/^0~/ + @lv1 ||=/^1~/ + @lv2 ||=/^2~/ + @lv3 ||=/^3~/ + @lv4 ||=/^4~/ + @lv5 ||=/^5~/ + @lv6 ||=/^6~/ + @data=nil #else whole file's contents are stored in md pstore & is not required to be... big waste actually + @file=SiSU_Env::FileOp.new(self) #watch + Store.new(self,@env).store #% pstore + self + rescue end - @lnk=@lnk.compact if @lnk - @lv0 ||=/^0~/ - @lv1 ||=/^1~/ - @lv2 ||=/^2~/ - @lv3 ||=/^3~/ - @lv4 ||=/^4~/ - @lv5 ||=/^5~/ - @lv6 ||=/^6~/ - @data=nil #else whole file's contents are stored in md pstore & is not required to be... big waste actually - @file=SiSU_Env::FileOp.new(self) #watch - Store.new(self,@env).store #% pstore - self end private class Store diff --git a/lib/sisu/v5/param_identify_markup.rb b/lib/sisu/v5/dp_identify_markup.rb index f6884c7d..f6884c7d 100644 --- a/lib/sisu/v5/param_identify_markup.rb +++ b/lib/sisu/v5/dp_identify_markup.rb diff --git a/lib/sisu/v5/param_make.rb b/lib/sisu/v5/dp_make.rb index 578e4fb9..05b5cbdf 100644 --- a/lib/sisu/v5/param_make.rb +++ b/lib/sisu/v5/dp_make.rb @@ -57,7 +57,7 @@ <ralph@amissah.com> <ralph.amissah@gmail.com> - ** Description: make parameters extracted for program use + ** Description: document parameters make extracted for program use =end diff --git a/lib/sisu/v5/embedded.rb b/lib/sisu/v5/embedded.rb index c013806b..b46975fd 100644 --- a/lib/sisu/v5/embedded.rb +++ b/lib/sisu/v5/embedded.rb @@ -61,9 +61,9 @@ =end module SiSU_Embedded - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source def initialize(opt) diff --git a/lib/sisu/v5/errors.rb b/lib/sisu/v5/errors.rb index f4e05091..c3468043 100644 --- a/lib/sisu/v5/errors.rb +++ b/lib/sisu/v5/errors.rb @@ -61,7 +61,7 @@ =end module SiSU_Errors - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen class Rescued <CreateFile def initialize(error,errorlist,cmd,fns='') diff --git a/lib/sisu/v5/git.rb b/lib/sisu/v5/git.rb index e7d2fcc1..5d3ffb8e 100644 --- a/lib/sisu/v5/git.rb +++ b/lib/sisu/v5/git.rb @@ -61,8 +61,8 @@ =end module SiSU_Git - require_relative 'param' # param.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'dp' # dp.rb + require_relative 'se' # se.rb require_relative 'ao' # ao.rb class Source def initialize(opt) diff --git a/lib/sisu/v5/harvest.rb b/lib/sisu/v5/harvest.rb index 053df905..cc12b08e 100644 --- a/lib/sisu/v5/harvest.rb +++ b/lib/sisu/v5/harvest.rb @@ -65,10 +65,10 @@ module SiSU_Harvest @@the_idx_topics,@@the_idx_authors={},{} class Source - require_relative 'options' # options.rb + require_relative 'hub_options' # hub_options.rb require_relative 'harvest_topics' # harvest_topics.rb require_relative 'harvest_authors' # harvest_authors.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env def initialize(opt) @opt=opt diff --git a/lib/sisu/v5/author_format.rb b/lib/sisu/v5/harvest_author_format.rb index 3bda7904..42238924 100644 --- a/lib/sisu/v5/author_format.rb +++ b/lib/sisu/v5/harvest_author_format.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/author_format.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/harvest_author_format.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> diff --git a/lib/sisu/v5/harvest_authors.rb b/lib/sisu/v5/harvest_authors.rb index 361b9a8f..7904ab15 100644 --- a/lib/sisu/v5/harvest_authors.rb +++ b/lib/sisu/v5/harvest_authors.rb @@ -62,7 +62,7 @@ =end module SiSU_HarvestAuthors - require_relative 'author_format' # author_format.rb + require_relative 'harvest_author_format' # harvest_author_format.rb class Songsheet @@the_idx_authors={} def initialize(opt,env) diff --git a/lib/sisu/v5/harvest_topics.rb b/lib/sisu/v5/harvest_topics.rb index c68293b0..cd507f63 100644 --- a/lib/sisu/v5/harvest_topics.rb +++ b/lib/sisu/v5/harvest_topics.rb @@ -63,7 +63,7 @@ =end module SiSU_HarvestTopics - require_relative 'author_format' # author_format.rb + require_relative 'harvest_author_format' # harvest_author_format.rb include SiSU_Viz class Songsheet @@the_idx_topics={} diff --git a/lib/sisu/v5/html.rb b/lib/sisu/v5/html.rb index 526b41c6..a613f56f 100644 --- a/lib/sisu/v5/html.rb +++ b/lib/sisu/v5/html.rb @@ -66,7 +66,7 @@ module SiSU_HTML rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)') end - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'defaults' # defaults.rb include SiSU_Viz diff --git a/lib/sisu/v5/html_concordance.rb b/lib/sisu/v5/html_concordance.rb index 7bbb1a4c..dbaf83cf 100644 --- a/lib/sisu/v5/html_concordance.rb +++ b/lib/sisu/v5/html_concordance.rb @@ -62,9 +62,9 @@ =end module SiSU_Concordance - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'defaults' # defaults.rb include SiSU_Viz @@ -212,7 +212,7 @@ WOK include SiSU_Viz require_relative 'html_format' # html_format.rb include SiSU_HTML_Format - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Screen @@dp=nil def initialize(particulars) diff --git a/lib/sisu/v5/html_lite_shared.rb b/lib/sisu/v5/html_lite_shared.rb index 3ce59049..e9497698 100644 --- a/lib/sisu/v5/html_lite_shared.rb +++ b/lib/sisu/v5/html_lite_shared.rb @@ -66,7 +66,7 @@ module SiSU_FormatShared include SiSU_Viz class CSS_Format require_relative 'defaults' # defaults.rb - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb @@fns=nil def initialize(md,t_o) @md,@t_o=md,t_o diff --git a/lib/sisu/v5/html_promo.rb b/lib/sisu/v5/html_promo.rb index f10bdb51..87f9bb31 100644 --- a/lib/sisu/v5/html_promo.rb +++ b/lib/sisu/v5/html_promo.rb @@ -61,7 +61,7 @@ =end module SiSU_HTML_Promo - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Ad def initialize(md) diff --git a/lib/sisu/v5/html_tune.rb b/lib/sisu/v5/html_tune.rb index 39cbb708..1a2c9dee 100644 --- a/lib/sisu/v5/html_tune.rb +++ b/lib/sisu/v5/html_tune.rb @@ -60,9 +60,9 @@ ** Description: html generation, html pre-processing =end -require_relative 'param' +require_relative 'dp' # dp.rb module SiSU_HTML_Tune - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen require_relative 'html_format' # html_format.rb #watch @@line_mode='' diff --git a/lib/sisu/v5/hub.rb b/lib/sisu/v5/hub.rb index 510e2092..785da84d 100644 --- a/lib/sisu/v5/hub.rb +++ b/lib/sisu/v5/hub.rb @@ -63,11 +63,11 @@ =end module SiSU require_relative 'constants' # constants.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Screen - require_relative 'options' # options.rb - require_relative 'param' # param.rb + require_relative 'hub_options' # hub_options.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'defaults' # defaults.rb include SiSU_Viz @@ -599,10 +599,10 @@ module SiSU else end if @opt.act[:urls_selected][:set]==:on #% --sitemap, -Y - require_relative 'urls' - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Urls::Source.new(@opt).read #% -u -v -V -M - end + require_relative 'urls' + OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Urls::Source.new(@opt).read #% -u -v -V -M + end end end def do_initialization diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v5/hub_options.rb index b73dd87c..f851b985 100644 --- a/lib/sisu/v6/options.rb +++ b/lib/sisu/v5/hub_options.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/options.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/hub_options.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> @@ -67,8 +67,8 @@ module SiSU_Commandline rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pathname NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb - require_relative 'param_make' # param_make.rb + require_relative 'se' # se.rb + require_relative 'dp_make' # dp_make.rb class HeaderCommon def sisu_document_make_instructions(make_instruct_array=:nil) @pagenew= @@ -1394,6 +1394,6 @@ module SiSU_Commandline end end __END__ -note usually named @opt is carried in Param (usually as @md.opt), @opt is a +note usually named @opt is carried in dp document parameters (usually as @md.opt), @opt is a subset of @md where @md is passed, contents of @opt are available as @md.opt passing @opt as well is duplication check for fns & fnb diff --git a/lib/sisu/v5/manifest.rb b/lib/sisu/v5/manifest.rb index 1afe1deb..f2a9e748 100644 --- a/lib/sisu/v5/manifest.rb +++ b/lib/sisu/v5/manifest.rb @@ -61,15 +61,15 @@ =end module SiSU_Manifest - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'prog_text_translation' # prog_text_translation.rb - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'html_minitoc' # html_minitoc.rb require_relative 'html' # html.rb include SiSU_HTML_Format - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'i18n' # i18n.rb include SiSU_Viz diff --git a/lib/sisu/v5/manpage.rb b/lib/sisu/v5/manpage.rb index a59ba835..0bcf1799 100644 --- a/lib/sisu/v5/manpage.rb +++ b/lib/sisu/v5/manpage.rb @@ -63,7 +63,7 @@ =end module SiSU_Manpage require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Param include SiSU_Viz diff --git a/lib/sisu/v5/manpage_format.rb b/lib/sisu/v5/manpage_format.rb index 7a9ea98b..c46a3c7b 100644 --- a/lib/sisu/v5/manpage_format.rb +++ b/lib/sisu/v5/manpage_format.rb @@ -61,7 +61,7 @@ =end module SiSU_ManpageFormat - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class ParagraphNumber diff --git a/lib/sisu/v5/po4a.rb b/lib/sisu/v5/po4a.rb index 3b800e83..b5086eb7 100644 --- a/lib/sisu/v5/po4a.rb +++ b/lib/sisu/v5/po4a.rb @@ -63,7 +63,7 @@ =end module SiSU_Po4a require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'ao_composite' # ao_composite.rb require_relative 'shared_metadata' # shared_metadata.rb diff --git a/lib/sisu/v5/prog_text_translation.rb b/lib/sisu/v5/prog_text_translation.rb index 98319960..9a7db086 100644 --- a/lib/sisu/v5/prog_text_translation.rb +++ b/lib/sisu/v5/prog_text_translation.rb @@ -61,7 +61,7 @@ =end module SiSU_Translate - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Param class Source def initialize(md,doc_lang,trans_str='') diff --git a/lib/sisu/v5/qrcode.rb b/lib/sisu/v5/qrcode.rb index f6fd78bf..19d310c1 100644 --- a/lib/sisu/v5/qrcode.rb +++ b/lib/sisu/v5/qrcode.rb @@ -61,13 +61,13 @@ =end module SiSU_QRcode - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'prog_text_translation' # prog_text_translation.rb - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'html' # html.rb - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'i18n' # i18n.rb include SiSU_Viz diff --git a/lib/sisu/v5/relaxng.rb b/lib/sisu/v5/relaxng.rb index f6e86470..ebef4a31 100644 --- a/lib/sisu/v5/relaxng.rb +++ b/lib/sisu/v5/relaxng.rb @@ -61,7 +61,7 @@ =end module SiSU_Relaxng - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb class RelaxNG def gpl3_or_later @gpl3_or_later =<<RELAXNG diff --git a/lib/sisu/v5/remote.rb b/lib/sisu/v5/remote.rb index 672eff9e..1a1a9f0a 100644 --- a/lib/sisu/v5/remote.rb +++ b/lib/sisu/v5/remote.rb @@ -61,7 +61,7 @@ =end module SiSU_Remote - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Put def initialize(opt) diff --git a/lib/sisu/v5/rexml.rb b/lib/sisu/v5/rexml.rb index f7a2c968..c4512872 100644 --- a/lib/sisu/v5/rexml.rb +++ b/lib/sisu/v5/rexml.rb @@ -67,9 +67,9 @@ module SiSU_Rexml rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('rexml/document NOT FOUND (LoadError)') end - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Viz class Rexml diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/se.rb index 0d67733f..cefd45d5 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/se.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/sysenv.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/se.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> @@ -156,7 +156,7 @@ module SiSU_Env end end module SiSU_Screen - require_relative 'screen_text_color' # screen_text_color.rb + require_relative 'utils_screen_text_color' # utils_screen_text_color.rb end module SiSU_Errors require_relative 'errors' # errors.rb diff --git a/lib/sisu/v5/se_createsite.rb b/lib/sisu/v5/se_createsite.rb index 42d86aad..33e334ce 100644 --- a/lib/sisu/v5/se_createsite.rb +++ b/lib/sisu/v5/se_createsite.rb @@ -63,7 +63,7 @@ module SiSU_Create_Site require_relative 'constants' # constants.rb require_relative 'utils' # utils.rb - require_relative 'screen_text_color' # screen_text_color.rb + require_relative 'utils_screen_text_color' # utils_screen_text_color.rb require_relative 'se_info_env' # se_info_env.rb begin require 'fileutils' diff --git a/lib/sisu/v5/se_filemap.rb b/lib/sisu/v5/se_filemap.rb index 99de4a0c..0c4c84c0 100644 --- a/lib/sisu/v5/se_filemap.rb +++ b/lib/sisu/v5/se_filemap.rb @@ -145,7 +145,7 @@ module SiSU_File_Map ft << @md.fn[:xml_scaffold_structure_collapse] end @fnb=@md.fnb - else # still needed where/when param is not parsed + else # still needed where/when dp document param is not parsed if @opt.act[:html][:set]==:on #% --html, -h -H ft << '.html' << '.html.??' end diff --git a/lib/sisu/v5/particulars.rb b/lib/sisu/v5/se_hub_particulars.rb index 6efbc94c..4372ac72 100644 --- a/lib/sisu/v5/particulars.rb +++ b/lib/sisu/v5/se_hub_particulars.rb @@ -52,7 +52,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/particulars.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/se_hub_particulars.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> @@ -67,9 +67,9 @@ module SiSU_Particulars rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('singleton NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'ao' # ao.rb class CombinedSingleton diff --git a/lib/sisu/v5/shared_images.rb b/lib/sisu/v5/shared_images.rb index e307eba3..c1e9abdc 100644 --- a/lib/sisu/v5/shared_images.rb +++ b/lib/sisu/v5/shared_images.rb @@ -60,7 +60,7 @@ ** Description: common file for xml generation =end module SiSU_Images - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb class Source def initialize(opt) @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt) diff --git a/lib/sisu/v5/shared_sem.rb b/lib/sisu/v5/shared_sem.rb index 860457bb..6ddc3f45 100644 --- a/lib/sisu/v5/shared_sem.rb +++ b/lib/sisu/v5/shared_sem.rb @@ -62,7 +62,7 @@ =end module SiSU_Sem - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb class Tags def initialize(para,md) @para,@md=para,md diff --git a/lib/sisu/v5/sitemaps.rb b/lib/sisu/v5/sitemaps.rb index b76d2d60..2d157096 100644 --- a/lib/sisu/v5/sitemaps.rb +++ b/lib/sisu/v5/sitemaps.rb @@ -57,13 +57,13 @@ <ralph@amissah.com> <ralph.amissah@gmail.com> - ** Description: sitemap created from parameters extracted from input file(s) + ** Description: sitemap created from document parameters =end module SiSU_Sitemaps - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'xml_shared' # xml_shared.rb include SiSU_XML_Munge diff --git a/lib/sisu/v5/src_kdissert_share.rb b/lib/sisu/v5/src_kdissert_share.rb index abf2f2d1..e67d4249 100644 --- a/lib/sisu/v5/src_kdissert_share.rb +++ b/lib/sisu/v5/src_kdissert_share.rb @@ -61,7 +61,7 @@ =end module SiSU_KdiSource - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source begin diff --git a/lib/sisu/v5/src_share.rb b/lib/sisu/v5/src_share.rb index f78b922f..be789e00 100644 --- a/lib/sisu/v5/src_share.rb +++ b/lib/sisu/v5/src_share.rb @@ -63,7 +63,7 @@ module SiSU_Markup require_relative 'src_shared' # src_shared.rb include SiSU_Source - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source < SiSU_Source::SiSUpodSource def initialize(opt,build=nil,place=nil) diff --git a/lib/sisu/v5/src_shared.rb b/lib/sisu/v5/src_shared.rb index 068120f5..2f6f8305 100644 --- a/lib/sisu/v5/src_shared.rb +++ b/lib/sisu/v5/src_shared.rb @@ -63,8 +63,8 @@ module SiSU_Source include SiSU_Env class SiSUpodSource - require_relative 'sysenv' # sysenv.rb - require_relative 'particulars' # particulars.rb + require_relative 'se' # se.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb def initialize(opt,build=nil,place=nil) @opt=opt @date=SiSU_Env::InfoDate.new.dt diff --git a/lib/sisu/v5/src_sisupod_make.rb b/lib/sisu/v5/src_sisupod_make.rb index 5dd8f038..fa5b6560 100644 --- a/lib/sisu/v5/src_sisupod_make.rb +++ b/lib/sisu/v5/src_sisupod_make.rb @@ -63,10 +63,10 @@ module SiSU_Doc require_relative 'src_shared' # scr_shared.rb include SiSU_Source - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source < SiSU_Source::SiSUpodSource - require_relative 'response' # response.rb + require_relative 'utils_response' # utils_response.rb def initialize(opt,build=nil,place=nil) super(opt,build,place) @zipfile=@opt.fno.gsub(/(?:\~\S{2,3})?(\.ss[tm])$/,'\1') diff --git a/lib/sisu/v5/sst_convert_markup.rb b/lib/sisu/v5/sst_convert_markup.rb index cdceba7c..6002e2fc 100644 --- a/lib/sisu/v5/sst_convert_markup.rb +++ b/lib/sisu/v5/sst_convert_markup.rb @@ -65,7 +65,7 @@ module SiSU_Modify require_relative 'sst_identify_markup' # sst_identify_markup.rb require_relative 'sst_from_xml' # sst_from_xml.rb - require_relative 'response' # response.rb + require_relative 'utils_response' # utils_response.rb class ConvertMarkup def initialize(opt) @opt=opt @@ -311,7 +311,7 @@ WOK end end #%% files to match for this conversion set -------------------------> -require_relative 'options' # options.rb +require_relative 'hub_options' # hub_options.rb argv=$* base_path=Dir.pwd @opt=SiSU_Commandline::Options.new(argv,base_path) diff --git a/lib/sisu/v5/sst_do_inline_footnotes.rb b/lib/sisu/v5/sst_do_inline_footnotes.rb index ac4c63d5..c3340fbd 100644 --- a/lib/sisu/v5/sst_do_inline_footnotes.rb +++ b/lib/sisu/v5/sst_do_inline_footnotes.rb @@ -64,9 +64,9 @@ module SiSU_ConvertFootnotes require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'ao_syntax' # ao_syntax.rb include SiSU_AO_Syntax @@ -277,7 +277,7 @@ module SiSU_ConvertFootnotes data=@data tuned_file=[] data.each do |para| - if @md.markup =~/0\.16|0\.37/ #parameters not extracted/available + if @md.markup =~/0\.16|0\.37/ #parameters not extracted/available para.gsub!(/^0~\S+\s+/,'@\1: ') para.gsub!(/^1~/,':A~') para.gsub!(/^2~/,':B~') diff --git a/lib/sisu/v5/sst_from_xml.rb b/lib/sisu/v5/sst_from_xml.rb index 7ae4b446..b6fccd92 100644 --- a/lib/sisu/v5/sst_from_xml.rb +++ b/lib/sisu/v5/sst_from_xml.rb @@ -62,7 +62,7 @@ =end module SiSU_sstFromXML - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb class Convert begin require 'rexml/document' diff --git a/lib/sisu/v5/sst_to_s_xml_sax.rb b/lib/sisu/v5/sst_to_s_xml_sax.rb index acb3ac40..fe685983 100644 --- a/lib/sisu/v5/sst_to_s_xml_sax.rb +++ b/lib/sisu/v5/sst_to_s_xml_sax.rb @@ -61,13 +61,13 @@ =end module SiSU_SimpleXML_ModelSax - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'ao_doc_str' # ao_doc_str.rb require_relative 'xml_shared' # xml_shared.rb diff --git a/lib/sisu/v5/termsheet.rb b/lib/sisu/v5/termsheet.rb index 7e8a2a30..a3fe308d 100644 --- a/lib/sisu/v5/termsheet.rb +++ b/lib/sisu/v5/termsheet.rb @@ -62,8 +62,8 @@ sample files must be provided - (saved till later as may confuse) =end -require_relative 'sysenv' # sysenv.rb -require_relative 'param' # param.rb +require_relative 'se' # se.rb +require_relative 'dp' # dp.rb include SiSU_Param @do,@done,@used,@html_output,@txt_input,@txt_output,@@report=Array.new(7){[]} @@info=nil @@ -123,7 +123,7 @@ WOK @@report << @done << @used << "\n" @done,@used=[],[] end -require_relative 'param' # param.rb +require_relative 'dp' # dp.rb @argv=$* @proc="#{@argv[0].to_s}" if @proc =~ /^-?[wft]/ diff --git a/lib/sisu/v5/texinfo.rb b/lib/sisu/v5/texinfo.rb index 4c25c1ed..e792a989 100644 --- a/lib/sisu/v5/texinfo.rb +++ b/lib/sisu/v5/texinfo.rb @@ -62,7 +62,7 @@ =end module SiSU_TexInfo require_relative 'html' # html.rb - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz #include Stamp ... needed removed arbitrarily 2005w05/1 (warnings about undefined flags) diff --git a/lib/sisu/v5/texinfo_format.rb b/lib/sisu/v5/texinfo_format.rb index 4286f50b..5bc41442 100644 --- a/lib/sisu/v5/texinfo_format.rb +++ b/lib/sisu/v5/texinfo_format.rb @@ -62,7 +62,7 @@ =end module SiSU_TexInfoFormat @@table_pg_break_counter=1 - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class Texinfo diff --git a/lib/sisu/v5/texpdf.rb b/lib/sisu/v5/texpdf.rb index 8d6a01c5..b5d36602 100644 --- a/lib/sisu/v5/texpdf.rb +++ b/lib/sisu/v5/texpdf.rb @@ -68,7 +68,7 @@ module SiSU_TeX end require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'texpdf_format' # texpdf_format.rb include SiSU_TeX_Pdf @@ -87,7 +87,7 @@ module SiSU_TeX rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Viz require_relative 'ao' # ao.rb diff --git a/lib/sisu/v5/txt_asciidoc.rb b/lib/sisu/v5/txt_asciidoc.rb index 7ca3cc85..43e49f7b 100644 --- a/lib/sisu/v5/txt_asciidoc.rb +++ b/lib/sisu/v5/txt_asciidoc.rb @@ -62,7 +62,7 @@ =end module SiSU_Txt_AsciiDoc require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb diff --git a/lib/sisu/v5/txt_markdown.rb b/lib/sisu/v5/txt_markdown.rb index 69bedbc5..1e4326a3 100644 --- a/lib/sisu/v5/txt_markdown.rb +++ b/lib/sisu/v5/txt_markdown.rb @@ -62,7 +62,7 @@ =end module SiSU_Txt_Markdown require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb diff --git a/lib/sisu/v5/txt_plain.rb b/lib/sisu/v5/txt_plain.rb index 824d29c8..2f3cc134 100644 --- a/lib/sisu/v5/txt_plain.rb +++ b/lib/sisu/v5/txt_plain.rb @@ -63,7 +63,7 @@ =end module SiSU_Txt_Plain require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb diff --git a/lib/sisu/v5/txt_rst.rb b/lib/sisu/v5/txt_rst.rb index c3978b06..f00c9e9c 100644 --- a/lib/sisu/v5/txt_rst.rb +++ b/lib/sisu/v5/txt_rst.rb @@ -62,7 +62,7 @@ =end module SiSU_Txt_rST require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb diff --git a/lib/sisu/v5/txt_textile.rb b/lib/sisu/v5/txt_textile.rb index f5962b80..65c102fc 100644 --- a/lib/sisu/v5/txt_textile.rb +++ b/lib/sisu/v5/txt_textile.rb @@ -62,7 +62,7 @@ =end module SiSU_Txt_Textile require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb diff --git a/lib/sisu/v5/update.rb b/lib/sisu/v5/update.rb index a4b6b2b3..2301990a 100644 --- a/lib/sisu/v5/update.rb +++ b/lib/sisu/v5/update.rb @@ -61,7 +61,7 @@ =end module SiSU_UpdateControlFlag - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Param class Check diff --git a/lib/sisu/v5/urls.rb b/lib/sisu/v5/urls.rb index cef51ab5..815fe65a 100644 --- a/lib/sisu/v5/urls.rb +++ b/lib/sisu/v5/urls.rb @@ -61,9 +61,9 @@ =end module SiSU_Urls - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen class Source attr_reader :opt diff --git a/lib/sisu/v6/response.rb b/lib/sisu/v5/utils_response.rb index a67602f6..88209b2c 100644 --- a/lib/sisu/v6/response.rb +++ b/lib/sisu/v5/utils_response.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/response.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/utils_response.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> diff --git a/lib/sisu/v5/screen_text_color.rb b/lib/sisu/v5/utils_screen_text_color.rb index 42b0c698..42b0c698 100644 --- a/lib/sisu/v5/screen_text_color.rb +++ b/lib/sisu/v5/utils_screen_text_color.rb diff --git a/lib/sisu/v5/spell.rb b/lib/sisu/v5/utils_spell.rb index 69b6da7e..886f6f7f 100644 --- a/lib/sisu/v5/spell.rb +++ b/lib/sisu/v5/utils_spell.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/spell.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/utils_spell.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> diff --git a/lib/sisu/v5/webrick.rb b/lib/sisu/v5/webrick.rb index e43d8cd1..f6ff970b 100644 --- a/lib/sisu/v5/webrick.rb +++ b/lib/sisu/v5/webrick.rb @@ -70,7 +70,7 @@ module SiSU_Webserv rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('time or webrick NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Screen def initialize @@ -159,7 +159,7 @@ WOK get=Dir.pwd brick(@port,get) rescue - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb SiSU_Errors::Rescued.new($!,$@,'-W',nil).location do #fix __LINE__.to_s + ':' + __FILE__ end diff --git a/lib/sisu/v5/wikispeak.rb b/lib/sisu/v5/wikispeak.rb index e54b8edd..a0fba849 100644 --- a/lib/sisu/v5/wikispeak.rb +++ b/lib/sisu/v5/wikispeak.rb @@ -62,7 +62,7 @@ =end module SiSU_Wikispeak require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Param include SiSU_Viz diff --git a/lib/sisu/v5/xhtml.rb b/lib/sisu/v5/xhtml.rb index e1efeeaf..4253e8eb 100644 --- a/lib/sisu/v5/xhtml.rb +++ b/lib/sisu/v5/xhtml.rb @@ -63,9 +63,9 @@ module SiSU_XHTML require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'xml_shared' # xml_shared.rb include SiSU_XML_Munge diff --git a/lib/sisu/v5/xhtml_epub2.rb b/lib/sisu/v5/xhtml_epub2.rb index d0b4a7dc..9b110497 100644 --- a/lib/sisu/v5/xhtml_epub2.rb +++ b/lib/sisu/v5/xhtml_epub2.rb @@ -66,7 +66,7 @@ module SiSU_XHTML_EPUB2 rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)') end - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'defaults' # defaults.rb include SiSU_Viz diff --git a/lib/sisu/v5/xhtml_epub2_concordance.rb b/lib/sisu/v5/xhtml_epub2_concordance.rb index cb498d0f..447dd72e 100644 --- a/lib/sisu/v5/xhtml_epub2_concordance.rb +++ b/lib/sisu/v5/xhtml_epub2_concordance.rb @@ -62,9 +62,9 @@ =end module SiSU_XHTML_EPUB2_Concordance - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'defaults' # defaults.rb include SiSU_Viz @@ -157,7 +157,7 @@ WOK include SiSU_Viz require_relative 'xhtml_epub2_format' # xhtml_epub2_format.rb include SiSU_XHTML_EPUB2_Format - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Screen def initialize(particulars) @particulars=particulars diff --git a/lib/sisu/v5/xhtml_epub2_tune.rb b/lib/sisu/v5/xhtml_epub2_tune.rb index db234a19..aa748cf6 100644 --- a/lib/sisu/v5/xhtml_epub2_tune.rb +++ b/lib/sisu/v5/xhtml_epub2_tune.rb @@ -60,9 +60,9 @@ ** Description: epub generation, epub pre-processing =end -require_relative 'param' +require_relative 'dp' # dp.rb module SiSU_XHTML_EPUB2_Tune - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen require_relative 'xhtml_epub2_format' # xhtml_epub2_format.rb #watch @@line_mode='' diff --git a/lib/sisu/v5/xml_docbook5.rb b/lib/sisu/v5/xml_docbook5.rb index 0870c06e..8132a356 100644 --- a/lib/sisu/v5/xml_docbook5.rb +++ b/lib/sisu/v5/xml_docbook5.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_Docbook_Book - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'txt_shared' # txt_shared.rb include SiSU_TextUtils diff --git a/lib/sisu/v5/xml_dom.rb b/lib/sisu/v5/xml_dom.rb index b51a317a..a602eee3 100644 --- a/lib/sisu/v5/xml_dom.rb +++ b/lib/sisu/v5/xml_dom.rb @@ -63,9 +63,9 @@ module SiSU_XML_DOM require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'ao' # ao.rb require_relative 'xml_shared' # xml_shared.rb diff --git a/lib/sisu/v5/xml_fictionbook2.rb b/lib/sisu/v5/xml_fictionbook2.rb index 997f0b0a..74afc6ad 100644 --- a/lib/sisu/v5/xml_fictionbook2.rb +++ b/lib/sisu/v5/xml_fictionbook2.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_Fictionbook - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'txt_shared' # txt_shared.rb include SiSU_TextUtils diff --git a/lib/sisu/v5/xml_format.rb b/lib/sisu/v5/xml_format.rb index 7694f56b..871ec487 100644 --- a/lib/sisu/v5/xml_format.rb +++ b/lib/sisu/v5/xml_format.rb @@ -62,7 +62,7 @@ =end module SiSU_XML_Format - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class ParagraphNumber diff --git a/lib/sisu/v5/xml_md_oai_pmh_dc.rb b/lib/sisu/v5/xml_md_oai_pmh_dc.rb index 7ec83ff2..9279ba11 100644 --- a/lib/sisu/v5/xml_md_oai_pmh_dc.rb +++ b/lib/sisu/v5/xml_md_oai_pmh_dc.rb @@ -61,9 +61,9 @@ =end module SiSU_XML_Metadata - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param class OAI_PMH def initialize(opt) diff --git a/lib/sisu/v5/xml_odf_odt.rb b/lib/sisu/v5/xml_odf_odt.rb index df71ce81..55c8d7ed 100644 --- a/lib/sisu/v5/xml_odf_odt.rb +++ b/lib/sisu/v5/xml_odf_odt.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_ODF_ODT - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Viz require_relative 'xml_odf_odt_format' # xml_odf_odt_format.rb diff --git a/lib/sisu/v5/xml_odf_odt_format.rb b/lib/sisu/v5/xml_odf_odt_format.rb index b56e4284..bfbd075c 100644 --- a/lib/sisu/v5/xml_odf_odt_format.rb +++ b/lib/sisu/v5/xml_odf_odt_format.rb @@ -61,7 +61,7 @@ =end module SiSU_XML_ODF_ODT_Format - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class ParagraphNumber diff --git a/lib/sisu/v5/xml_sax.rb b/lib/sisu/v5/xml_sax.rb index ac2b6d47..58719798 100644 --- a/lib/sisu/v5/xml_sax.rb +++ b/lib/sisu/v5/xml_sax.rb @@ -63,9 +63,9 @@ module SiSU_XML_SAX require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'xml_shared' # xml_shared.rb include SiSU_XML_Munge diff --git a/lib/sisu/v5/xml_scaffold_structure_collapsed.rb b/lib/sisu/v5/xml_scaffold_structure_collapsed.rb index 0395d090..f36c937f 100644 --- a/lib/sisu/v5/xml_scaffold_structure_collapsed.rb +++ b/lib/sisu/v5/xml_scaffold_structure_collapsed.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_Scaffold_Structure_Collapse - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source def initialize(opt) diff --git a/lib/sisu/v5/xml_scaffold_structure_sisu.rb b/lib/sisu/v5/xml_scaffold_structure_sisu.rb index 39ca1e6a..44344328 100644 --- a/lib/sisu/v5/xml_scaffold_structure_sisu.rb +++ b/lib/sisu/v5/xml_scaffold_structure_sisu.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_Scaffold_Structure_Sisu - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source def initialize(opt) diff --git a/lib/sisu/v5/xml_shared.rb b/lib/sisu/v5/xml_shared.rb index 77df1a30..bd0e383b 100644 --- a/lib/sisu/v5/xml_shared.rb +++ b/lib/sisu/v5/xml_shared.rb @@ -567,7 +567,7 @@ module SiSU_XML_Munge end end module SiSU_XML_Tags #Format - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class RDF diff --git a/lib/sisu/v5/zap.rb b/lib/sisu/v5/zap.rb index 94a9e196..75707247 100644 --- a/lib/sisu/v5/zap.rb +++ b/lib/sisu/v5/zap.rb @@ -61,7 +61,7 @@ =end module SiSU_Zap - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source def initialize(opt) diff --git a/lib/sisu/v6/air.rb b/lib/sisu/v6/air.rb index 2af4038e..11c9445d 100644 --- a/lib/sisu/v6/air.rb +++ b/lib/sisu/v6/air.rb @@ -61,7 +61,7 @@ =end module SiSU_Air - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb class Source @@ao_array=[] @@fns=nil diff --git a/lib/sisu/v6/ao.rb b/lib/sisu/v6/ao.rb index 370bb7e1..56334b05 100644 --- a/lib/sisu/v6/ao.rb +++ b/lib/sisu/v6/ao.rb @@ -64,9 +64,9 @@ module SiSU_AO require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'ao_doc_objects' # ao.rb require_relative 'ao_syntax' # ao_syntax.rb @@ -124,7 +124,7 @@ module SiSU_AO : @opt.fns create_ao rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@@fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selection,@@fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -145,7 +145,7 @@ module SiSU_AO ? read_fnc : @@ao_array.dup rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selection,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -166,7 +166,7 @@ module SiSU_AO ? read_idx_sst : @@idx_arr[:sst].dup #check rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selection,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -187,7 +187,7 @@ module SiSU_AO ? read_idx_raw : @@idx_arr[:tex].dup #check rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selection,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -208,7 +208,7 @@ module SiSU_AO ? read_idx_html : @@idx_arr[:html].dup rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selection,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -229,7 +229,7 @@ module SiSU_AO ? read_idx_xhtml : @@idx_arr[:xhtml].dup rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selection,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -250,7 +250,7 @@ module SiSU_AO ? read_map_nametags : @@map_arr[:nametags].dup rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selection,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -271,7 +271,7 @@ module SiSU_AO ? read_map_ocn_htmlseg : @@map_arr[:ocn_htmlseg].dup rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selection,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/ao_composite.rb b/lib/sisu/v6/ao_composite.rb index eaa4e08f..d5f8974e 100644 --- a/lib/sisu/v6/ao_composite.rb +++ b/lib/sisu/v6/ao_composite.rb @@ -62,7 +62,7 @@ =end module SiSU_Assemble - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb class RemoteImage def initialize @env=SiSU_Env::InfoEnv.new @@ -114,7 +114,7 @@ module SiSU_Assemble end Dir.chdir(pwd) rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -157,7 +157,7 @@ module SiSU_Assemble end tuned_file=tuned_file.flatten.compact rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -253,7 +253,7 @@ module SiSU_Assemble fns_array=IO.readlines(@opt.fns,'') insertions?(fns_array) rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/ao_endnotes.rb b/lib/sisu/v6/ao_endnotes.rb index dbc8b214..dd31ba4c 100644 --- a/lib/sisu/v6/ao_endnotes.rb +++ b/lib/sisu/v6/ao_endnotes.rb @@ -76,11 +76,11 @@ module SiSU_AO_Endnotes endnote_ref=1 data.each do |dob| # manually numbered endnotes <!e(\d)!> <!e_(\d)!> --> - if @md.opt.mod.inspect =~/--no-asterisk|--no-annotate/ + if @md.opt.selections.str =~/--no-asterisk|--no-annotate/ dob.obj=dob.obj. gsub(/#{Mx[:en_b_o]}\s.+?#{Mx[:en_b_c]}/,'') end - if @md.opt.mod.inspect =~/--no-dagger|--no-annotate/ + if @md.opt.selections.str =~/--no-dagger|--no-annotate/ dob.obj=dob.obj. gsub(/#{Mx[:en_b_o]}[+]\s.+?#{Mx[:en_b_c]}/,'') end diff --git a/lib/sisu/v6/ao_expand_insertions.rb b/lib/sisu/v6/ao_expand_insertions.rb index eee89f3e..45a3a4ab 100644 --- a/lib/sisu/v6/ao_expand_insertions.rb +++ b/lib/sisu/v6/ao_expand_insertions.rb @@ -66,14 +66,18 @@ module SiSU_AO_Insertions @md,@data=md,data end def output_filetypes_in_cmd(cmd_shortcut,lnk=nil) #make list of file types in shortcut command (as configured), e.g. when sisu -3 is used - cf_defaults=SiSU_Env::InfoProcessingFlag.new - cmd_list=case cmd_shortcut.inspect - when /0/ then cf_defaults.cf_0 - when /1/ then cf_defaults.cf_1 - when /2/ then cf_defaults.cf_2 - when /3/ then cf_defaults.cf_3 - when /4/ then cf_defaults.cf_4 - when /5/ then cf_defaults.cf_5 + act_defaults=SiSU_Env::InfoProcessingFlag.new + cmd_list=case cmd_shortcut.inspect #check on expectation, string v array + when /0/ then act_defaults.act_0.str + when /1/ then act_defaults.act_1.str + when /2/ then act_defaults.act_2.str + when /3/ then act_defaults.act_3.str + when /4/ then act_defaults.act_4.str + when /5/ then act_defaults.act_5.str + when /6/ then act_defaults.act_6.str + when /7/ then act_defaults.act_7.str + when /8/ then act_defaults.act_8.str + when /9/ then act_defaults.act_9.str end file_type_names={} file_type_names[:gen],file_type_names[:src]=[],[] diff --git a/lib/sisu/v6/cgi.rb b/lib/sisu/v6/cgi.rb index a4065344..9a0dab33 100644 --- a/lib/sisu/v6/cgi.rb +++ b/lib/sisu/v6/cgi.rb @@ -61,8 +61,8 @@ (pgsql sqlite) =end -module SiSU_CGI #% database building documents - require_relative 'sysenv' # sysenv.rb +module SiSU_CGI #% database building documents + require_relative 'se' # se.rb require_relative 'cgi_pgsql' # cgi_pgsql.rb require_relative 'cgi_sqlite' # cgi_sqlite.rb class SearchSQL @@ -71,9 +71,9 @@ module SiSU_CGI @webserv=@opt.files[0].to_s.strip end def read - if @opt.mod.inspect =~/--db[=-]["']?(?:pg|pg?sql|postgres(?:ql)?)["']+/ + if @opt.act[:psql][:set]==:on SiSU_CGI_PgSQL::SearchPgSQL.new(@opt,@webserv).pgsql - elsif @opt.mod.inspect =~/--db[=-](?:sqlite)/ + elsif @opt.act[:sqlite][:set]==:on SiSU_CGI_SQLite::SearchSQLite.new(@opt,@webserv).sqlite else puts <<-WOK diff --git a/lib/sisu/v6/cgi_pgsql.rb b/lib/sisu/v6/cgi_pgsql.rb index 38b5c09f..09ded270 100644 --- a/lib/sisu/v6/cgi_pgsql.rb +++ b/lib/sisu/v6/cgi_pgsql.rb @@ -60,8 +60,8 @@ ** Description: generates naive cgi search form for search of sisu database (pgsql) =end -module SiSU_CGI_PgSQL #% database building documents - require_relative 'sysenv' # sysenv.rb +module SiSU_CGI_PgSQL #% database building documents + require_relative 'se' # se.rb require_relative 'cgi_sql_common' # cgi_sql_common.rb include SiSU_CGI_SQL class SearchPgSQL < CGI_Common diff --git a/lib/sisu/v6/cgi_sql_common.rb b/lib/sisu/v6/cgi_sql_common.rb index 6e9ddf25..d4a0b511 100644 --- a/lib/sisu/v6/cgi_sql_common.rb +++ b/lib/sisu/v6/cgi_sql_common.rb @@ -64,7 +64,6 @@ module SiSU_CGI_SQL class CGI_Common def initialize(webserv,opt,image_src,dir) @webserv,@opt,@image_src,@env=webserv,opt,image_src,dir - @cmd=opt.cmd end def about <<-'WOK_SQL' diff --git a/lib/sisu/v6/cgi_sqlite.rb b/lib/sisu/v6/cgi_sqlite.rb index 8cf01d3e..722d9033 100644 --- a/lib/sisu/v6/cgi_sqlite.rb +++ b/lib/sisu/v6/cgi_sqlite.rb @@ -60,8 +60,8 @@ ** Description: generates naive cgi search form for search of sisu database (sqlite) =end -module SiSU_CGI_SQLite #% database building documents - require_relative 'sysenv' # sysenv.rb +module SiSU_CGI_SQLite #% database building documents + require_relative 'se' # se.rb require_relative 'cgi_sql_common' # cgi_sql_common.rb include SiSU_CGI_SQL class SearchSQLite < CGI_Common diff --git a/lib/sisu/v6/conf.rb b/lib/sisu/v6/conf.rb index b3a5375e..22111002 100644 --- a/lib/sisu/v6/conf.rb +++ b/lib/sisu/v6/conf.rb @@ -61,7 +61,7 @@ =end module SiSU_Initialize - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Screen require_relative 'relaxng' # relaxng.rb @@ -82,7 +82,7 @@ module SiSU_Initialize end end class ConfigSite #config files such as css are not updated if they already exist unless forced using the --init=site modifier - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb def initialize(opt) @opt=opt @env=SiSU_Env::InfoEnv.new(@opt.fns) @@ -206,10 +206,10 @@ module SiSU_Initialize rnc.close #xsd schema=SiSU_Env::SystemCall.new(rnc_src,xsd_file) - schema.relaxng(@opt.cmd) + schema.relaxng(@opt.selections.str) #rng schema=SiSU_Env::SystemCall.new(rnc_src,rng_file) - schema.relaxng(@opt.cmd) + schema.relaxng(@opt.selections.str) #rnc if FileTest.file?(rnc_src) FileUtils::cp(rnc_src,rnc_file) @@ -228,10 +228,10 @@ module SiSU_Initialize rnc.close #xsd schema=SiSU_Env::SystemCall.new(rnc_src,xsd_file) - schema.relaxng(@opt.cmd) + schema.relaxng(@opt.selections.str) #rng schema=SiSU_Env::SystemCall.new(rnc_src,rng_file) - schema.relaxng(@opt.cmd) + schema.relaxng(@opt.selections.str) #rnc if FileTest.file?(rnc_src) FileUtils::cp(rnc_src,rnc_file) @@ -250,10 +250,10 @@ module SiSU_Initialize rnc.close #xsd schema=SiSU_Env::SystemCall.new(rnc_src,xsd_file) - schema.relaxng(@opt.cmd) + schema.relaxng(@opt.selections.str) #rng schema=SiSU_Env::SystemCall.new(rnc_src,rng_file) - schema.relaxng(@opt.cmd) + schema.relaxng(@opt.selections.str) #rnc if FileTest.file?(rnc_src) FileUtils::cp(rnc_src,rnc_file) @@ -268,7 +268,7 @@ module SiSU_Initialize rnc << @rxng.rnc_model_output_sax rnc.close schema=SiSU_Env::SystemCall.new(rnc_file,dtd_file) - schema.relaxng(@opt.cmd) + schema.relaxng(@opt.selections.str) end def trang_rnc_model_input_dom rnc_file=@env.processing_path.ao + '/dom.rnc' @@ -277,7 +277,7 @@ module SiSU_Initialize rnc << @rxng.rnc_model_output_dom rnc.close schema=SiSU_Env::SystemCall.new(rnc_file,dtd_file) - schema.relaxng(@opt.cmd) + schema.relaxng(@opt.selections.str) end def trang_rnc_model_input_node rnc_file=@env.processing_path.ao + '/node.rnc' @@ -286,7 +286,7 @@ module SiSU_Initialize rnc << @rxng.rnc_model_input_node rnc.close schema=SiSU_Env::SystemCall.new(rnc_file,dtd_file) - schema.relaxng(@opt.cmd) + schema.relaxng(@opt.selections.str) end end end diff --git a/lib/sisu/v6/css.rb b/lib/sisu/v6/css.rb index b59458ee..a2c75d3c 100644 --- a/lib/sisu/v6/css.rb +++ b/lib/sisu/v6/css.rb @@ -61,7 +61,7 @@ =end module SiSU_Style - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb require_relative 'defaults' # defaults.rb class CSS_HeadInfo def initialize(md,ft='html') diff --git a/lib/sisu/v6/db_columns.rb b/lib/sisu/v6/db_columns.rb index f7db347e..d9eda1d7 100644 --- a/lib/sisu/v6/db_columns.rb +++ b/lib/sisu/v6/db_columns.rb @@ -62,7 +62,7 @@ =end module SiSU_DbColumns - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb require_relative 'db_sqltxt' # db_sqltxt.rb class Columns < SiSU_DbText::Prepare def initialize(md=nil) diff --git a/lib/sisu/v6/db_create.rb b/lib/sisu/v6/db_create.rb index e9e6aa40..4d551ee2 100644 --- a/lib/sisu/v6/db_create.rb +++ b/lib/sisu/v6/db_create.rb @@ -64,7 +64,7 @@ module SiSU_DbCreate require_relative 'db_columns' # db_columns.rb class Create < SiSU_DbColumns::Columns - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb @@dl=nil def initialize(opt,conn,file,sql_type=:pg) @opt,@conn,@file,@sql_type=opt,conn,file,sql_type diff --git a/lib/sisu/v6/db_drop.rb b/lib/sisu/v6/db_drop.rb index e93d2889..3363746a 100644 --- a/lib/sisu/v6/db_drop.rb +++ b/lib/sisu/v6/db_drop.rb @@ -63,7 +63,7 @@ =end module SiSU_DbDrop class Drop - require_relative 'response' # response.rb + require_relative 'utils_response' # utils_response.rb def initialize(opt,conn,db_info,sql_type) @opt,@conn,@db_info,@sql_type=opt,conn,db_info,sql_type @ans=SiSU_Response::Response.new diff --git a/lib/sisu/v6/db_import.rb b/lib/sisu/v6/db_import.rb index 51eb5562..5b44b173 100644 --- a/lib/sisu/v6/db_import.rb +++ b/lib/sisu/v6/db_import.rb @@ -79,7 +79,7 @@ module SiSU_DbImport @env=SiSU_Env::InfoEnv.new(@opt.fns) @dal="#{@env.processing_path.ao}" @fnb=if @opt.fns.empty? \ - or @opt.cmd.empty? + or @opt.selections.str.empty? '' else @md=SiSU_Param::Parameters.new(@opt).get @@ -233,7 +233,7 @@ module SiSU_DbImport @conn.exec("COMMIT") end rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" @@ -700,7 +700,7 @@ module SiSU_DbImport end end rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -833,7 +833,7 @@ module SiSU_DbImport t=SiSU_DbTuple::LoadUrls.new(@conn,f,u,@@id_t,@opt,@file_maint) tuple=t.tuple rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/db_load_tuple.rb b/lib/sisu/v6/db_load_tuple.rb index c4740259..46d29896 100644 --- a/lib/sisu/v6/db_load_tuple.rb +++ b/lib/sisu/v6/db_load_tuple.rb @@ -64,7 +64,7 @@ module SiSU_DbTuple require_relative 'db_columns' # db_columns.rb class LoadDocuments - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param def initialize(conn,col,opt,file_maint) @conn,@col,@opt,@file_maint=conn,col,opt,file_maint diff --git a/lib/sisu/v6/db_remove.rb b/lib/sisu/v6/db_remove.rb index 91909937..1a4b9d50 100644 --- a/lib/sisu/v6/db_remove.rb +++ b/lib/sisu/v6/db_remove.rb @@ -178,7 +178,7 @@ module SiSU_DbRemove || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new( - @opt.cmd, + @opt.selections.str, "no such file in database #{@db.psql.db}::#{@opt.fns}" ).puts_grey end diff --git a/lib/sisu/v6/dbi.rb b/lib/sisu/v6/dbi.rb index 5880aa1a..3ee6bf0a 100644 --- a/lib/sisu/v6/dbi.rb +++ b/lib/sisu/v6/dbi.rb @@ -61,9 +61,9 @@ =end module SiSU_DBI #% database building - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'db_dbi' # db_dbi.rb include SiSU_DbDBI @@ -97,8 +97,7 @@ module SiSU_DBI end end def maintenance_check(opt,file,line) - p opt.mod - p opt.cmd + p opt.selections.str p "at #{file} #{line}" end def read_psql @@ -134,7 +133,7 @@ manually create the database: "#{cX.green}#{@db.db}#{cX.off}" if it does not yet end SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], - "DBI (#{@sql_type}) #{@opt.mod}", + "SQL DB #{@sql_type.upcase}", @opt.fno ).dbi_title unless @opt.act[:quiet][:set]==:on begin diff --git a/lib/sisu/v6/dbi_discrete.rb b/lib/sisu/v6/dbi_discrete.rb index fc5c310f..d4ddb202 100644 --- a/lib/sisu/v6/dbi_discrete.rb +++ b/lib/sisu/v6/dbi_discrete.rb @@ -61,9 +61,9 @@ =end module SiSU_DBI_Discrete #% database building - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'db_dbi' # db_dbi.rb include SiSU_DbDBI @@ -127,7 +127,7 @@ module SiSU_DBI_Discrete #% database building begin SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], - 'SQLite', + 'SQLite (discrete)', "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}" ).green_title_hi unless @opt.act[:quiet][:set]==:on sdb.create_db diff --git a/lib/sisu/v6/defaults.rb b/lib/sisu/v6/defaults.rb index a26edae9..c725b11d 100644 --- a/lib/sisu/v6/defaults.rb +++ b/lib/sisu/v6/defaults.rb @@ -67,7 +67,7 @@ module SiSU_Viz rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('uri NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'css' # css.rb include SiSU_Style diff --git a/lib/sisu/v6/digests.rb b/lib/sisu/v6/digests.rb index c7a6d3c1..57665579 100644 --- a/lib/sisu/v6/digests.rb +++ b/lib/sisu/v6/digests.rb @@ -61,7 +61,7 @@ =end module SiSU_DigestView - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb require_relative 'prog_text_translation' # prog_text_translation.rb require_relative 'shared_markup_alt.rb' # shared_markup_alt.rb class Source @@ -111,7 +111,7 @@ module SiSU_DigestView SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('*EXITED* hash digests will not run without openssl') end rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/param.rb b/lib/sisu/v6/dp.rb index 25b50ba8..50317108 100644 --- a/lib/sisu/v6/param.rb +++ b/lib/sisu/v6/dp.rb @@ -51,13 +51,13 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/param.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/dp.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> <ralph.amissah@gmail.com> - ** Description: parameters extracted from input file(s) for program use + ** Description: document parameters extracted from input files for program use =end module SiSU_Param @@ -68,10 +68,10 @@ module SiSU_Param SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). error('uri or pstore NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param_make' # param_make.rb - require_relative 'param_identify_markup' # param_identify_markup.rb + require_relative 'dp_make' # dp_make.rb + require_relative 'dp_identify_markup' # dp_identify_markup.rb @@date=SiSU_Env::InfoDate.new @@proc= @@filename_txt= @@ -103,8 +103,7 @@ module SiSU_Param def initialize(opt) @opt=opt @cX||=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]) - @cmd,@mod=opt.cmd,opt.mod - @fns=if @opt.cmd =~/P/ #revisit CHECK + @fns=if @opt.act[:psql][:set] == [:on] #revisit CHECK opt.fns else opt.fns.gsub(/\.ssm$/,'.ssm.sst') end @@ -886,7 +885,7 @@ module SiSU_Param Dir.chdir(@opt.f_pth[:pth]) begin rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -926,563 +925,569 @@ module SiSU_Param end #protected def extract - @user,@home,@hostname,@pwd=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD'] - @programs,@wc,@language,@language_original={},{},{},{} - @en={ sum: 0, mark: 0, note: 0, mismatch: 0 } - @prog=SiSU_Env::InfoSettings.new - @sys=SiSU_Env::SystemCall.new - @env=SiSU_Env::InfoEnv.new(@fns) #watch - if (@opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - puts 'system locale: ' + @sys.locale - end - if @prog.wc \ - and @sys.wc - wc=%x{wc #{fns}} - wca=wc.scan(/\d+/) - @wc_lines,@wc_words,@wc_bytes=wca[0].to_i,wca[1].to_i,wca[2].to_i - else - fns_a=@data.dup - tmp=fns_a.join - fns_a=tmp.scan(/\S+/) - @wc_words=fns_a.length - fns_a=tmp=nil - end - @concord_make=(@wc_words > @env.concord_max) ? false : true - @locale=@sys.locale - @file_encoding=@sys.file_encoding(fns,@opt.cmd) - # programs set here for things that affect output appearance only - @programs[:pdf]=SiSU_Env::SystemCall.new.program_found?('pdflatex') - if @opt.cmd =~/P/ #if @env.multilingual? - m=/((.+?)(?:\~\w\w(?:_\w\w)?)?)\.((?:-|ssm\.)?sst|ssm|ssi)$/ #watch added match for sss - @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3] - @flv=@env.document_language_versions_found[:f] - else - m=/((.+?)(?:\~\w\w(?:_\w\w)?)?)\.((?:-|ssm\.)?sst|ssm)$/ #watch added match for sss - @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3] - @flv=@env.document_language_versions_found[:f] - @fnz=(@fns =~/\.(?:ssm\.sst|ssm)$/) ? (@fnn + '.ssm.txz') : (@fnn + '.sst.txz') - end - @papersize=@env.papersize #'A4' #default size #get first from SiSU_Env:: # @env is probably no longer most appropriate name! as default info is more general - @sfx_src=@fns[m,2] - if @fns =~ /(?:-|ssm\.)?sst$/ \ - and not @opt.cmd =~/P/ #watch - @env_out_root=@env.path.output - @dir_out="#{@env.path.output}/#{@fnb}" - @dir_tex=@env.processing_path.tex - @dir_lout=@env.processing_path.lout - @@publisher='SiSU http://www.jus.uio.no/sisu' - end - @txt_path=@txt_path ||= @env.path.output - @stmp=%{#{@fns}}[/^(.+?)\..*/m,1] - @fnstex=@fns.gsub(/_/,'\_\-').gsub(/\./,'.\-') - @flag_endnotes,@flag_auto_endnotes,@flag_separate_endnotes=false,false,false - @flag_separate_endnotes_make=true - ver=SiSU_Env::InfoVersion.instance - @sisu_version=ver.get_version - @ruby_version=ver.rbversion - @generated=Time.now - fns_array=@data.dup - skip unless fns_array # consider - @code_flag=false - fns_array.each do |para| #% scan document - if para !~/^%+\s/ \ - and para =~/<![abcdeghijklmnopqrstuvwxyz]/i # <!f not included - raise "Old markup style in file #{@fns}, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n" + begin + @user,@home,@hostname,@pwd=ENV['USER'],ENV['HOME'],ENV['HOSTNAME'],ENV['PWD'] + @programs,@wc,@language,@language_original={},{},{},{} + @en={ sum: 0, mark: 0, note: 0, mismatch: 0 } + @prog=SiSU_Env::InfoSettings.new + @sys=SiSU_Env::SystemCall.new + @env=SiSU_Env::InfoEnv.new(@fns) #watch + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + puts 'system locale: ' + @sys.locale end - @code_flag=case para - when /^code\{\s*$/ then true - when /^\}code\s*$/ then false - else @code_flag + if @prog.wc \ + and @sys.wc + wc=%x{wc #{fns}} + wca=wc.scan(/\d+/) + @wc_lines,@wc_words,@wc_bytes=wca[0].to_i,wca[1].to_i,wca[2].to_i + else + fns_a=@data.dup + tmp=fns_a.join + fns_a=tmp.scan(/\S+/) + @wc_words=fns_a.length + fns_a=tmp=nil end - regx_header=/^@\S+?:[+-]?\s/ - if para =~regx_header \ - and not @code_flag #or para=~/^(?:1|:?A)~/ - case para - when /^@title:(.+)/m #% * header metadata - title - @title=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).title - when /^@creator:(.+)/m #% * header metadata - creator - @creator=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).creator - @authorship=@author=@creator.author - @authors=@creator.author_detail - when /^@date:(.+)/m #% * header metadata - date - @date=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).date - when /^@publisher:\s+(.+)/m #% * header metadata - publisher - @publisher=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).current_publisher - @current_publisher=@publisher - when /^@rights:(.+)/m #% * header metadata - rights - @rights=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).rights - when /^@classify:(.+)/m #% * header metadata - classify - @classify=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).classify - when /^@identifier:(.+)/m #% * header metadata - identifier - @identifier=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).identifier - when /^@original:(.+)/m #% * header metadata - original (document) - @original=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).original - @source=@original.source - when /^@notes?:\s(.+)\Z/m #% * header metadata - notes - @notes=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).notes - when /^@links:\s+(.+?)\Z/m #% * header metadata - links - links=SiSU_Param::Parameters::MdMake.new($1.strip,@opt,@env).make_links.links - @lnk=@links=if @header_make_links_append == :yes - (links) \ - ? (links + @links) - : @links - else - (links) \ - ? (links) - : @links - end - when /^@make:(.+)/m #% * header processing - make - @make=SiSU_Param::Parameters::MdMake.new($1.strip,@opt,@env).make - makes=SiSU_Param_Make::MakeHead.new(@make).make_instruct - @pagenew=(makes[:pagenew]) \ - ? (makes[:pagenew]) \ - : @pagenew - @pagebreak=(makes[:pagebreak]) \ - ? (makes[:pagebreak]) \ - : @pagebreak - @pageline=(makes[:pageline]) \ - ? (makes[:pageline]) \ - : @pageline - @toc=(makes[:toc]) ? (makes[:toc]) : @toc - @lv0=(makes[:lv0]) ? (makes[:lv0]) : @lv0 - @lv1=(makes[:lv1]) ? (makes[:lv1]) : @lv1 - @lv2=(makes[:lv2]) ? (makes[:lv2]) : @lv2 - @lv3=(makes[:lv3]) ? (makes[:lv3]) : @lv3 - @lv4=(makes[:lv4]) ? (makes[:lv4]) : @lv4 - @lv5=(makes[:lv5]) ? (makes[:lv5]) : @lv5 - @lv6=(makes[:lv6]) ? (makes[:lv6]) : @lv6 - @num_top= - (makes[:num_top]) \ - ? (makes[:num_top]) \ - : @num_top - @substitution_match_list= - (makes[:substitution_match_list]) \ - ? (makes[:substitution_match_list]) \ - : @substitution_match_list - @bold_match_list= - (makes[:bold_match_list]) \ - ? (makes[:bold_match_list]) \ - : @bold_match_list - @italics_match_list= - (makes[:italics_match_list]) \ - ? (makes[:italics_match_list]) \ - : @italics_match_list - @emphasis_set_to= - (makes[:emphasis_set_to]) \ - ? (makes[:emphasis_set_to]) \ - : @emphasis_set_to - @i18n= - (makes[:i18n]) \ - ? (makes[:i18n]) \ - : @i18n - @man_section= - (makes[:man_section]) \ - ? (makes[:man_section]) \ - : @man_section - @footer_links= - (makes[:footer_links]) \ - ? (makes[:footer_links]) \ - : @footer_links - @home_button_links= - (makes[:home_button_links]) \ - ? (makes[:home_button_links]) \ - : @home_button_links - @home_button_image= - (makes[:home_button_image]) \ - ? (makes[:home_button_image]) \ - : @home_button_image - @cover_image= - (makes[:cover_image]) \ - ? (makes[:cover_image]) \ - : @cover_image + @concord_make=(@wc_words > @env.concord_max) ? false : true + @locale=@sys.locale + @file_encoding=@sys.file_encoding(fns,@opt.act) + # programs set here for things that affect output appearance only + @programs[:pdf]=SiSU_Env::SystemCall.new.program_found?('pdflatex') + if @opt.act[:psql][:set] == [:ok] + m=/((.+?)(?:\~\w\w(?:_\w\w)?)?)\.((?:-|ssm\.)?sst|ssm|ssi)$/ #watch added match for sss + @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3] + @flv=@env.document_language_versions_found[:f] + else + m=/((.+?)(?:\~\w\w(?:_\w\w)?)?)\.((?:-|ssm\.)?sst|ssm)$/ #watch added match for sss + @fnn,@fnb,@fnt=@fns[m,1],@fns[m,2],@fns[m,3] + @flv=@env.document_language_versions_found[:f] + @fnz=(@fns =~/\.(?:ssm\.sst|ssm)$/) ? (@fnn + '.ssm.txz') : (@fnn + '.sst.txz') + end + @papersize=@env.papersize #'A4' #default size #get first from SiSU_Env:: # @env is probably no longer most appropriate name! as default info is more general + @sfx_src=@fns[m,2] + if @fns =~ /(?:-|ssm\.)?sst$/ \ + and not @opt.act[:psql][:set] == [:ok] + @env_out_root=@env.path.output + @dir_out="#{@env.path.output}/#{@fnb}" + @dir_tex=@env.processing_path.tex + @dir_lout=@env.processing_path.lout + @@publisher='SiSU http://www.jus.uio.no/sisu' + end + @txt_path=@txt_path ||= @env.path.output + @stmp=%{#{@fns}}[/^(.+?)\..*/m,1] + @fnstex=@fns.gsub(/_/,'\_\-').gsub(/\./,'.\-') + @flag_endnotes,@flag_auto_endnotes,@flag_separate_endnotes=false,false,false + @flag_separate_endnotes_make=true + ver=SiSU_Env::InfoVersion.instance + @sisu_version=ver.get_version + @ruby_version=ver.rbversion + @generated=Time.now + fns_array=@data.dup + skip unless fns_array # consider + @code_flag=false + fns_array.each do |para| #% scan document + if para !~/^%+\s/ \ + and para =~/<![abcdeghijklmnopqrstuvwxyz]/i # <!f not included + raise "Old markup style in file #{@fns}, current version #{@sisu_version[:project]} #{@sisu_version[:version]} #{@sisu_version[:date_stamp]} #{@sisu_version[:date]}:\n\t\t#{para}\n\n" + end + @code_flag=case para + when /^code\{\s*$/ then true + when /^\}code\s*$/ then false + else @code_flag end - @lv0 ||=/^0~/ - @lv1 ||=/^1~/ - @lv2 ||=/^2~/ - @lv3 ||=/^3~/ - @lv4 ||=/^4~/ - @lv5 ||=/^5~/ - @lv6 ||=/^6~/ - else #% * - l_0=l_1=l_2=l_3=l_4=l_5='' - if defined? @make.headings[0] - l_0=if defined? @make.headings[0][0] \ - and @make.headings[0][0] =~/\S+/ - "|^#{@make.headings[0][0]}" + regx_header=/^@\S+?:[+-]?\s/ + if para =~regx_header \ + and not @code_flag #or para=~/^(?:1|:?A)~/ + case para + when /^@title:(.+)/m #% * header metadata - title + @title=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).title + when /^@creator:(.+)/m #% * header metadata - creator + @creator=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).creator + @authorship=@author=@creator.author + @authors=@creator.author_detail + when /^@date:(.+)/m #% * header metadata - date + @date=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).date + when /^@publisher:\s+(.+)/m #% * header metadata - publisher + @publisher=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).current_publisher + @current_publisher=@publisher + when /^@rights:(.+)/m #% * header metadata - rights + @rights=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).rights + when /^@classify:(.+)/m #% * header metadata - classify + @classify=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).classify + when /^@identifier:(.+)/m #% * header metadata - identifier + @identifier=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).identifier + when /^@original:(.+)/m #% * header metadata - original (document) + @original=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).original + @source=@original.source + when /^@notes?:\s(.+)\Z/m #% * header metadata - notes + @notes=SiSU_Param::Parameters::Md.new($1.strip,@opt,@env).notes + when /^@links:\s+(.+?)\Z/m #% * header metadata - links + links=SiSU_Param::Parameters::MdMake.new($1.strip,@opt,@env).make_links.links + @lnk=@links=if @header_make_links_append == :yes + (links) \ + ? (links + @links) + : @links + else + (links) \ + ? (links) + : @links + end + when /^@make:(.+)/m #% * header processing - make + @make=SiSU_Param::Parameters::MdMake.new($1.strip,@opt,@env).make + makes=SiSU_Param_Make::MakeHead.new(@make).make_instruct + @pagenew=(makes[:pagenew]) \ + ? (makes[:pagenew]) \ + : @pagenew + @pagebreak=(makes[:pagebreak]) \ + ? (makes[:pagebreak]) \ + : @pagebreak + @pageline=(makes[:pageline]) \ + ? (makes[:pageline]) \ + : @pageline + @toc=(makes[:toc]) ? (makes[:toc]) : @toc + @lv0=(makes[:lv0]) ? (makes[:lv0]) : @lv0 + @lv1=(makes[:lv1]) ? (makes[:lv1]) : @lv1 + @lv2=(makes[:lv2]) ? (makes[:lv2]) : @lv2 + @lv3=(makes[:lv3]) ? (makes[:lv3]) : @lv3 + @lv4=(makes[:lv4]) ? (makes[:lv4]) : @lv4 + @lv5=(makes[:lv5]) ? (makes[:lv5]) : @lv5 + @lv6=(makes[:lv6]) ? (makes[:lv6]) : @lv6 + @num_top= + (makes[:num_top]) \ + ? (makes[:num_top]) \ + : @num_top + @substitution_match_list= + (makes[:substitution_match_list]) \ + ? (makes[:substitution_match_list]) \ + : @substitution_match_list + @bold_match_list= + (makes[:bold_match_list]) \ + ? (makes[:bold_match_list]) \ + : @bold_match_list + @italics_match_list= + (makes[:italics_match_list]) \ + ? (makes[:italics_match_list]) \ + : @italics_match_list + @emphasis_set_to= + (makes[:emphasis_set_to]) \ + ? (makes[:emphasis_set_to]) \ + : @emphasis_set_to + @i18n= + (makes[:i18n]) \ + ? (makes[:i18n]) \ + : @i18n + @man_section= + (makes[:man_section]) \ + ? (makes[:man_section]) \ + : @man_section + @footer_links= + (makes[:footer_links]) \ + ? (makes[:footer_links]) \ + : @footer_links + @home_button_links= + (makes[:home_button_links]) \ + ? (makes[:home_button_links]) \ + : @home_button_links + @home_button_image= + (makes[:home_button_image]) \ + ? (makes[:home_button_image]) \ + : @home_button_image + @cover_image= + (makes[:cover_image]) \ + ? (makes[:cover_image]) \ + : @cover_image end - l_1=if defined? @make.headings[0][1] \ - and @make.headings[0][1] =~/\S+/ - "|^#{@make.headings[0][1]}" + @lv0 ||=/^0~/ + @lv1 ||=/^1~/ + @lv2 ||=/^2~/ + @lv3 ||=/^3~/ + @lv4 ||=/^4~/ + @lv5 ||=/^5~/ + @lv6 ||=/^6~/ + else #% * + l_0=l_1=l_2=l_3=l_4=l_5='' + if defined? @make.headings[0] + l_0=if defined? @make.headings[0][0] \ + and @make.headings[0][0] =~/\S+/ + "|^#{@make.headings[0][0]}" + end + l_1=if defined? @make.headings[0][1] \ + and @make.headings[0][1] =~/\S+/ + "|^#{@make.headings[0][1]}" + end + l_2=if defined? @make.headings[0][2] \ + and @make.headings[0][2] =~/\S+/ + "|^#{@make.headings[0][2]}" + end + l_3=if defined? @make.headings[0][3] \ + and @make.headings[0][3] =~/\S+/ + "|^#{@make.headings[0][3]}" + end + l_4=if defined? @make.headings[0][4] \ + and @make.headings[0][4] =~/\S+/ + "|^#{@make.headings[0][4]}" + end + l_5=if defined? @make.headings[0][5] \ + and @make.headings[0][5] =~/\S+/ + "|^#{@make.headings[0][5]}" + end end - l_2=if defined? @make.headings[0][2] \ - and @make.headings[0][2] =~/\S+/ - "|^#{@make.headings[0][2]}" + case para + #when /^:?A~/ + when /^:?B~#{l_0}/ + @lvs[1]=1 + when /^:?C~#{l_1}/ + @lvs[2]=1 + when /^:?D~#{l_2}/ + @lvs[3]=1 + when /^1~#{l_3}/ + @lvs[4]=1 + when /^2~#{l_4}/ + @lvs[5]=1 + when /^3~#{l_5}/ + @lvs[6]=1 end - l_3=if defined? @make.headings[0][3] \ - and @make.headings[0][3] =~/\S+/ - "|^#{@make.headings[0][3]}" + if para =~ /^:?A~/ #% processing + if not defined? @title.full.nil? + tf=para[/^:A~\S*(.+)$/m,1] + tf="@title: #{tf}" + @title=SiSU_Param::Parameters::Md.new(tf.strip,@opt,@env).title + end + creator=(@creator.is_a?(SiSU_Param::Parameters::Md) \ + && defined? @creator.author \ + && @creator.author.is_a?(String)) \ + ? " #{@creator.author}" + : '' + title=@title.full.gsub(/\s*(?:<p>|<p \/>|<br>|<br \/>)\s*/,' '). + gsub(/~\{.+?\}~/,'') + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'Document Parameters', + %{#{title}#{creator}} + ).txt_grey if @opt.act[:verbose][:set]==:on end - l_4=if defined? @make.headings[0][4] \ - and @make.headings[0][4] =~/\S+/ - "|^#{@make.headings[0][4]}" + if not @book_idx \ + and para =~/^=\{(.+?)\}[\s`]*\Z/m + @book_idx=true end - l_5=if defined? @make.headings[0][5] \ - and @make.headings[0][5] =~/\S+/ - "|^#{@make.headings[0][5]}" + unless @code_flag + case para + when /~\{\s+.+?\}~/m #% processing + en=para.scan(/~\{.+?\}~/m) + en.each { |e| @en[:sum] +=1 } + when /~\^(?:\s|$)/m #% processing + mk=para.scan(/~\^(?:\s|$)/) + mk.each { |e| @en[:mark] +=1 } + when /^\^~\s+\S/ then @en[:note] +=1 #% processing + end end - end - case para - #when /^:?A~/ - when /^:?B~#{l_0}/ - @lvs[1]=1 - when /^:?C~#{l_1}/ - @lvs[2]=1 - when /^:?D~#{l_2}/ - @lvs[3]=1 - when /^1~#{l_3}/ - @lvs[4]=1 - when /^2~#{l_4}/ - @lvs[5]=1 - when /^3~#{l_5}/ - @lvs[6]=1 - end - if para =~ /^:?A~/ #% processing - if not defined? @title.full.nil? - tf=para[/^:A~\S*(.+)$/m,1] - tf="@title: #{tf}" - @title=SiSU_Param::Parameters::Md.new(tf.strip,@opt,@env).title + if para =~/~\{|\^~ |~\^|\{.+?\[[1-6]\]\}\S+?\.ss[tm]/m + @flag_auto_endnotes,@flag_endnotes=true,true end - creator=(@creator.is_a?(SiSU_Param::Parameters::Md) \ - && defined? @creator.author \ - && @creator.author.is_a?(String)) \ - ? " #{@creator.author}" - : '' - title=@title.full.gsub(/\s*(?:<p>|<p \/>|<br>|<br \/>)\s*/,' '). - gsub(/~\{.+?\}~/,'') - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - 'Parameters', - %{#{title}#{creator}} - ).txt_grey if @opt.act[:verbose][:set]==:on - end - if not @book_idx \ - and para =~/^=\{(.+?)\}[\s`]*\Z/m - @book_idx=true - end - unless @code_flag - case para - when /~\{\s+.+?\}~/m #% processing - en=para.scan(/~\{.+?\}~/m) - en.each { |e| @en[:sum] +=1 } - when /~\^(?:\s|$)/m #% processing - mk=para.scan(/~\^(?:\s|$)/) - mk.each { |e| @en[:mark] +=1 } - when /^\^~\s+\S/ then @en[:note] +=1 #% processing + if para =~/^(?:table\{|\{table)/i + @flag_tables=true end end - if para =~/~\{|\^~ |~\^|\{.+?\[[1-6]\]\}\S+?\.ss[tm]/m - @flag_auto_endnotes,@flag_endnotes=true,true + if para =~/^:?A~/ + @set_heading_top=true end - if para =~/^(?:table\{|\{table)/i - @flag_tables=true + if para =~/^1~/ + m=nil + if para =~/^1~(\S+)\s+(.+)$/ + m,t=$1,$2 + elsif para =~/^1~\s+(.+)$/ + t=$1 + end + unless @heading_seg_first_flag # extract first segment name + @heading_seg_first=t + @heading_seg_first_flag=true + end + if m # list all segment names + @seg_names << m + @set_heading_seg=true + if m=~/^\d{1,3}/ \ + and m !~/^0/ + @seg_autoname_safe=false + end + end end - end - if para =~/^:?A~/ - @set_heading_top=true - end - if para =~/^1~/ - m=nil - if para =~/^1~(\S+)\s+(.+)$/ - m,t=$1,$2 - elsif para =~/^1~\s+(.+)$/ - t=$1 + para=para.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) + if para !~/^%+\s/ \ + and para =~@rgx_image + @ec[:image] << para.scan(@rgx_image).uniq end - unless @heading_seg_first_flag # extract first segment name - @heading_seg_first=t - @heading_seg_first_flag=true + @ec[:audio] << para.scan(@rgx_audio).uniq if para =~@rgx_audio #embedded content + @ec[:multimedia] << para.scan(@rgx_mm).uniq if para =~@rgx_mm #embedded content + unless @sem_tag + @sem_tag=true if para=~/[:;]\{.+?\}[:;][a-z+]/ #refix later end - if m # list all segment names - @seg_names << m - @set_heading_seg=true - if m=~/^\d{1,3}/ \ - and m !~/^0/ - @seg_autoname_safe=false - end + end #% here endeth the document loop + unless @make + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + '@make:', + 'header absent' + ).warn end + @make=SiSU_Param::Parameters::MdMake.new('@make: ',@opt,@env).make end - para=para.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) - if para !~/^%+\s/ \ - and para =~@rgx_image - @ec[:image] << para.scan(@rgx_image).uniq + if @cover_image \ + and @cover_image.is_a?(Hash) \ + and (@cover_image[:cover] =~@rgx_image \ + or @cover_image[:cover] =~/\S+?.(?:jpg|png|gif)/) + @ec[:image] << @cover_image[:cover] end - @ec[:audio] << para.scan(@rgx_audio).uniq if para =~@rgx_audio #embedded content - @ec[:multimedia] << para.scan(@rgx_mm).uniq if para =~@rgx_mm #embedded content - unless @sem_tag - @sem_tag=true if para=~/[:;]\{.+?\}[:;][a-z+]/ #refix later + if @home_button_image \ + and @home_button_image.is_a?(Hash) \ + and (@home_button_image =~@rgx_image \ + or @home_button_image =~/\S+?\.(?:jpg|png|gif)/) + @ec[:image] << @home_button_image end - end #% here endeth the document loop - unless @make - if (@opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - '@make:', - 'header absent' - ).warn + if @ec[:image].length > 0 + @ec[:image]=@ec[:image].flatten.uniq + @ec[:image].delete_if {|x| x =~/https?:\/\// } + @ec[:image]=@ec[:image].sort end - @make=SiSU_Param::Parameters::MdMake.new('@make: ',@opt,@env).make - end - if @cover_image \ - and @cover_image.is_a?(Hash) \ - and (@cover_image[:cover] =~@rgx_image \ - or @cover_image[:cover] =~/\S+?.(?:jpg|png|gif)/) - @ec[:image] << @cover_image[:cover] - end - if @home_button_image \ - and @home_button_image.is_a?(Hash) \ - and (@home_button_image =~@rgx_image \ - or @home_button_image =~/\S+?\.(?:jpg|png|gif)/) - @ec[:image] << @home_button_image - end - if @ec[:image].length > 0 - @ec[:image]=@ec[:image].flatten.uniq - @ec[:image].delete_if {|x| x =~/https?:\/\// } - @ec[:image]=@ec[:image].sort - end - @ec[:audio]=@ec[:audio].uniq.flatten.sort - @ec[:multimedia]=@ec[:multimedia].uniq.flatten.sort - unless @rights - if defined? @creator.author \ - and @creator.author.is_a?(String) \ - and defined? @date.published \ - and @date.published.is_a?(String) - @rights=SiSU_Param::Parameters::MdDefault.new.rights(@creator.author,@date.published) - elsif defined? @creator.author \ - and @creator.author.is_a?(String) - @rights=SiSU_Param::Parameters::MdDefault.new.rights("[#{@creator.author}]",'') + @ec[:audio]=@ec[:audio].uniq.flatten.sort + @ec[:multimedia]=@ec[:multimedia].uniq.flatten.sort + unless @rights + if defined? @creator.author \ + and @creator.author.is_a?(String) \ + and defined? @date.published \ + and @date.published.is_a?(String) + @rights=SiSU_Param::Parameters::MdDefault.new.rights(@creator.author,@date.published) + elsif defined? @creator.author \ + and @creator.author.is_a?(String) + @rights=SiSU_Param::Parameters::MdDefault.new.rights("[#{@creator.author}]",'') + end end - end - if defined? @classify.topic_register \ - and @classify.topic_register.is_a?(String) \ - and @classify.topic_register.length >3 - topic_register=@classify.topic_register - u=topic_register.scan(/[^;]+/m).sort - v=[] - u.each do |l| - v << l.scan(/[^:]+/m) - end - v.each do |s| - s[-1]=s[-1].scan(/[^|]+/m) if s[-1] =~/[|]/m - @topic_register_array << s - end - @topic_register_array - end - if @i18n - @i18n=@i18n.uniq - @i18n << 'en' unless @i18n.find_index("en") - else - @i18n=[ 'en' ] - end - translated=[] - translate_list=[@pagenew,@pagebreak,@pageline,@num_top,@toc_lev_limit] - translate_list.each do |t| - translate=t.to_s if t - translated << if translate - translate.gsub!(/3/,'6') - translate.gsub!(/2/,'5') - translate.gsub!(/1/,'4') - translate.gsub!(/:?C/,'3') - translate.gsub!(/:?B/,'2') - translate.gsub!(/:?A/,'1') - # looks like an ok substituion for the above but is not, causes problems, check why - #translate=translate.gsub(/3/,'6'). - # gsub(/2/,'5'). - # gsub(/1/,'4'). - # gsub(/:?C/,'3'). - # gsub(/:?B/,'2'). - # gsub(/:?A/,'1') - translate=(translate =~/^\d+$/) \ - ? translate.to_i - : translate - else nil + if defined? @classify.topic_register \ + and @classify.topic_register.is_a?(String) \ + and @classify.topic_register.length >3 + topic_register=@classify.topic_register + u=topic_register.scan(/[^;]+/m).sort + v=[] + u.each do |l| + v << l.scan(/[^:]+/m) + end + v.each do |s| + s[-1]=s[-1].scan(/[^|]+/m) if s[-1] =~/[|]/m + @topic_register_array << s + end + @topic_register_array end - end - @pagenew,@pagebreak,@pageline,@num_top,@toc_lev_limit=translated - @markup=@markup.gsub(/page_new\s*=\s*([\dA-C])/,"page_new=#{@pagenew}"). - gsub(/page_break\s*=\s*([\dA-C])/,"page_break=#{@pagebreak}"). - gsub(/page_line\s*=\s*([\dA-C])/,"page_line=#{@pageline}"). - gsub(/num_top\s*=\s*([\dA-C])/,"num_top=#{@num_top}"). - gsub(/toc_lev_limit\s*=\s*([\dA-C])/,"toc_lev_limit=#{@toc_lev_limit}") - papersize_array_rc=@papersize.downcase.scan(/(?:a4|letter|legal|book|a5|b5)/) - papersize_array_opt=[ - ((@opt.act[:pdf_a4][:set]==:on) ? 'a4' : ''), - ((@opt.act[:pdf_a5][:set]==:on) ? 'a5' : ''), - ((@opt.act[:pdf_b5][:set]==:on) ? 'b5' : ''), - ((@opt.act[:pdf_letter][:set]==:on) ? 'letter' : ''), - ((@opt.act[:pdf_legal][:set]==:on) ? 'legal' : ''), - ] - [""] - @papersize_array=(papersize_array_opt.length > 0) \ - ? papersize_array_opt - : papersize_array_rc - fn=@opt.fno #decide what to do a filesize on .ssm tells very little about actual document size - @filesize=(File.size(fn)).to_s - if @sys.openssl !=false \ - and FileTest.file?(@env.source_file_with_path) - @dgst=[] - case @env.digest(@opt).type - when :sha512 - dgst=@sys.sha512(@env.source_file_with_path) - @dgst=dgst[1].length==128 ? dgst : nil - puts 'check document (sha512) digest' if not @dgst - when :sha256 - dgst=@sys.sha256(@env.source_file_with_path) - @dgst=dgst[1].length==64 ? dgst : nil - puts 'check document (sha256) digest' if not @dgst - when :md5 - dgst=@sys.md5(@env.source_file_with_path) - @dgst=dgst[1].length==32 ? dgst : nil - puts 'check document (md5) digest' if not @dgst + if @i18n + @i18n=@i18n.uniq + @i18n << 'en' unless @i18n.find_index("en") else - dgst=@sys.sha256(@env.source_file_with_path) - @dgst=dgst[1].length==64 ? dgst : nil - puts 'check document (sha256) digest' if not @dgst + @i18n=[ 'en' ] end - elsif not FileTest.file?(@env.source_file_with_path) - #puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) - end - @publisher ||= "#{@@publisher} (this copy)" - fn_set_lang=SiSU_Env::StandardiseLanguage.new(@opt.lng).language - unless @language[:code] \ - and @language[:name] - lang=@env.i18n.language #default language settings for directory by name, or in sysrc.yml - @language[:code] ||= lang.code - @language[:name] ||= lang.title - end - unless fn_set_lang[:d]==true #decide, naming convention overrides other settings, within document, etc. - @language[:code]=fn_set_lang[:c] - @language[:name]=fn_set_lang[:n] - end - @fnl=@env.i18n.lang_filename(fn_set_lang[:c]) - @lang=@lang.uniq - @fn=SiSU_Env::EnvCall.new(@fns).lang(fn_set_lang[:c]) - if @en[:note] > 0 \ - and @en[:sum] > 0 - if @en[:sum] > 0 - else - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - '*WARN* both endnote styles used', - "~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}" - ).warn unless @opt.act[:quiet][:set]==:on + translated=[] + translate_list=[@pagenew,@pagebreak,@pageline,@num_top,@toc_lev_limit] + translate_list.each do |t| + translate=t.to_s if t + translated << if translate + translate.gsub!(/3/,'6') + translate.gsub!(/2/,'5') + translate.gsub!(/1/,'4') + translate.gsub!(/:?C/,'3') + translate.gsub!(/:?B/,'2') + translate.gsub!(/:?A/,'1') + # looks like an ok substituion for the above but is not, causes problems, check why + #translate=translate.gsub(/3/,'6'). + # gsub(/2/,'5'). + # gsub(/1/,'4'). + # gsub(/:?C/,'3'). + # gsub(/:?B/,'2'). + # gsub(/:?A/,'1') + translate=(translate =~/^\d+$/) \ + ? translate.to_i + : translate + else nil + end end - end - if @en[:mark] != @en[:note] \ - and @en[:note] > 0 - @en[:mismatch]=@en[:note] - @en[:mark] - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - '*WARN* endnote number mismatch', - "endnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})" - ).warn unless @opt.act[:quiet][:set]==:on - footnote_conversion_errors=File.new("#{Dir.pwd}/footnote_conversion_errors.txt",'a') - footnote_conversion_errors << - "#{@fns}:\n\tendnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})\n" - end - if not @title \ - or not defined? @title.main \ - or @title.main !~/[\S]/ - if @fns =~/\.ssm$/ \ - and @opt.inspect =~/P/ - #@title=Md.new('Text Insert',@opt,@env).title - else - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - 'WARNING: Document Title missing', - 'please provide @title:' - ).warn unless @opt.act[:quiet][:set]==:on + @pagenew,@pagebreak,@pageline,@num_top,@toc_lev_limit=translated + @markup=@markup.gsub(/page_new\s*=\s*([\dA-C])/,"page_new=#{@pagenew}"). + gsub(/page_break\s*=\s*([\dA-C])/,"page_break=#{@pagebreak}"). + gsub(/page_line\s*=\s*([\dA-C])/,"page_line=#{@pageline}"). + gsub(/num_top\s*=\s*([\dA-C])/,"num_top=#{@num_top}"). + gsub(/toc_lev_limit\s*=\s*([\dA-C])/,"toc_lev_limit=#{@toc_lev_limit}") + papersize_array_rc=@papersize.downcase.scan(/(?:a4|letter|legal|book|a5|b5)/) + papersize_array_opt=[ + ((@opt.act[:pdf_a4][:set]==:on) ? 'a4' : ''), + ((@opt.act[:pdf_a5][:set]==:on) ? 'a5' : ''), + ((@opt.act[:pdf_b5][:set]==:on) ? 'b5' : ''), + ((@opt.act[:pdf_letter][:set]==:on) ? 'letter' : ''), + ((@opt.act[:pdf_legal][:set]==:on) ? 'legal' : ''), + ] - [""] + @papersize_array=(papersize_array_opt.length > 0) \ + ? papersize_array_opt + : papersize_array_rc + fn=@opt.fno #decide what to do a filesize on .ssm tells very little about actual document size + @filesize=(File.size(fn)).to_s + if @sys.openssl !=false \ + and FileTest.file?(@env.source_file_with_path) + @dgst=[] + case @env.digest(@opt).type + when :sha512 + dgst=@sys.sha512(@env.source_file_with_path) + @dgst=dgst[1].length==128 ? dgst : nil + puts 'check document (sha512) digest' if not @dgst + when :sha256 + dgst=@sys.sha256(@env.source_file_with_path) + @dgst=dgst[1].length==64 ? dgst : nil + puts 'check document (sha256) digest' if not @dgst + when :md5 + dgst=@sys.md5(@env.source_file_with_path) + @dgst=dgst[1].length==32 ? dgst : nil + puts 'check document (md5) digest' if not @dgst + else + dgst=@sys.sha256(@env.source_file_with_path) + @dgst=dgst[1].length==64 ? dgst : nil + puts 'check document (sha256) digest' if not @dgst + end + elsif not FileTest.file?(@env.source_file_with_path) + #puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) end - end - if @author !~/[\S]/ - if @fns =~/\.ssm$/ \ - and @opt.inspect =~/P/ - #@creator=SiSU_Param::Md.new('Text Insert',@opt,@env).creator - else + @publisher ||= "#{@@publisher} (this copy)" + fn_set_lang=SiSU_Env::StandardiseLanguage.new(@opt.lng).language + unless @language[:code] \ + and @language[:name] + lang=@env.i18n.language #default language settings for directory by name, or in sysrc.yml + @language[:code] ||= lang.code + @language[:name] ||= lang.title + end + unless fn_set_lang[:d]==true #decide, naming convention overrides other settings, within document, etc. + @language[:code]=fn_set_lang[:c] + @language[:name]=fn_set_lang[:n] + end + @fnl=@env.i18n.lang_filename(fn_set_lang[:c]) + @lang=@lang.uniq + @fn=SiSU_Env::EnvCall.new(@fns).lang(fn_set_lang[:c]) + if @en[:note] > 0 \ + and @en[:sum] > 0 + if @en[:sum] > 0 + else + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + '*WARN* both endnote styles used', + "~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}" + ).warn unless @opt.act[:quiet][:set]==:on + end + end + if @en[:mark] != @en[:note] \ + and @en[:note] > 0 + @en[:mismatch]=@en[:note] - @en[:mark] SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], - 'WARNING: Document Author missing', - 'please provide @creator: :author:' + '*WARN* endnote number mismatch', + "endnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})" ).warn unless @opt.act[:quiet][:set]==:on + footnote_conversion_errors=File.new("#{Dir.pwd}/footnote_conversion_errors.txt",'a') + footnote_conversion_errors << + "#{@fns}:\n\tendnotes: #{@en[:note]} != endnote reference marks: #{@en[:mark]} (difference = #{@en[:mismatch]})\n" end - end - @struct={} - doc_struct=Hash.new(0) - if @lv1.nil? - fns_array.each do |para| - if para =~/^(Part|Chapter|Section|Article)\b/i - case para - when /^(Part|PART)\b/ - @struct[:part]=doc_struct[:part] - doc_struct[:part]=doc_struct[:part] + 1 - when /^(Chapter|CHAPTER)\b/ - @struct[:chapter]=doc_struct[:chapter] - doc_struct[:chapter]=doc_struct[:chapter] + 1 - when /^(Section|SECTION)\b/ - @struct[:section]=doc_struct[:section] - doc_struct[:section]=doc_struct[:section] + 1 - when /^(Article|ARTICLE)\b/ - @struct[:article]=doc_struct[:article] - doc_struct[:article]=doc_struct[:article] + 1 - when /^(Clause|CLAUSE)\b/ - @struct[:clause]=doc_struct[:clause] - doc_struct[:clause]=doc_struct[:clause] + 1 - when /^\d\..*[^\.]$/ - @struct[:number]=doc_struct[:number] - doc_struct[:number]=doc_struct[:number] + 1 - end + if not @title \ + or not defined? @title.main \ + or @title.main !~/[\S]/ + if @fns =~/\.ssm$/ \ + and @opt.inspect =~/P/ + #@title=Md.new('Text Insert',@opt,@env).title + else + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'WARNING: Document Title missing', + 'please provide @title:' + ).warn unless @opt.act[:quiet][:set]==:on end end - if doc_struct[:article] > 2 #%~level 4 - @lv4=/^(?:Article|ARTICLE)\b/ - elsif doc_struct[:chapter] > 2 \ - and doc_struct[:article] \ - and doc_struct[:article] < 3 - @lv4=/^(?:Chapter|CHAPTER)\b/ - elsif doc_struct[:clause] > 2 - @lv4=/^(?:Clause|CLAUSE)\b/ - elsif doc_struct[:number] > 2 - @lv4="^\d\..*[^\.]$" - end - if doc_struct[:section] > 2 #%~level 3 - @lv3=/^(?:Section|SECTION)\b/ - end - if doc_struct[:chapter] > 2 \ - and doc_struct[:article] \ - and doc_struct[:article] > 2 - @lv2=/^(?:Chapter|CHAPTER)\b/ + if @author !~/[\S]/ + if @fns =~/\.ssm$/ \ + and @opt.inspect =~/P/ + #@creator=SiSU_Param::Md.new('Text Insert',@opt,@env).creator + else + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'WARNING: Document Author missing', + 'please provide @creator: :author:' + ).warn unless @opt.act[:quiet][:set]==:on + end end - if doc_struct[:part] > 2 \ - and @lv[2].nil? - @lv2=/^(?:Part|PART)\b/ + @struct={} + doc_struct=Hash.new(0) + if @lv1.nil? + fns_array.each do |para| + if para =~/^(Part|Chapter|Section|Article)\b/i + case para + when /^(Part|PART)\b/ + @struct[:part]=doc_struct[:part] + doc_struct[:part]=doc_struct[:part] + 1 + when /^(Chapter|CHAPTER)\b/ + @struct[:chapter]=doc_struct[:chapter] + doc_struct[:chapter]=doc_struct[:chapter] + 1 + when /^(Section|SECTION)\b/ + @struct[:section]=doc_struct[:section] + doc_struct[:section]=doc_struct[:section] + 1 + when /^(Article|ARTICLE)\b/ + @struct[:article]=doc_struct[:article] + doc_struct[:article]=doc_struct[:article] + 1 + when /^(Clause|CLAUSE)\b/ + @struct[:clause]=doc_struct[:clause] + doc_struct[:clause]=doc_struct[:clause] + 1 + when /^\d\..*[^\.]$/ + @struct[:number]=doc_struct[:number] + doc_struct[:number]=doc_struct[:number] + 1 + end + end + end + if doc_struct[:article] > 2 #%~level 4 + @lv4=/^(?:Article|ARTICLE)\b/ + elsif doc_struct[:chapter] > 2 \ + and doc_struct[:article] \ + and doc_struct[:article] < 3 + @lv4=/^(?:Chapter|CHAPTER)\b/ + elsif doc_struct[:clause] > 2 + @lv4=/^(?:Clause|CLAUSE)\b/ + elsif doc_struct[:number] > 2 + @lv4="^\d\..*[^\.]$" + end + if doc_struct[:section] > 2 #%~level 3 + @lv3=/^(?:Section|SECTION)\b/ + end + if doc_struct[:chapter] > 2 \ + and doc_struct[:article] \ + and doc_struct[:article] > 2 + @lv2=/^(?:Chapter|CHAPTER)\b/ + end + if doc_struct[:part] > 2 \ + and @lv[2].nil? + @lv2=/^(?:Part|PART)\b/ + end + if doc_struct[:part] > 2 \ + and @lv[2].inspect !~/Part/ \ + and @lv[1].nil? + @lv1=/^(Part|PART)\b/ + end end - if doc_struct[:part] > 2 \ - and @lv[2].inspect !~/Part/ \ - and @lv[1].nil? - @lv1=/^(Part|PART)\b/ + @lnk=@lnk.compact if @lnk + @lv0 ||=/^0~/ + @lv1 ||=/^1~/ + @lv2 ||=/^2~/ + @lv3 ||=/^3~/ + @lv4 ||=/^4~/ + @lv5 ||=/^5~/ + @lv6 ||=/^6~/ + @data=nil #else whole file's contents are stored in md pstore & is not required to be... big waste actually + @file=SiSU_Env::FileOp.new(self) #watch + Store.new(self,@env).store #% pstore + self + rescue + if @opt.act[:harvest][:set]==:on + exit end end - @lnk=@lnk.compact if @lnk - @lv0 ||=/^0~/ - @lv1 ||=/^1~/ - @lv2 ||=/^2~/ - @lv3 ||=/^3~/ - @lv4 ||=/^4~/ - @lv5 ||=/^5~/ - @lv6 ||=/^6~/ - @data=nil #else whole file's contents are stored in md pstore & is not required to be... big waste actually - @file=SiSU_Env::FileOp.new(self) #watch - Store.new(self,@env).store #% pstore - self end private class Store @@ -1507,7 +1512,7 @@ module SiSU_Param end @@md=@md=nil rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/param_identify_markup.rb b/lib/sisu/v6/dp_identify_markup.rb index 87879e79..0281832a 100644 --- a/lib/sisu/v6/param_identify_markup.rb +++ b/lib/sisu/v6/dp_identify_markup.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/param_identify_markup.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/dp_identify_markup.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> diff --git a/lib/sisu/v6/param_make.rb b/lib/sisu/v6/dp_make.rb index 50c9551d..0dacd517 100644 --- a/lib/sisu/v6/param_make.rb +++ b/lib/sisu/v6/dp_make.rb @@ -51,13 +51,13 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/param_make.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/dp_make.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> <ralph.amissah@gmail.com> - ** Description: make parameters extracted for program use + ** Description: document parameters make extracted for program use =end diff --git a/lib/sisu/v6/embedded.rb b/lib/sisu/v6/embedded.rb index cf294891..47a6c62b 100644 --- a/lib/sisu/v6/embedded.rb +++ b/lib/sisu/v6/embedded.rb @@ -61,9 +61,9 @@ =end module SiSU_Embedded - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source def initialize(opt) @@ -83,7 +83,7 @@ module SiSU_Embedded multimedia begin rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -103,7 +103,7 @@ module SiSU_Embedded src_ec=@f.place_file.images.rel + '/' + @md.ec[:image].join(" #{@f.output_path.images.rel}/") unless @opt.fns =~/\.-sst$/ SiSU_Env::SystemCall.new(src_ec,ldest,'q').rsync('--relative',@opt.base_path) - #if @md.opt.cmd.inspect =~/R/ #rsync to remote image directory + #if @md.opt.selections.str.inspect =~/R/ #rsync to remote image directory # SiSU_Env::SystemCall.new(src_ec,remote_rel,'q').rsync('--relative') #end end diff --git a/lib/sisu/v6/errors.rb b/lib/sisu/v6/errors.rb index fb5117ec..4fb18f4e 100644 --- a/lib/sisu/v6/errors.rb +++ b/lib/sisu/v6/errors.rb @@ -61,7 +61,7 @@ =end module SiSU_Errors - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen class Rescued <CreateFile def initialize(error,errorlist,cmd,fns='') diff --git a/lib/sisu/v6/git.rb b/lib/sisu/v6/git.rb index d58ae566..80601b53 100644 --- a/lib/sisu/v6/git.rb +++ b/lib/sisu/v6/git.rb @@ -61,8 +61,8 @@ =end module SiSU_Git - require_relative 'param' # param.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'dp' # dp.rb + require_relative 'se' # se.rb require_relative 'ao' # ao.rb class Source def initialize(opt) diff --git a/lib/sisu/v6/harvest.rb b/lib/sisu/v6/harvest.rb index be0efe1a..f32480fe 100644 --- a/lib/sisu/v6/harvest.rb +++ b/lib/sisu/v6/harvest.rb @@ -65,10 +65,10 @@ module SiSU_Harvest @@the_idx_topics,@@the_idx_authors={},{} class Source - require_relative 'options' # options.rb + require_relative 'hub_options' # hub_options.rb require_relative 'harvest_topics' # harvest_topics.rb require_relative 'harvest_authors' # harvest_authors.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env def initialize(opt) @opt=opt @@ -76,7 +76,7 @@ module SiSU_Harvest end def read begin - harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}" + harvest_pth=@env.path.webserv + '/' + @opt.base_stub FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth) cases(@opt,@env) rescue @@ -99,7 +99,7 @@ WOK style.close end def cases(opt,env) - case opt.mod.inspect + case opt.selections.str.inspect when/--harvest/i css(opt) if @opt.act[:maintenance][:set]==:on SiSU_HarvestAuthors::Songsheet.new(opt,env).songsheet diff --git a/lib/sisu/v6/author_format.rb b/lib/sisu/v6/harvest_author_format.rb index 7b791bd7..7b889971 100644 --- a/lib/sisu/v6/author_format.rb +++ b/lib/sisu/v6/harvest_author_format.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/author_format.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/harvest_author_format.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> diff --git a/lib/sisu/v6/harvest_authors.rb b/lib/sisu/v6/harvest_authors.rb index c84634b5..762545c6 100644 --- a/lib/sisu/v6/harvest_authors.rb +++ b/lib/sisu/v6/harvest_authors.rb @@ -62,7 +62,7 @@ =end module SiSU_HarvestAuthors - require_relative 'author_format' # author_format.rb + require_relative 'harvest_author_format' # harvest_author_format.rb class Songsheet @@the_idx_authors={} def initialize(opt,env) @@ -88,20 +88,36 @@ module SiSU_HarvestAuthors end lang_hash_file_array.each_pair do |lang,a| idx_array[lang] ||= [] - idx_array=SiSU_HarvestAuthors::Harvest.new(@opt,@env,a,filename,name,idx_array,lang).extract_harvest + idx_array=SiSU_HarvestAuthors::Harvest.new( + @opt, + @env, + a, + filename, + name, + idx_array, + lang + ).extract_harvest end end - the_idx=SiSU_HarvestAuthors::Index.new(idx_array,@@the_idx_authors).construct_book_author_index - SiSU_HarvestAuthors::OutputIndex.new(@opt,the_idx).html_print.html_songsheet + the_idx=SiSU_HarvestAuthors::Index.new( + idx_array, + @@the_idx_authors + ).construct_book_author_index + SiSU_HarvestAuthors::OutputIndex.new( + @opt, + the_idx + ).html_print.html_songsheet end end class Harvest def initialize(opt,env,data,filename,name,idx_array,lang) - @opt,@env,@data,@filename,@name,@idx_array,@lang=opt,env,data,filename,name,idx_array,lang + @opt, @env,@data,@filename,@name,@idx_array,@lang= + opt,env, data, filename, name, idx_array, lang end def extract_harvest - data,filename,name,idx_array,lang=@data,@filename,@name,@idx_array,@lang - @title,@subtitle,@fulltitle,@author,@author_format,@date=nil,nil,nil,nil,nil,nil + data, filename, name, idx_array, lang = + @data,@filename,@name,@idx_array,@lang + @title=@subtitle=@fulltitle=@author=@author_format=@date=nil @authors=[] rgx={} rgx[:author]=/^@creator:(?:[ ]+|.+?:author:[ ]+)(.+?)(?:\||\n)/m @@ -123,7 +139,9 @@ module SiSU_HarvestAuthors end break if @title && @subtitle && @author && @date end - @fulltitle=@subtitle ? (@title + ' - ' + @subtitle) : @title + @fulltitle=@subtitle \ + ? (@title + ' - ' + @subtitle) + : @title if @title \ and @author_format creator=SiSU_FormatAuthor::Author.new(@author_format.strip).author_details @@ -138,7 +156,15 @@ module SiSU_HarvestAuthors else "sisu_manifest.#{lang}.html" end - idx_array[lang] <<= { filename: filename, file: file, date: @date, title: @fulltitle, author: creator, page: page, lang: lang } + idx_array[lang] <<= { + filename: filename, + file: file, + date: @date, + title: @fulltitle, + author: creator, + page: page, + lang: lang + } else #p "missing author field: #{@filename} title: #{@title}; author: #{@author_format}" end @@ -164,7 +190,15 @@ module SiSU_HarvestAuthors if @@the_idx_authors[lang][author].is_a?(NilClass) @@the_idx_authors[lang][author]={ md: [] } end - @@the_idx_authors[lang][author][:md] << { filename: idx[:filename], file: idx[:file], author: idx[:author], title: idx[:title], date: idx[:date], page: idx[:page], lang: idx[:lang] } + @@the_idx_authors[lang][author][:md] << { + filename: idx[:filename], + file: idx[:file], + author: idx[:author], + title: idx[:title], + date: idx[:date], + page: idx[:page], + lang: idx[:lang] + } end end end @@ -188,18 +222,26 @@ module SiSU_HarvestAuthors @output[lng] ||={} harvest_pth,file='','' if @env.output_dir_structure.by? == :language - harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}/#{lng}/manifest" + harvest_pth=@env.path.webserv + '/' \ + + @opt.base_stub + '/' \ + + lng + '/' \ + + 'manifest' file="#{harvest_pth}/authors.html" elsif @env.output_dir_structure.by? == :filetype - harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}/manifest" + harvest_pth=@env.path.webserv + '/' \ + + @opt.base_stub + '/' \ + + 'manifest' file="#{harvest_pth}/authors.#{lng}.html" elsif @env.output_dir_structure.by? == :filename - harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}" + harvest_pth=@env.path.webserv + '/' \ + + @opt.base_stub file="#{harvest_pth}/authors.#{lng}.html" end - FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth) + FileUtils::mkdir_p(harvest_pth) \ + unless FileTest.directory?(harvest_pth) fileinfo=(@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:urls_selected][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ ? ("file://#{file}") : '' SiSU_Screen::Ansi.new( @@ -213,7 +255,8 @@ module SiSU_HarvestAuthors def html_file_close @the_idx.keys.each do |lng| @output[lng][:html].close - @output[lng][:html_mnt].close if @output[lng][:html_mnt].is_a?(File) + @output[lng][:html_mnt].close \ + if @output[lng][:html_mnt].is_a?(File) end end def html_print @@ -257,18 +300,22 @@ module SiSU_HarvestAuthors file="#{harvest_pth}/authors.#{lg}.html" end l=ln[lg][:t] - harvest_languages += %{<a href="#{file}">#{l}</a> } + harvest_languages += + %{<a href="#{file}">#{l}</a> } end sv=SiSU_Env::InfoVersion.instance.get_version if @env.output_dir_structure.by? == :language home_pth='../..' - output_structure_by='(output organised by language & filetype)' + output_structure_by= + '(output organised by language & filetype)' elsif @env.output_dir_structure.by? == :filetype home_pth='..' - output_structure_by='(output organised by filetype)' + output_structure_by= + '(output organised by filetype)' elsif @env.output_dir_structure.by? == :filename home_pth='.' - output_structure_by='(output organised by filename)' + output_structure_by= + '(output organised by filename)' else home_pth='.' output_structure_by='(output organised by ?)' @@ -301,8 +348,11 @@ WOK end def html_head @the_idx.keys.each do |lng| - @output[lng][:html_mnt] << html_head_adjust(lng,'maintenance') if @opt.act[:maintenance][:set]==:on - @output[lng][:html] << html_head_adjust(lng) + @output[lng][:html_mnt] \ + << html_head_adjust(lng,'maintenance') \ + if @opt.act[:maintenance][:set]==:on + @output[lng][:html] \ + << html_head_adjust(lng) end end def html_alph @@ -315,7 +365,8 @@ WOK end a=a.join @the_idx.keys.each do |lng| - @output[lng][:html_mnt] << a if @opt.act[:maintenance][:set]==:on + @output[lng][:html_mnt] << a \ + if @opt.act[:maintenance][:set]==:on @output[lng][:html] << a end end @@ -333,12 +384,14 @@ WOK </html> WOK @the_idx.keys.each do |lng| - @output[lng][:html_mnt] << a if @output[lng][:html_mnt].is_a?(File) + @output[lng][:html_mnt] << a \ + if @output[lng][:html_mnt].is_a?(File) @output[lng][:html] << a end end def do_html(lng,html) - @output[lng][:html_mnt] << html if @output[lng][:html_mnt].is_a?(File) + @output[lng][:html_mnt] << html \ + if @output[lng][:html_mnt].is_a?(File) @output[lng][:html] << html end def do_string_name(lng,attrib,string) @@ -353,9 +406,11 @@ WOK if @alph.length > 0 @letter=@alph.shift if @output[lng][:html_mnt].is_a?(File) - @output[lng][:html_mnt] << %{\n<p class="letter"><a name="#{@letter}"></p>#{@letter}</a><p class="book_index_lev1"><a name="#{@letter.downcase}"></a></p>} + @output[lng][:html_mnt] \ + << %{\n<p class="letter"><a name="#{@letter}"></p>#{@letter}</a><p class="book_index_lev1"><a name="#{@letter.downcase}"></a></p>} end - @output[lng][:html] << %{\n<p class="letter"><a name="#{@letter}">#{@letter}</a></p><p class="book_index_lev1"><a name="#{@letter.downcase}"></a></p>} + @output[lng][:html] \ + << %{\n<p class="letter"><a name="#{@letter}">#{@letter}</a></p><p class="book_index_lev1"><a name="#{@letter.downcase}"></a></p>} else break end end @@ -383,14 +438,18 @@ WOK "./#{i[:file]}/#{i[:page]}" else '' #error end - work=[ "#{i[:date]} #{i[:title]}", %{<p class="publication">#{i[:date]} <a href="#{manifest_at}">#{i[:title]}</a>, #{i[:author][:authors_s]}</p>} ] + work=[ + "#{i[:date]} #{i[:title]}", + %{<p class="publication">#{i[:date]} <a href="#{manifest_at}">#{i[:title]}</a>, #{i[:author][:authors_s]}</p>} + ] works<<=(@output[lng][:html_mnt].is_a?(File)) \ ? (work.concat([%{<p class="publication">[<a href="#{i[:file]}.sst">src</a>] #{i[:date]} <a href="file://#{manifest_at}">#{i[:title]}</a>, #{i[:author][:authors_s]} -- [<a href="#{i[:file]}.sst">#{i[:file]}.sst</a>]</p>}])) : work end works.sort_by {|y| y[0]}.each do |z| @output[lng][:html] << z[1] - @output[lng][:html_mnt] << z[2] if @output[lng][:html_mnt].is_a?(File) + @output[lng][:html_mnt] << z[2] \ + if @output[lng][:html_mnt].is_a?(File) end end end diff --git a/lib/sisu/v6/harvest_topics.rb b/lib/sisu/v6/harvest_topics.rb index e17b8424..2aa3f6b2 100644 --- a/lib/sisu/v6/harvest_topics.rb +++ b/lib/sisu/v6/harvest_topics.rb @@ -63,7 +63,7 @@ =end module SiSU_HarvestTopics - require_relative 'author_format' # author_format.rb + require_relative 'harvest_author_format' # harvest_author_format.rb include SiSU_Viz class Songsheet @@the_idx_topics={} @@ -90,11 +90,27 @@ module SiSU_HarvestTopics end lang_hash_file_array.each_pair do |lang,a| idx_array[lang] ||=[] - idx_array=SiSU_HarvestTopics::Harvest.new(@opt,@env,a,filename,name,idx_array,lang).extract_harvest + idx_array=SiSU_HarvestTopics::Harvest.new( + @opt, + @env, + a, + filename, + name, + idx_array, + lang + ).extract_harvest end end - the_hash=SiSU_HarvestTopics::Index.new(@opt,@env,idx_array,@@the_idx_topics).song - SiSU_HarvestTopics::OutputIndex.new(@opt,the_hash).html_print.html_songsheet + the_hash=SiSU_HarvestTopics::Index.new( + @opt, + @env, + idx_array, + @@the_idx_topics + ).song + SiSU_HarvestTopics::OutputIndex.new( + @opt, + the_hash + ).html_print.html_songsheet end end class Mix @@ -104,11 +120,13 @@ module SiSU_HarvestTopics end class Harvest def initialize(opt,env,data,filename,name,idx_array,lang) - @opt,@env,@data,@filename,@name,@idx_array,@lang=opt,env,data,filename,name,idx_array,lang + @opt, @env,@data,@filename,@name,@idx_array,@lang= + opt,env, data, filename, name, idx_array, lang end def extract_harvest - data,filename,name,idx_array,lang=@data,@filename,@name,@idx_array,@lang - @idx_lst,@title,@subtitle,@fulltitle,@author,@author_format=nil,nil,nil,nil,nil,nil + data, filename, name, idx_array, lang= + @data,@filename,@name,@idx_array,@lang + @idx_lst=@title=@subtitle=@fulltitle=@author=@author_format=nil rgx={} rgx[:author]=/^@creator:(?:[ ]+|.+?:author:[ ]+)(.+?)(?:\||\n)/m rgx[:title]=/^@title:[ ]+(.+)/ @@ -150,10 +168,26 @@ module SiSU_HarvestTopics idxl=[] g.each do |i| i=i.strip - idxl << { filename: filename, file: file, rough_idx: i, title: @fulltitle, author: creator, page: page, lang: lang } + idxl << { + filename: filename, + file: file, + rough_idx: i, + title: @fulltitle, + author: creator, + page: page, + lang: lang + } end idxl - else { filename: filename, file: file, rough_idx: @idx_list, title: @fulltitle, author: creator, page: page, lang: lang } + else { + filename: filename, + file: file, + rough_idx: @idx_list, + title: @fulltitle, + author: creator, + page: page, + lang: lang, + } end else if (@opt.act[:verbose_plus][:set]==:on \ @@ -167,7 +201,8 @@ module SiSU_HarvestTopics end class Index < Mix def initialize(opt,env,idx_array,the_idx) - @opt,@env,@idx_array,@the_idx=opt,env,idx_array,the_idx + @opt, @env,@idx_array,@the_idx= + opt,env, idx_array, the_idx @@the_idx_topics=@the_idx end def song @@ -195,7 +230,13 @@ module SiSU_HarvestTopics names += %{<a href="authors.#{lang}.html##{s}">#{n}</a>, } end end - { filename: idx[:filename], file: idx[:file], author: names, title: idx[:title], page: idx[:page] } + { + filename: idx[:filename], + file: idx[:file], + author: names, + title: idx[:title], + page: idx[:page] + } end def capital_(txt) txt[0].chr.capitalize + txt[1,txt.length] @@ -471,18 +512,26 @@ module SiSU_HarvestTopics @output[lng] ||={} harvest_pth,file='','' if @env.output_dir_structure.by? == :language - harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}/#{lng}/manifest" - file="#{harvest_pth}/topics.html" + harvest_pth=@env.path.webserv + '/' \ + + @opt.base_stub + '/' \ + + lng + '/' \ + + 'manifest' + file=harvest_pth + '/' + 'topics.html' elsif @env.output_dir_structure.by? == :filetype - harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}/manifest" - file="#{harvest_pth}/topics.#{lng}.html" + harvest_pth=@env.path.webserv + '/' \ + + @opt.base_stub + '/' \ + + 'manifest' + file=harvest_pth + '/' + 'topics.' + lng + '.html' elsif @env.output_dir_structure.by? == :filename - harvest_pth="#{@env.path.webserv}/#{@opt.base_stub}" - file="#{harvest_pth}/topics.#{lng}.html" + harvest_pth=@env.path.webserv + '/' \ + + @opt.base_stub + file=harvest_pth + '/' + 'topics.' + lng + '.html' end - FileUtils::mkdir_p(harvest_pth) unless FileTest.directory?(harvest_pth) + FileUtils::mkdir_p(harvest_pth) \ + unless FileTest.directory?(harvest_pth) fileinfo=(@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:urls_selected][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ ? ("file://#{file}") : '' @@ -615,16 +664,17 @@ module SiSU_HarvestTopics @the_idx.keys.each do |lg| if @env.output_dir_structure.by? == :language harvest_pth="../../#{lg}/manifest" - file="#{harvest_pth}/topics.html" + file=harvest_pth + '/' + 'topics.html' elsif @env.output_dir_structure.by? == :filetype harvest_pth='.' - file="#{harvest_pth}/topics.#{lg}.html" + file=harvest_pth + '/' + 'topics.' + lg + '.html' elsif @env.output_dir_structure.by? == :filename harvest_pth='.' - file="#{harvest_pth}/topics.#{lg}.html" + file=harvest_pth + '/topics.' + lg + '.html' end l=ln[lg][:t] - harvest_languages += %{<a href="#{file}">#{l}</a> } + harvest_languages += + %{<a href="#{file}">#{l}</a> } end sv=SiSU_Env::InfoVersion.instance.get_version if @env.output_dir_structure.by? == :language @@ -668,7 +718,9 @@ WOK end def html_head @the_idx.keys.each do |lng| - @output[lng][:html_mnt] << html_head_adjust(lng,'maintenance') if @opt.act[:maintenance][:set]==:on + @output[lng][:html_mnt] \ + << html_head_adjust(lng,'maintenance') \ + if @opt.act[:maintenance][:set]==:on @output[lng][:html] << html_head_adjust(lng) end end @@ -682,7 +734,8 @@ WOK end a=a.join @the_idx.keys.each do |lng| - @output[lng][:html_mnt] << a if @opt.act[:maintenance][:set]==:on + @output[lng][:html_mnt] << a \ + if @opt.act[:maintenance][:set]==:on @output[lng][:html] << a end end @@ -700,7 +753,8 @@ WOK </html> WOK @the_idx.keys.each do |lng| - @output[lng][:html_mnt] << a if @output[lng][:html_mnt].is_a?(File) + @output[lng][:html_mnt] << a \ + if @output[lng][:html_mnt].is_a?(File) @output[lng][:html] << a end end @@ -708,12 +762,14 @@ WOK @output[lng][:html] << html end def do_html_maintenance(lng,html) - @output[lng][:html_mnt] << html if @output[lng][:html_mnt].is_a?(File) + @output[lng][:html_mnt] << html \ + if @output[lng][:html_mnt].is_a?(File) end def do_string(lng,attrib,string) html=%{<p class="#{attrib}">#{string}</p>} do_html(lng,html) - do_html_maintenance(lng,html) if @output[lng][:html_mnt].is_a?(File) + do_html_maintenance(lng,html) \ + if @output[lng][:html_mnt].is_a?(File) end def do_string_default(lng,attrib,string) html=%{<p class="#{attrib}">#{string}</p>} @@ -721,7 +777,8 @@ WOK end def do_string_maintenance(lng,attrib,string) html=%{<p class="#{attrib}">#{string}</p>} - do_html_maintenance(lng,html) if @output[lng][:html_mnt].is_a?(File) + do_html_maintenance(lng,html) \ + if @output[lng][:html_mnt].is_a?(File) end def do_string_name(lng,attrib,string) f=/^(\S)/.match(string)[1] @@ -735,9 +792,11 @@ WOK if @alph.length > 0 @letter=@alph.shift if @output[lng][:html_mnt].is_a?(File) - @output[lng][:html_mnt] << %{\n<p class="letter"><a name="#{@letter}">#{@letter}</a></p><p class="book_index_lev1"><a name="#{@letter.downcase}"></a></p>} + @output[lng][:html_mnt] \ + << %{\n<p class="letter"><a name="#{@letter}">#{@letter}</a></p><p class="book_index_lev1"><a name="#{@letter.downcase}"></a></p>} end - @output[lng][:html] << %{\n<p class="letter"><a name="#{@letter}">#{@letter}</a></p><p class="book_index_lev1"><a name="#{@letter.downcase}"></a></p>} + @output[lng][:html] \ + << %{\n<p class="letter"><a name="#{@letter}">#{@letter}</a></p><p class="book_index_lev1"><a name="#{@letter.downcase}"></a></p>} else break end end @@ -745,7 +804,8 @@ WOK name=string.strip.gsub(/\s+/,'_') html=%{<p class="#{attrib}"><a name="#{name}">#{string}</a></p>} do_html(lng,html) - do_html_maintenance(lng,html) if @output[lng][:html_mnt].is_a?(File) + do_html_maintenance(lng,html) \ + if @output[lng][:html_mnt].is_a?(File) end def do_array(lng,lv,array) lv+=1 diff --git a/lib/sisu/v6/html.rb b/lib/sisu/v6/html.rb index 1f6b787d..afd69118 100644 --- a/lib/sisu/v6/html.rb +++ b/lib/sisu/v6/html.rb @@ -66,7 +66,7 @@ module SiSU_HTML rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)') end - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'defaults' # defaults.rb include SiSU_Viz @@ -150,7 +150,7 @@ module SiSU_HTML SiSU_HTML::Source::Output.new(scroll,@md).scroll end rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -163,7 +163,7 @@ module SiSU_HTML end end end - SiSU_Env::Clear.new(@opt.cmd,@opt.fns,@md).param_instantiate + SiSU_Env::Clear.new(@opt.selections.str,@opt.fns,@md).param_instantiate @@flag,@@scr,@@seg,@@seg_endnotes,@@seg_subtoc,@@seg_ad={},{},{},{},{},{} @@seg_total,@@tracker,@@loop_count,@@tablehead,@@number_of_cols=0,0,0,0,0 @@seg_name,@@seg_name_html,@@seg_subtoc_array,@@seg_endnotes_array,@@segtocband,@@tablefoot=Array.new(7){[]} @@ -305,7 +305,7 @@ module SiSU_HTML @@toc[:seg_mini] << toc[:seg_mini] if toc[:seg_mini] @@toc[:scr] << toc[:scr] if toc[:scr] rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -729,7 +729,7 @@ WOK end end rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -751,7 +751,7 @@ WOK end end rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/html_concordance.rb b/lib/sisu/v6/html_concordance.rb index 0f87ee0b..6b0c0f7d 100644 --- a/lib/sisu/v6/html_concordance.rb +++ b/lib/sisu/v6/html_concordance.rb @@ -62,9 +62,9 @@ =end module SiSU_Concordance - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'defaults' # defaults.rb include SiSU_Viz @@ -118,7 +118,7 @@ module SiSU_Concordance SiSU_Concordance::Source::Words.new(@particulars).songsheet end rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -212,7 +212,7 @@ WOK include SiSU_Viz require_relative 'html_format' # html_format.rb include SiSU_HTML_Format - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Screen @@dp=nil def initialize(particulars) @@ -236,18 +236,19 @@ WOK @alphlst=SiSU_i18n::Alphabet.new(@md.opt.lng).hash_strings @rgx_scanlist=%r{#{Mx[:fa_italics_o]}[#{@alphlst[:l]}#{@alphlst[:u]}0-9"\s]{2,12}#{Mx[:fa_italics_c]}|#{Mx[:fa_bold_o]}[#{@alphlst[:l]}#{@alphlst[:u]}0-9"\s]{2,12}#{Mx[:fa_bold_c]}|(?:https?|file)://\S+|<\S+?>|[#{@alphlst[:l]}#{@alphlst[:u]}]+|\w+}mi rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end end def songsheet begin - FileUtils::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::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/html_lite_shared.rb b/lib/sisu/v6/html_lite_shared.rb index 7ae17350..8eace556 100644 --- a/lib/sisu/v6/html_lite_shared.rb +++ b/lib/sisu/v6/html_lite_shared.rb @@ -66,7 +66,7 @@ module SiSU_FormatShared include SiSU_Viz class CSS_Format require_relative 'defaults' # defaults.rb - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb @@fns=nil def initialize(md,t_o) @md,@t_o=md,t_o diff --git a/lib/sisu/v6/html_promo.rb b/lib/sisu/v6/html_promo.rb index e2832d3c..c216af9f 100644 --- a/lib/sisu/v6/html_promo.rb +++ b/lib/sisu/v6/html_promo.rb @@ -61,7 +61,7 @@ =end module SiSU_HTML_Promo - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Ad def initialize(md) diff --git a/lib/sisu/v6/html_scroll.rb b/lib/sisu/v6/html_scroll.rb index 50c29ca8..27caaff9 100644 --- a/lib/sisu/v6/html_scroll.rb +++ b/lib/sisu/v6/html_scroll.rb @@ -76,7 +76,7 @@ module SiSU_HTML_Scroll scr[:tails]=SiSU_HTML_Scroll::Scroll.new(@md).tails scr rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/html_segments.rb b/lib/sisu/v6/html_segments.rb index d3f96a50..941610ee 100644 --- a/lib/sisu/v6/html_segments.rb +++ b/lib/sisu/v6/html_segments.rb @@ -177,7 +177,7 @@ module SiSU_HTML_Seg SiSU_HTML_Seg::Seg.new.cleanup # (((( added )))) #### (((( END )))) #### rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/html_tune.rb b/lib/sisu/v6/html_tune.rb index 42568a36..d9245a30 100644 --- a/lib/sisu/v6/html_tune.rb +++ b/lib/sisu/v6/html_tune.rb @@ -60,9 +60,9 @@ ** Description: html generation, html pre-processing =end -require_relative 'param' +require_relative 'dp' # dp.rb module SiSU_HTML_Tune - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen require_relative 'html_format' # html_format.rb #watch @@line_mode='' @@ -150,7 +150,7 @@ module SiSU_HTML_Tune end SiSU_HTML_Tune::Tune.new(@data,@md).output rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/hub.rb b/lib/sisu/v6/hub.rb index e061ee46..bb2f2176 100644 --- a/lib/sisu/v6/hub.rb +++ b/lib/sisu/v6/hub.rb @@ -63,11 +63,12 @@ =end module SiSU require_relative 'constants' # constants.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Screen - require_relative 'options' # options.rb - require_relative 'param' # param.rb + require_relative 'hub_actions' # hub_actions.rb + require_relative 'hub_options' # hub_options.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'defaults' # defaults.rb include SiSU_Viz @@ -82,10 +83,12 @@ module SiSU def initialize(argv,call_path) begin #% select what to do (set options & start processing (files selected if any)) opt=SiSU_Commandline::Options.new(argv,call_path) # command line selection of what to do, files & operations set - SiSU::Processing.new(opt).actions # do it + SiSU::Processing.new(opt).version_info + SiSU::Processing.new(opt).actions_without_files # do it + SiSU::Processing.new(opt).actions_on_files # do it rescue - cmd=(opt ? opt.cmd : '') - SiSU_Screen::Ansi.new(cmd,$!,$@).rescue do + selection=(opt ? opt.selection : '') + SiSU_Screen::Ansi.new(selection,$!,$@).rescue do __LINE__.to_s + ':' + __FILE__ end ensure @@ -202,81 +205,6 @@ module SiSU end end end - class Operations - @@n_do=0 - def initialize(opt='') - @opt=opt - @cX=SiSU_Screen::Ansi.new(@opt).cX - end - def counter - @@n_do=0 - end - def remote_put_base_site_rsync # -CR - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \ - if @opt.act[:maintenance][:set] ==:on - require_relative 'remote' # remote.rb - SiSU_Remote::Put.new(@opt).rsync_base - end - def remote_put_base_site_rsync_match # -CCRZ - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \ - if @opt.act[:maintenance][:set] ==:on - require_relative 'remote' # remote.rb - SiSU_Remote::Put.new(@opt).rsync_base_sync - end - def remote_put_base_site # -Cr - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \ - if @opt.act[:maintenance][:set] ==:on - require_relative 'remote' # remote.rb - SiSU_Remote::Put.new(@opt).scp_base - end - def remote_put_base_site_all # -CCr - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \ - if @opt.act[:maintenance][:set] ==:on - require_relative 'remote' # remote.rb - SiSU_Remote::Put.new(@opt).scp_base_all - end - def cgi # -F - require_relative 'cgi' # cgi.rb - SiSU_CGI::SearchSQL.new(@opt).read - end - def termsheet # -t - system("sisu_termsheet #{@opt.cmd} #{@opt.fns}\n") - @@n_do=@@n_do+1 - SiSU_Screen::Ansi.new( - @opt.cmd,@@n_do, - 'Termsheet(s) processed' - ).term_sheet_title unless @opt.act[:quiet][:set] ==:on - end - def webrick # -W - prt=SiSU_Env::InfoEnv.new(@fns).port.webrick_port - puts %{#{@cX.blue}<<#{@cX.off}#{@cX.green}Start Webrick web server on port: #{prt}#{@cX.off}#{@cX.blue}>> #{@cX.off*2} } - require_relative 'webrick' - SiSU_Webserv::WebrickStart.new - end - def not_found - puts "\n#{@cX.fuchsia}FILE NOT FOUND:#{@cX.off} << #{@opt.fns} >> - requested #{@opt.cmd} processing skipped\n" - end - def convert_name_message(fns,type,i,o,rune) - %{\nIn filename: "#{@cX.fuchsia}#{fns}#{@cX.off}" << #{type} >> #{@cX.fuchsia}is apre 0.36 markup filename.#{@cX.off} #{@cX.brown}Please rename your file.#{@cX.off}\n\tAs of sisu-0.37, SiSU markup files with #{@cX.brown}the extensions #{i} should be re-named #{o}#{@cX.off}\n\tif you have the program called 'rename' installed, the following rune should do the trick:\n\t\t#{rune}\n\talternatively try:\n\t\tsisu --convert --36to37 #{fns}\n\trequested #{@opt.cmd} processing skipped\n} - end - def not_recognised - case @opt.fns - when /(\.s[123])$/ - type=@opt.fns.gsub(/\S+?(#{$1})/,'\1') - rune=%q{rename 's/\.s[123]$/\.sst/' *.s{1,2,3}} - puts convert_name_message(@opt.fns,type,'.s1 .s2 and .s3','.sst',rune) - when /(\.r[123])$/ - type=@opt.fns.gsub(/\S+?(#{$1})/,'\1') - rune=%q{rename 's/\.r[123]$/\.ssm/' *.r{1,2,3}} - puts convert_name_message(@opt.fns,type,'.r1 .r2 and .r3','.sst',rune) - puts %{\n\tNote also that you will need to change the names of the files called/required\n\twithin the document text to build the composite document\n\t\t.s1 .s2 .s3 should be .sst \n\t\t.si should be .ssi\n\trequested #{@opt.cmd} processing skipped\n} - when /(\.ssi)$/ - puts "\n#{@cX.fuchsia}component filetype:#{@cX.off} << #{@opt.fns} >> - is not a processed filetype, (it may be used as a component of a .ssm markup file)\n\trequested #{@opt.cmd} processing skipped\n" - else - puts "\n#{@cX.fuchsia}FILETYPE NOT RECOGNISED:#{@cX.off} << #{@opt.fns} >> - is not a recognized filetype,\n\trequested #{@opt.cmd} processing skipped\n" - end - end - end class Processing begin require 'fileutils' @@ -292,7 +220,11 @@ module SiSU @@env=@env=SiSU_Env::InfoEnv.new @msg,@msgs='',nil @tell=lambda { - SiSU_Screen::Ansi.new(@opt.cmd,@msg,"#{@msgs.inspect if @msgs}") + SiSU_Screen::Ansi.new( + @opt.selections.str, + @msg, + "#{@msgs.inspect if @msgs}" + ) } end def remove_skipped_files_if_any_from_processing_files_array @@ -307,16 +239,6 @@ module SiSU @remove_faulty_markup_files_array.join(',') end end - def do_loops - @remove_faulty_markup_files_array=[] - if @opt.act[:zap][:set]==:on #% --zap, -Z - do_loop_files_on_given_option_pre - end - do_each_file_loop_options - remove_skipped_files_if_any_from_processing_files_array - do_loop_files_on_given_option_post - print_error_message_if_files_skipped - end def do_each_file_loop_options @opt.files.each_with_index do |fno,i| @opt.fno=fno @@ -336,129 +258,18 @@ module SiSU Dir.chdir(@opt.pth) #watch end @env=SiSU_Env::InfoEnv.new(@opt.fns) - if @opt.act[:ao][:set]==:on #% --ao --dal, -m - $process_document = :ok - unless @opt.act[:po4a][:set]==:on # --po4a, -P - if @opt.fno =~ /\.ssm$/ - require_relative 'ao_composite' # ao_composite.rb #pre-processing - SiSU_Assemble::Composite.new(@opt).read - end - require_relative 'ao' # -m ao.rb - SiSU_AO::Source.new(@opt).read - end - end - if $process_document == :ok - if @opt.act[:qrcode][:set]==:on #% --qrcode, -Q - require_relative 'qrcode' # qrcode.rb - SiSU_QRcode::Source.new(@opt).read - end - if @opt.act[:hash_digests][:set]==:on #% --hash-digests, -N digest tree - require_relative 'digests' # digests.rb - SiSU_DigestView::Source.new(@opt).read - end - if @opt.act[:txt][:set]==:on #% --txt, -t -a - require_relative 'txt_plain' # txt_plain.rb - SiSU_Txt_Plain::Source.new(@opt).read - end - if @opt.act[:txt_textile][:set]==:on #% --textile - require_relative 'txt_textile' # txt_textile.rb - SiSU_Txt_Textile::Source.new(@opt).read - end - if @opt.act[:txt_asciidoc][:set]==:on #% --asciidoc - require_relative 'txt_asciidoc' # txt_asciidoc.rb - SiSU_Txt_AsciiDoc::Source.new(@opt).read - end - if @opt.act[:txt_markdown][:set]==:on #% --markdown - require_relative 'txt_markdown' # txt_markdown.rb - SiSU_Txt_Markdown::Source.new(@opt).read - end - if @opt.act[:txt_rst][:set]==:on #% --rst, --rest - require_relative 'txt_rst' # txt_rst.rb - SiSU_Txt_rST::Source.new(@opt).read - end - if @opt.act[:html][:set]==:on #% --html, -h -H - require_relative 'html' # html.rb - SiSU_HTML::Source.new(@opt).read - else - if @opt.act[:html_seg][:set]==:on #% --html-seg (-h -H) - require_relative 'html' # html.rb - SiSU_HTML::Source.new(@opt).read - end - if @opt.act[:html_scroll][:set]==:on #% --html-scroll (-h -H) - require_relative 'html' # html.rb - SiSU_HTML::Source.new(@opt).read - end - end - if @opt.act[:concordance][:set]==:on #% --concordance, -w - require_relative 'html_concordance' # html_concordance.rb - SiSU_Concordance::Source.new(@opt).read - end - if @opt.act[:epub][:set]==:on #% --epub, -e - require_relative 'xhtml_epub2' # xhtml_epub2.rb - SiSU_XHTML_EPUB2::Source.new(@opt).read - end - if @opt.act[:odt][:set]==:on #% --odt, -o opendocument - require_relative 'xml_odf_odt' # xml_odf_odt.rb - SiSU_XML_ODF_ODT::Source.new(@opt).read - end - if @opt.act[:xhtml][:set]==:on #% --xhtml, -b xhtml - require_relative 'xhtml' # xhtml.rb - SiSU_XHTML::Source.new(@opt).read - end - if @opt.act[:xml_scaffold_structure_sisu][:set]==:on #% --xml-scaffold --xml-scaffold-sisu - require_relative 'xml_scaffold_structure_sisu' # xml_scaffold_structure_sisu.rb - SiSU_XML_Scaffold_Structure_Sisu::Source.new(@opt).read - end - if @opt.act[:xml_scaffold_structure_collapse][:set]==:on #% --xml-scaffold-collapse - require_relative 'xml_scaffold_structure_collapsed' # xml_scaffold_structure_collapsed.rb - SiSU_XML_Scaffold_Structure_Collapse::Source.new(@opt).read - end - if @opt.act[:xml_docbook_book][:set]==:on #% --xml-docbook - require_relative 'xml_docbook5' # xml_docbook5.rb - SiSU_XML_Docbook_Book::Source.new(@opt).read - end - if @opt.act[:xml_fictionbook][:set]==:on #% --xml-fictionbook - require_relative 'xml_fictionbook2' # xml_fictionbook2.rb - SiSU_XML_Fictionbook::Source.new(@opt).read - end - if @opt.act[:xml_sax][:set]==:on #% --xml-sax, -x xml sax type - require_relative 'xml_sax' # xml_sax.rb - SiSU_XML_SAX::Source.new(@opt).read - end - if @opt.act[:xml_dom][:set]==:on #% --xml-dom, -X xml dom type - require_relative 'xml_dom' # xml_dom.rb - SiSU_XML_DOM::Source.new(@opt).read - end - if @opt.act[:pdf][:set]==:on \ - or @opt.act[:pdf_p][:set]==:on \ - or @opt.act[:pdf_l][:set]==:on #% --pdf-l --pdf, -p latex/ texpdf - require_relative 'texpdf' # texpdf.rb - SiSU_TeX::Source.new(@opt).read - end - if @opt.act[:manpage][:set]==:on #% --manpage, -i - require_relative 'manpage' # manpage.rb - SiSU_Manpage::Source.new(@opt).read - end - if @opt.act[:texinfo][:set]==:on #% --texinfo, -I - require_relative 'texinfo' # texinfo.rb - SiSU_TexInfo::Source.new(@opt).read - end - if @opt.act[:sqlite_discrete][:set]==:on #% --sqlite, -d DB sqlite - require_relative 'dbi_discrete' # dbi_discrete.rb - SiSU_DBI_Discrete::SQL.new(@opt).build - end - if @opt.act[:manifest][:set]==:on #% --manifest, -y - require_relative 'manifest' # manifest.rb - ((@opt.act[:sisupod][:set]==:on \ - || @opt.act[:share_source][:set]==:on) \ - && @opt.files.length < 2 ) \ - ? nil - : SiSU_Manifest::Source.new(@opt).read - end - else - @remove_faulty_markup_files_array << fno - $process_document=:ok - end + actions=SiSU_Hub_Actions::HubActions.new(@opt) + actions.outputs.each_file.abstract_objects? + actions.outputs.each_file.qrcode? + actions.outputs.each_file.hash_digests? + actions.outputs.each_file.text? + actions.outputs.each_file.html? + actions.outputs.each_file.xhtml? + actions.outputs.each_file.xml? + actions.outputs.each_file.pdf? + actions.outputs.each_file.man_or_info? + actions.outputs.each_file.sqlite_discrete? + actions.outputs.each_file.manifest? end end def do_loop_files_on_given_option_pre @@ -473,234 +284,27 @@ module SiSU end end def do_loop_files_on_given_option_post - if @opt.act[:share_source][:set]==:on \ - or @opt.act[:sisupod][:set]==:on \ - or @opt.act[:git][:set]==:on - begin - require_relative 'src_shared' - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Source::SiSUpodSource.new(@opt).read - end - if @opt.act[:share_source][:set]==:on - require_relative 'src_share' # -s src_share.rb - begin - ensure - OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do - SiSU_Markup::Source.new(@opt).read - end - end - end - if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod - require_relative 'src_sisupod_make' # -S src_sisupod_make.rb - begin - ensure - OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do - SiSU_Doc::Source.new(@opt).sisupod_tar_xz - end - end - end - if @opt.act[:git][:set]==:on #% --git, -g sisu git - require_relative 'git' # -g git.rb - begin - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Git::Source.new(@opt).read - end - ensure - OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do - SiSU_Git::Source.new(@opt).git_commit - end - end - end - if (@opt.act[:sisupod][:set]==:on \ - || @opt.act[:share_source][:set]==:on) \ - and @opt.act[:manifest][:set]==:on #% --manifest, -y - require_relative 'manifest' # -y manifest.rb - begin - ensure - OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do - SiSU_Manifest::Source.new(@opt).read - end - end - end - ensure - path_pod=@env.processing_path.processing_sisupod(@opt).paths - unless @opt.act[:maintenance][:set]==:on - FileUtils::rm_rf("#{path_pod[:sisupod]}/*") \ - if FileTest.directory?(path_pod[:sisupod]) - end - end - end - if @opt.act[:po4a][:set]==:on #% --po4a, -P - require_relative 'po4a' - begin - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Po4a::Source.new(@opt).read # -P po4a.rb - end - ensure - end - end - if @opt.act[:images][:set]==:on #% --images, -j - require_relative 'shared_images' - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Images::Source.new(@opt).read # -j shared_images.rb - end - end - if @opt.cmd =~/T/ #% -T termsheet/standard form - @opt.files.each do |fns| - if FileTest.file?(fns) - @opt.fns=fns - case @opt.fns - when /\.(termsheet.rb)$/ - SiSU::Operations.new(@opt).termsheet - else #print "not processed --> ", fns, "\n" - end - else SiSU::Operations.new(@opt).not_found - end - end - SiSU::Operations.new.counter - end - if @opt.act[:psql][:set]==:on #% --pg, -D DB postgresql - require_relative 'dbi' - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb - end - end - if @opt.act[:sqlite][:set]==:on #% --sqlite, -d DB sqlite - require_relative 'dbi' - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb - end - end - if @opt.act[:manifest][:set]==:on #% --manifest, -y - require_relative 'manifest' - OptionLoopFiles.new(@opt).manifest_on_files_translated do - SiSU_Manifest::Source.new(@opt).read # -y manifest.rb - end - end - if @opt.act[:sitemap][:set]==:on #% --sitemap, -Y - require_relative 'sitemaps' - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Sitemaps::Source.new(@opt).read # -Y sitemaps.rb - end - end - if @opt.act[:harvest][:set] !=:on - if @opt.act[:scp][:set]==:on #% -r copy to remote server - require_relative 'remote' # -r remote.rb - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Remote::Put.new(@opt).scp - end - end - if @opt.act[:rsync][:set]==:on #% -R copy to remote server - require_relative 'remote' # -R remote.rb - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Remote::Put.new(@opt).rsync - end - end - else - end - if @opt.act[:urls_selected][:set]==:on #% --sitemap, -Y - require_relative 'urls' - OptionLoopFiles.new(@opt).loop_files_on_given_option do - SiSU_Urls::Source.new(@opt).read #% -u -v -V -M - end - end + actions=SiSU_Hub_Actions::HubActions.new(@opt) + actions.outputs.loop_files.share_source? + actions.outputs.loop_files.run_termsheet? + actions.outputs.loop_files.sql? + SiSU_Hub_Actions::Operations.new.counter + actions.outputs.loop_files.manifest? + actions.outputs.loop_files.sitemaps? + actions.outputs.loop_files.urls? end - def do_initialization - @cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - SiSU_Env::InfoProcessingFlag.new - if @opt.act[:version_info][:set]==:on #% version information + def version_info + if @opt.act[:version_info][:set]==:on SiSU_Env::InfoAbout.new(@opt).sisu_version - if (@opt.act[:verbose][:set]==:on \ - || @opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - ' ' + File.dirname(__FILE__) - ).grey - end - end - if @opt.act[:ao][:set]==:on \ - or @opt.act[:maintenance][:set]==:on #% --maintenance, -m for -C - path={} - path[:css]=@@env.path.output + '/_sisu/css' - path[:xml]=@@env.path.output + '/_sisu/xml' - path[:xsd]=path[:xml] + '/xsd' - path[:xsd]=path[:xml] + '/rnc' - path[:xsd]=path[:xml] + '/rng' - re_p3=/(sisupod(?:\.txz)?|\S+?\.ss[mt]\.txz|[^\/]+?\.ssp)$/ - unless @opt.files.join(',') =~ re_p3 #do not mix pods with source markup files in command line - if @opt.act[:maintenance][:set] ==:on - $VERBOSE=false #debug $VERBOSE=true - end - end - re_p2=/(sisupod(?:\.zip)?|\S+?\.ss[mt]\.zip)$/ - unless @opt.files.join(',') =~ re_p2 #do not mix pods with source markup files in command line - if @opt.act[:maintenance][:set] ==:on - $VERBOSE=false #debug $VERBOSE=true - end - end - end - if @opt.act[:site_init][:set]==:on #% --init-site, -C initialize/configure - require_relative 'conf' #% --init-site, -C initialize/configure - SiSU_Initialize::Source.new(@opt).read - if @opt.act[:rsync][:set]==:on - if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ - and @opt.cmd =~/RZ/ - SiSU::Operations.new(@opt).remote_put_base_site_rsync_match - else SiSU::Operations.new(@opt).remote_put_base_site_rsync - end - elsif @opt.act[:scp][:set]==:on - if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ - and @opt.cmd =~/CCr/ - SiSU::Operations.new(@opt).remote_put_base_site_all - else SiSU::Operations.new(@opt).remote_put_base_site - end - end - end - if @opt.act[:sample_search_form][:set]==:on #% --sample-search-form, -F cgi sample search form - SiSU::Operations.new(@opt).cgi - end - if @opt.act[:webrick][:set]==:on #% --webrick, -W webrick - SiSU::Operations.new(@opt).webrick - end - if @opt.act[:ao][:set]==:on - @retry_count= -1 - begin - @get_s,@get_p,@get_pl=[],[],[] - re_s=/(\S+?\.-sst)$/ - re_p3=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.txz|sisupod(?:\.txz)?|\.ssp))/ - re_pl3=/^(\/\S+?\.ss[mt]\.txz)/ - @opt.files.each do |fns| - if fns =~re_s - @get_s << @opt.f_pths[0][:url] - end - if fns =~re_p3 - @get_p << re_p3.match(fns)[1] if re_p3 - end - if fns =~re_pl3 - @get_pl << re_pl3.match(fns)[1] if re_p3 - end - end - if @get_s.length > 0 #% remote markup file .sst - require_relative 'remote' # remote.rb - SiSU_Remote::Get.new(@opt,@get_s).fns - SiSU::Operations.new.counter - end - if @get_p.length > 0 #% remote sisupod - require_relative 'remote' # remote.rb - SiSU_Remote::Get.new(@opt,@get_p).sisupod - end - rescue - SiSU_Errors::Rescued.new($!,$@,@opt,@fns).location do - __LINE__.to_s + ':' + __FILE__ - end - @retry_count +=1 - retry unless @retry_count > 1 - ensure - end end end - def actions + def actions_without_files + actions=SiSU_Hub_Actions::HubActions.new(@opt) + actions.prepare.site? + actions.prepare.remote_site? + actions.prepare.sql? + end + def actions_on_files if @opt.act[:profile][:set]==:on begin require 'profile' @@ -709,150 +313,71 @@ module SiSU error('profile NOT FOUND (LoadError)') end end - action_on_file_ =if @opt.act[:rsync][:set]==:on \ - && @opt.act[:site_init][:set]==:on - :false - elsif @opt.act[:rsync][:set]==:on \ - && @opt.act[:site_init][:set] !=:on - :true - elsif ((@opt.act[:psql][:set]==:on \ - or @opt.act[:sqlite][:set]==:on) \ - and @opt.mod.join(';') =~/--(?:createdb|init(?:ialize)?|create(?:all)?|createtables|recreate|drop(?:all))/) - :false - else - (@opt.act[:ao][:set]==:on \ - || @opt.act[:manpage][:set]==:on \ - || @opt.act[:texinfo][:set]==:on \ - || @opt.act[:txt][:set]==:on \ - || @opt.act[:txt_textile][:set]==:on \ - || @opt.act[:txt_asciidoc][:set]==:on \ - || @opt.act[:txt_markdown][:set]==:on \ - || @opt.act[:txt_rst][:set]==:on \ - || @opt.act[:html][:set]==:on \ - || @opt.act[:html_scroll][:set]==:on \ - || @opt.act[:html_seg][:set]==:on \ - || @opt.act[:concordance][:set]==:on \ - || @opt.act[:xhtml][:set]==:on \ - || @opt.act[:epub][:set]==:on \ - || @opt.act[:odt][:set]==:on \ - || @opt.act[:xml_sax][:set]==:on \ - || @opt.act[:xml_dom][:set]==:on \ - || @opt.act[:xml_scaffold_structure_sisu][:set]==:on \ - || @opt.act[:xml_scaffold_structure_collapse][:set]==:on \ - || @opt.act[:xml_docbook_book][:set]==:on \ - || @opt.act[:xml_fictionbook][:set]==:on \ - || @opt.act[:pdf][:set]==:on \ - || @opt.act[:pdf_p][:set]==:on \ - || @opt.act[:pdf_l][:set]==:on \ - || @opt.act[:psql][:set]==:on \ - || @opt.act[:sqlite][:set]==:on \ - || @opt.act[:sqlite_discrete][:set]==:on \ - || @opt.act[:share_source][:set]==:on \ - || @opt.act[:sisupod][:set]==:on \ - || @opt.act[:qrcode][:set]==:on \ - || @opt.act[:hash_digests][:set]==:on \ - || @opt.act[:manifest][:set]==:on \ - || @opt.act[:scp][:set]==:on \ - || @opt.act[:webrick][:set]==:on \ - || @opt.act[:zap][:set]==:on) \ - ? (:true) - : (:false) - end - if @opt.act[:harvest][:set]==:on - require_relative 'harvest' # harvest.rb - SiSU_Harvest::Source.new(@opt).read # -h -H html.rb - elsif @opt.mod.inspect =~/--convert|--to|--from/ - require_relative 'sst_convert_markup' # sst_convert_markup.rb - elsif action_on_file_ == :false \ - and (@opt.act[:psql][:set]==:on \ - or @opt.act[:sqlite][:set]==:on) - if @opt.act[:psql][:set]==:on - require_relative 'dbi' - SiSU_DBI::SQL.new(@opt).connect - end - if @opt.act[:sqlite][:set]==:on - require_relative 'dbi' - SiSU_DBI::SQL.new(@opt).connect + actions=SiSU_Hub_Actions::HubActions.new(@opt) + actions.outputs.each_file.harvest? #check + actions.outputs.init? + do_loop_files_on_given_option_pre + do_each_file_loop_options + #remove_skipped_files_if_any_from_processing_files_array # NEEDS WORK + do_loop_files_on_given_option_post + print_error_message_if_files_skipped + actions.outputs.sql? #check location + if @opt.f_pths.length > 0 + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + @msg,@msgs="\tsisu -W [to start ruby web-server on output directory]\n",nil end - elsif action_on_file_ == :true \ - or ( #% ---> - @opt.cmd =~/^-/ \ - and @opt.cmd =~/([abCcDdeFGgHhIjikLMmNnoPpQqRrSsTtUuVvWwXxYyZ_0-9])/ \ - and @opt.mod.inspect !~/--(?:sitemaps|query|identify)/ \ - or @opt.mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ - ) - do_initialization - if action_on_file_ == :true \ - and @opt.files.length > 0 - do_loops - if (@opt.act[:verbose][:set]==:on \ - || @opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - @msg,@msgs="\tsisu -W [to start ruby web-server on output directory]\n",nil - end - if (@opt.act[:verbose][:set]==:on \ - || @opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on \ - || @opt.act[:urls_selected][:set]==:on \ - || @opt.act[:urls_all][:set]==:on) - @tell.call.print_brown unless @opt.files.join.empty? - end - if defined? @@env.processing_path.processing \ - 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 - if @@env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/ - FileUtils::cd(@@env.processing_path.processing_base_tmp) do - FileUtils::rm_rf('.') unless @opt.act[:maintenance][:set] ==:on - end + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on \ + || @opt.act[:urls_selected][:set]==:on \ + || @opt.act[:urls_all][:set]==:on) + @tell.call.print_brown unless @opt.files.join.empty? + end + if defined? @@env.processing_path.processing \ + 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 + if @@env.processing_path.processing_base_tmp =~/^\/tmp\/\S+/ + FileUtils::cd(@@env.processing_path.processing_base_tmp) do + FileUtils::rm_rf('.') unless @opt.act[:maintenance][:set] ==:on end end - elsif action_on_file_ == :true \ - and @opt.files.length == 0 - STDERR.puts %{requested action requires valid sisu markup file [filename (.sst .ssm)] or wildcard (that includes a valid filename)} - if (@opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).warn(:fuchsia) - end end - elsif @opt.mod.inspect =~/--query/ - require_relative 'sst_identify_markup' # sst_identify_markup.rb - puts SiSU_Markup::MarkupHistory.new(@opt).query - elsif @opt.mod.inspect =~/--identify/ - require_relative 'sst_identify_markup' # sst_identify_markup.rb - SiSU_Markup::MarkupIdentify.new(@opt).markup_version? - elsif @opt.mod.inspect =~/--sitemaps/ #% sitemaps - require_relative 'sitemaps' # sitemaps.rb - SiSU_Sitemaps::Source.new(@opt).read - if @opt.act[:rsync][:set]==:on - require_relative 'remote' # remote.rb - SiSU_Remote::Put.new(@opt).rsync_sitemaps + elsif @opt.f_pths.length == 0 + STDERR.puts %{requested action requires valid sisu markup file [filename (.sst .ssm)] or wildcard (that includes a valid filename)} + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).warn(:fuchsia) end else #% sisu help refer to man pages - SiSU_Env::InfoAbout.new(@opt).sisu_version - SiSU_Env::InfoAbout.new(@opt).sisu_about + actions.prepare(@opt).site? + unless done==:ok + #SiSU_Env::InfoAbout.new(@opt).sisu_about + end end @opt.files.each do |fns| if FileTest.file?(fns) @opt.fns=fns unless @opt.fns =~ /(?:\.(?:(?:-|ssm\.)?sst|ssm|ssp|sx[sdn]\.xml|termsheet.rb)|\S+?\.ss[mt]\.(?:txz|zip)|sisupod\.(?:txz|zip)?|\S+?\.ssp)$/ - if @opt.cmd.inspect=~/-P/ + if @opt.selections.str=~/--pg/ elsif @opt.fns=~/\.kdi$/ \ and @opt.mod.inspect =~/--(?:convert(?:-from)?|from)[=-]kdi/ elsif @opt.fns=~/\.sx[sdn]\.xml$/ \ and @opt.mod.inspect =~/--(?:(?:convert(?:-from)?|from)[=-])?(?:xml2sst|sxml)/ elsif @opt.fns=~/\.ssi$/ \ and @opt.mod.inspect =~/--identify/ - else SiSU::Operations.new(@opt).not_recognised + else SiSU_Hub_Actions::Operations.new(@opt).not_recognised end end if @opt.fns =~/\.ssm\.sst$/ \ - and @opt.cmd !~/[S_M]/ # rework necessry, revist, the _ flag is a hack, to keep ._sst files + and @opt.selections.str !~/[S_M]/ # rework necessary, revist, the _ flag is a hack, to keep ._sst files @msg,@msgs='temporary file removed',nil @tell.call.warn unless @opt.act[:quiet][:set]==:on File.unlink(@opt.fns) if File.exist?(@opt.fns) #CONSIDER end - else #SiSU::Operations.new(fns,'html').not_found + else #SiSU::Operations.new(fns,'html').not_found end end end diff --git a/lib/sisu/v6/hub_actions.rb b/lib/sisu/v6/hub_actions.rb new file mode 100644 index 00000000..f6fb7d39 --- /dev/null +++ b/lib/sisu/v6/hub_actions.rb @@ -0,0 +1,585 @@ +# encoding: utf-8 +=begin + + * Name: SiSU + + * Description: a framework for document structuring, publishing and search + + * Author: Ralph Amissah + + * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Ralph Amissah, + All Rights Reserved. + + * License: GPL 3 or later: + + SiSU, a framework for document structuring, publishing and search + + Copyright (C) Ralph Amissah + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program. If not, see <http://www.gnu.org/licenses/>. + + If you have Internet connection, the latest version of the GPL should be + available at these locations: + <http://www.fsf.org/licensing/licenses/gpl.html> + <http://www.gnu.org/licenses/gpl.html> + + <http://www.sisudoc.org/sisu/en/manifest/gpl.fsf.html> + + * SiSU uses: + * Standard SiSU markup syntax, + * Standard SiSU meta-markup syntax, and the + * Standard SiSU object citation numbering and system + + * Hompages: + <http://www.jus.uio.no/sisu> + <http://www.sisudoc.org> + + * Download: + <http://www.sisudoc.org/sisu/en/SiSU/download.html> + + * Git + <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/hub_actions.rb;hb=HEAD> + + * Ralph Amissah + <ralph@amissah.com> + <ralph.amissah@gmail.com> + + ** Description: SiSU information Structuring Universe, text structuring, + processing, publishing, search + +=end +module SiSU_Hub_Actions + class HubActions + def initialize(opt) + @opt=opt + end + def prepare + def site? + if @opt.act[:site_init][:set]==:on #% --init-site, -C initialize/configure + require_relative 'conf' #% --init-site, -C initialize/configure + SiSU_Initialize::Source.new(@opt).read + if @opt.act[:rsync][:set]==:on + if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ + and @opt.selections.str =~/RZ/ + SiSU::Operations.new(@opt).remote_put_base_site_rsync_match + else SiSU::Operations.new(@opt).remote_put_base_site_rsync + end + elsif @opt.act[:scp][:set]==:on + if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ + and @opt.selections.str =~/CCr/ + SiSU::Operations.new(@opt).remote_put_base_site_all + else SiSU::Operations.new(@opt).remote_put_base_site + end + end + end + end + def remote_site? + if @opt.act[:site_init][:set]==:on + if @opt.act[:site_init][:set]==:on #% --init-site, -C initialize/configure + #require_relative 'conf' #% --init-site, -C initialize/configure + #SiSU_Initialize::Source.new(@opt).read + #if @opt.act[:rsync][:set]==:on + # if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ + # and @opt.selection =~/RZ/ + # SiSU::Operations.new(@opt).remote_put_base_site_rsync_match + # else SiSU::Operations.new(@opt).remote_put_base_site_rsync + # end + #elsif @opt.act[:scp][:set]==:on + # if @opt.mod.inspect =~/--init(?:ialize)?=site/ \ + # and @opt.selection =~/CCr/ + # SiSU::Operations.new(@opt).remote_put_base_site_all + # else SiSU::Operations.new(@opt).remote_put_base_site + # end + #end + end + end + end + def sql? + if @opt.act[:psql_createdb][:set]==:on \ + or @opt.act[:psql_create][:set]==:on \ + or @opt.act[:psql_drop][:set]==:on + done=:ok + if @opt.act[:psql][:set]==:on + require_relative 'dbi' + SiSU_DBI::SQL.new(@opt).connect + end + end + if @opt.act[:sqlite_createdb][:set]==:on \ + or @opt.act[:sqlite_create][:set]==:on \ + or @opt.act[:sqlite_drop][:set]==:on + done=:ok + if @opt.act[:sqlite][:set]==:on + require_relative 'dbi' + SiSU_DBI::SQL.new(@opt).connect + end + end + end + self + end + def outputs + if @opt.f_pths.length > 0 + def each_file + def abstract_objects? + if @opt.act[:ao][:set]==:on #% --ao --dal, -m + unless @opt.act[:po4a][:set]==:on # --po4a, -P + if @opt.fno =~ /\.ssm$/ + require_relative 'ao_composite' # ao_composite.rb #pre-processing + SiSU_Assemble::Composite.new(@opt).read + end + require_relative 'ao' # -m ao.rb + SiSU_AO::Source.new(@opt).read + end + end + end + def qrcode? + if @opt.act[:qrcode][:set]==:on #% --qrcode, -Q + require_relative 'qrcode' # qrcode.rb + SiSU_QRcode::Source.new(@opt).read + end + end + def hash_digests? + if @opt.act[:hash_digests][:set]==:on #% --hash-digests, -N digest tree + require_relative 'digests' # digests.rb + SiSU_DigestView::Source.new(@opt).read + end + end + def text? + if @opt.act[:txt][:set]==:on #% --txt, -t -a + require_relative 'txt_plain' # txt_plain.rb + SiSU_Txt_Plain::Source.new(@opt).read + end + if @opt.act[:txt_textile][:set]==:on #% --textile + require_relative 'txt_textile' # txt_textile.rb + SiSU_Txt_Textile::Source.new(@opt).read + end + if @opt.act[:txt_asciidoc][:set]==:on #% --asciidoc + require_relative 'txt_asciidoc' # txt_asciidoc.rb + SiSU_Txt_AsciiDoc::Source.new(@opt).read + end + if @opt.act[:txt_markdown][:set]==:on #% --markdown + require_relative 'txt_markdown' # txt_markdown.rb + SiSU_Txt_Markdown::Source.new(@opt).read + end + if @opt.act[:txt_rst][:set]==:on #% --rst, --rest + require_relative 'txt_rst' # txt_rst.rb + SiSU_Txt_rST::Source.new(@opt).read + end + end + def html? + if @opt.act[:html][:set]==:on #% --html, -h -H + require_relative 'html' # html.rb + SiSU_HTML::Source.new(@opt).read + else + if @opt.act[:html_seg][:set]==:on #% --html-seg (-h -H) + require_relative 'html' # html.rb + SiSU_HTML::Source.new(@opt).read + end + if @opt.act[:html_scroll][:set]==:on #% --html-scroll (-h -H) + require_relative 'html' # html.rb + SiSU_HTML::Source.new(@opt).read + end + end + if @opt.act[:concordance][:set]==:on #% --concordance, -w + require_relative 'html_concordance' # html_concordance.rb + SiSU_Concordance::Source.new(@opt).read + end + end + def xhtml? + if @opt.act[:xhtml][:set]==:on #% --xhtml, -b xhtml + require_relative 'xhtml' # xhtml.rb + SiSU_XHTML::Source.new(@opt).read + end + if @opt.act[:epub][:set]==:on #% --epub, -e + require_relative 'xhtml_epub2' # xhtml_epub2.rb + SiSU_XHTML_EPUB2::Source.new(@opt).read + end + end + def xml? + if @opt.act[:odt][:set]==:on #% --odt, -o opendocument + require_relative 'xml_odf_odt' # xml_odf_odt.rb + SiSU_XML_ODF_ODT::Source.new(@opt).read + end + if @opt.act[:xml_scaffold_structure_sisu][:set]==:on #% --xml-scaffold --xml-scaffold-sisu + require_relative 'xml_scaffold_structure_sisu' # xml_scaffold_structure_sisu.rb + SiSU_XML_Scaffold_Structure_Sisu::Source.new(@opt).read + end + if @opt.act[:xml_scaffold_structure_collapse][:set]==:on #% --xml-scaffold-collapse + require_relative 'xml_scaffold_structure_collapsed' # xml_scaffold_structure_collapsed.rb + SiSU_XML_Scaffold_Structure_Collapse::Source.new(@opt).read + end + if @opt.act[:xml_docbook_book][:set]==:on #% --xml-docbook + require_relative 'xml_docbook5' # xml_docbook5.rb + SiSU_XML_Docbook_Book::Source.new(@opt).read + end + if @opt.act[:xml_fictionbook][:set]==:on #% --xml-fictionbook + require_relative 'xml_fictionbook2' # xml_fictionbook2.rb + SiSU_XML_Fictionbook::Source.new(@opt).read + end + if @opt.act[:xml_sax][:set]==:on #% --xml-sax, -x xml sax type + require_relative 'xml_sax' # xml_sax.rb + SiSU_XML_SAX::Source.new(@opt).read + end + if @opt.act[:xml_dom][:set]==:on #% --xml-dom, -X xml dom type + require_relative 'xml_dom' # xml_dom.rb + SiSU_XML_DOM::Source.new(@opt).read + end + end + def pdf? + if @opt.act[:pdf][:set]==:on \ + or @opt.act[:pdf_p][:set]==:on \ + or @opt.act[:pdf_l][:set]==:on #% --pdf-l --pdf, -p latex/ texpdf + require_relative 'texpdf' # texpdf.rb + SiSU_TeX::Source.new(@opt).read + end + end + def man_or_info? + if @opt.act[:manpage][:set]==:on #% --manpage, -i + require_relative 'manpage' # manpage.rb + SiSU_Manpage::Source.new(@opt).read + end + if @opt.act[:texinfo][:set]==:on #% --texinfo, -I + require_relative 'texinfo' # texinfo.rb + SiSU_TexInfo::Source.new(@opt).read + end + end + def sqlite_discrete? + if @opt.act[:sqlite_discrete][:set]==:on #% --sqlite, -d DB sqlite + require_relative 'dbi_discrete' # dbi_discrete.rb + SiSU_DBI_Discrete::SQL.new(@opt).build + end + end + def manifest? + if @opt.act[:manifest][:set]==:on #% --manifest, -y + require_relative 'manifest' # manifest.rb + ((@opt.act[:sisupod][:set]==:on \ + || @opt.act[:share_source][:set]==:on) \ + && @opt.f_pths.length < 2 ) \ + ? nil + : SiSU_Manifest::Source.new(@opt).read + end + end + def harvest? + if @opt.act[:harvest][:set]==:on + require_relative 'harvest' # harvest.rb + SiSU_Harvest::Source.new(@opt).read # -h -H html.rb + end + end + self + end + def loop_files + def share_source? + if @opt.act[:share_source][:set]==:on \ + or @opt.act[:sisupod][:set]==:on \ + or @opt.act[:git][:set]==:on + begin + require_relative 'src_shared' + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Source::SiSUpodSource.new(@opt).read + end + if @opt.act[:share_source][:set]==:on + require_relative 'src_share' # -s src_share.rb + begin + ensure + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do + SiSU_Markup::Source.new(@opt).read + end + end + end + if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod + require_relative 'src_sisupod_make' # -S src_sisupod_make.rb + begin + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do + SiSU_Doc::Source.new(@opt).sisupod_tar_xz + end + ensure + end + end + if @opt.act[:git][:set]==:on #% --git, -g sisu git + require_relative 'git' # -g git.rb + begin + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Git::Source.new(@opt).read + end + ensure + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do + SiSU_Git::Source.new(@opt).git_commit + end + end + end + if (@opt.act[:sisupod][:set]==:on \ + || @opt.act[:share_source][:set]==:on) \ + and @opt.act[:manifest][:set]==:on #% --manifest, -y + require_relative 'manifest' # -y manifest.rb + begin + ensure + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option_bundle do + SiSU_Manifest::Source.new(@opt).read + end + end + end + ensure + env=SiSU_Env::InfoEnv.new(@opt.fns) + path_pod=env.processing_path.processing_sisupod(@opt).paths + unless @opt.act[:maintenance][:set]==:on + FileUtils::rm_rf("#{path_pod[:sisupod]}/*") \ + if FileTest.directory?(path_pod[:sisupod]) + end + end + end + if @opt.act[:po4a][:set]==:on #% --po4a, -P + require_relative 'po4a' + begin + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Po4a::Source.new(@opt).read # -P po4a.rb + end + ensure + end + end + if @opt.act[:images][:set]==:on #% --images, -j + require_relative 'shared_images' + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Images::Source.new(@opt).read # -j shared_images.rb + end + end + end + def run_termsheet? #broken, revisit later + if @opt.selections.str =~/--termsheet/ #% -T termsheet/standard form #fix later + @opt.files.each do |fns| + if FileTest.file?(fns) + @opt.fns=fns + case @opt.fns + when /\.(termsheet.rb)$/ + SiSU::Operations.new(@opt).termsheet + else #print "not processed --> ", fns, "\n" + end + else SiSU::Operations.new(@opt).not_found + end + end + end + end + def sql? + if @opt.act[:psql][:set]==:on #% --pg, -D DB postgresql + require_relative 'dbi' + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb + end + end + if @opt.act[:sqlite][:set]==:on #% --sqlite, -d DB sqlite + require_relative 'dbi' + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb + end + end + end + def manifest? + if @opt.act[:manifest][:set]==:on #% --manifest, -y + require_relative 'manifest' + SiSU::OptionLoopFiles.new(@opt).manifest_on_files_translated do + SiSU_Manifest::Source.new(@opt).read # -y manifest.rb + end + end + end + def sitemaps? + if @opt.act[:sitemap][:set]==:on #% --sitemap, -Y + require_relative 'sitemaps' + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Sitemaps::Source.new(@opt).read # -Y sitemaps.rb + end + end + end + def remote_placement? + if @opt.act[:harvest][:set] !=:on + if @opt.act[:scp][:set]==:on #% -r copy to remote server + require_relative 'remote' # -r remote.rb + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Remote::Put.new(@opt).scp + end + end + if @opt.act[:rsync][:set]==:on #% -R copy to remote server + require_relative 'remote' # -R remote.rb + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Remote::Put.new(@opt).rsync + end + end + else + end + end + def urls? + if @opt.act[:urls_selected][:set]==:on #% --sitemap, -Y + require_relative 'urls' + SiSU::OptionLoopFiles.new(@opt).loop_files_on_given_option do + SiSU_Urls::Source.new(@opt).read #% urls.rb + end + end + end + self + end + end + def init? + SiSU_Env::InfoProcessingFlag.new + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + ' ' + File.dirname(__FILE__) + ).grey + end + if @opt.act[:ao][:set]==:on \ + or @opt.act[:maintenance][:set]==:on #% --maintenance, -m for -C + env=SiSU_Env::InfoEnv.new(@opt.fns) + path={} + path[:css]=env.path.output + '/_sisu/css' + path[:xml]=env.path.output + '/_sisu/xml' + path[:xsd]=path[:xml] + '/xsd' + path[:xsd]=path[:xml] + '/rnc' + path[:xsd]=path[:xml] + '/rng' + re_p3=/(sisupod(?:\.txz)?|\S+?\.ss[mt]\.txz|[^\/]+?\.ssp)$/ + unless @opt.files.join(',') =~ re_p3 #do not mix pods with source markup files in command line + if @opt.act[:maintenance][:set] ==:on + $VERBOSE=false #debug $VERBOSE=true + end + end + re_p2=/(sisupod(?:\.zip)?|\S+?\.ss[mt]\.zip)$/ + unless @opt.files.join(',') =~ re_p2 #do not mix pods with source markup files in command line + if @opt.act[:maintenance][:set] ==:on + $VERBOSE=false #debug $VERBOSE=true + end + end + end + if @opt.act[:sample_search_form][:set]==:on #% --sample-search-form, -F cgi sample search form + SiSU::Operations.new(@opt).cgi + end + if @opt.act[:webrick][:set]==:on #% --webrick, -W webrick + SiSU::Operations.new(@opt).webrick + end + if @opt.act[:ao][:set]==:on + @retry_count= -1 + begin + @get_s,@get_p,@get_pl=[],[],[] + re_s=/(\S+?\.-sst)$/ + re_p3=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.txz|sisupod(?:\.txz)?|\.ssp))/ + re_pl3=/^(\/\S+?\.ss[mt]\.txz)/ + @opt.files.each do |fns| + if fns =~re_s + @get_s << @opt.f_pths[0][:url] + end + if fns =~re_p3 + @get_p << re_p3.match(fns)[1] if re_p3 + end + if fns =~re_pl3 + @get_pl << re_pl3.match(fns)[1] if re_p3 + end + end + if @get_s.length > 0 #% remote markup file .sst + require_relative 'remote' # remote.rb + SiSU_Remote::Get.new(@opt,@get_s).fns + SiSU::Operations.new.counter + end + if @get_p.length > 0 #% remote sisupod + require_relative 'remote' # remote.rb + SiSU_Remote::Get.new(@opt,@get_p).sisupod + end + rescue + SiSU_Errors::Rescued.new($!,$@,@opt,@fns).location do + __LINE__.to_s + ':' + __FILE__ + end + @retry_count +=1 + retry unless @retry_count > 1 + ensure + end + end + end + self + end + end + class Operations + @@n_do=0 + def initialize(opt='') + @opt=opt + @cX=SiSU_Screen::Ansi.new(@opt).cX + end + def counter + @@n_do=0 + end + def remote_put_base_site_rsync # -CR + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \ + if @opt.act[:maintenance][:set] ==:on + require_relative 'remote' # remote.rb + SiSU_Remote::Put.new(@opt).rsync_base + end + def remote_put_base_site_rsync_match # -CCRZ + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \ + if @opt.act[:maintenance][:set] ==:on + require_relative 'remote' # remote.rb + SiSU_Remote::Put.new(@opt).rsync_base_sync + end + def remote_put_base_site # -Cr + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \ + if @opt.act[:maintenance][:set] ==:on + require_relative 'remote' # remote.rb + SiSU_Remote::Put.new(@opt).scp_base + end + def remote_put_base_site_all # -CCr + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) \ + if @opt.act[:maintenance][:set] ==:on + require_relative 'remote' # remote.rb + SiSU_Remote::Put.new(@opt).scp_base_all + end + def cgi # -F + require_relative 'cgi' # cgi.rb + SiSU_CGI::SearchSQL.new(@opt).read + end + def termsheet # -t + system("sisu_termsheet #{@opt.selections.str} #{@opt.fns}\n") + @@n_do=@@n_do+1 + SiSU_Screen::Ansi.new( + @opt.selections.str,@@n_do, + 'Termsheet(s) processed' + ).term_sheet_title unless @opt.act[:quiet][:set] ==:on + end + def webrick # -W + prt=SiSU_Env::InfoEnv.new(@fns).port.webrick_port + puts %{#{@cX.blue}<<#{@cX.off}#{@cX.green}Start Webrick web server on port: #{prt}#{@cX.off}#{@cX.blue}>> #{@cX.off*2} } + require_relative 'webrick' + SiSU_Webserv::WebrickStart.new + end + def not_found + puts "\n#{@cX.fuchsia}FILE NOT FOUND:#{@cX.off} << #{@opt.fns} >> - requested #{@opt.selections.str} processing skipped\n" + end + def convert_name_message(fns,type,i,o,rune) + %{\nIn filename: "#{@cX.fuchsia}#{fns}#{@cX.off}" << #{type} >> #{@cX.fuchsia}is apre 0.36 markup filename.#{@cX.off} #{@cX.brown}Please rename your file.#{@cX.off}\n\tAs of sisu-0.37, SiSU markup files with #{@cX.brown}the extensions #{i} should be re-named #{o}#{@cX.off}\n\tif you have the program called 'rename' installed, the following rune should do the trick:\n\t\t#{rune}\n\talternatively try:\n\t\tsisu --convert --36to37 #{fns}\n\trequested #{@opt.selections.str} processing skipped\n} + end + def not_recognised + case @opt.fns + when /(\.s[123])$/ + type=@opt.fns.gsub(/\S+?(#{$1})/,'\1') + rune=%q{rename 's/\.s[123]$/\.sst/' *.s{1,2,3}} + puts convert_name_message(@opt.fns,type,'.s1 .s2 and .s3','.sst',rune) + when /(\.r[123])$/ + type=@opt.fns.gsub(/\S+?(#{$1})/,'\1') + rune=%q{rename 's/\.r[123]$/\.ssm/' *.r{1,2,3}} + puts convert_name_message(@opt.fns,type,'.r1 .r2 and .r3','.sst',rune) + puts %{\n\tNote also that you will need to change the names of the files called/required\n\twithin the document text to build the composite document\n\t\t.s1 .s2 .s3 should be .sst \n\t\t.si should be .ssi\n\trequested #{@opt.selections.str} processing skipped\n} + when /(\.ssi)$/ + puts "\n#{@cX.fuchsia}component filetype:#{@cX.off} << #{@opt.fns} >> - is not a processed filetype, (it may be used as a component of a .ssm markup file)\n\trequested #{@opt.selections.str} processing skipped\n" + else + puts "\n#{@cX.fuchsia}FILETYPE NOT RECOGNISED:#{@cX.off} << #{@opt.fns} >> - is not a recognized filetype,\n\trequested #{@opt.selections.str} processing skipped\n" + end + end + end +end +__END__ diff --git a/lib/sisu/v5/options.rb b/lib/sisu/v6/hub_options.rb index eede713a..09559507 100644 --- a/lib/sisu/v5/options.rb +++ b/lib/sisu/v6/hub_options.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/options.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/hub_options.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> @@ -67,8 +67,8 @@ module SiSU_Commandline rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pathname NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb - require_relative 'param_make' # param_make.rb + require_relative 'se' # se.rb + require_relative 'dp_make' # dp_make.rb class HeaderCommon def sisu_document_make_instructions(make_instruct_array=:nil) @pagenew= @@ -156,11 +156,12 @@ module SiSU_Commandline end end class Options - attr_accessor :cmd,:mod,:act,:dir_structure_by,:lingual,:f_pths,:files,:files_mod,:call_path,:base_path,:base_stub,:sub_location,:image_src_path,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions,:make_instructions_pod + attr_accessor :selections,:opt_ch,:act,:dir_structure_by,:lingual,:f_pths,:files,:files_mod,:call_path,:base_path,:base_stub,:sub_location,:image_src_path,:paths,:lngs,:f_pth,:pth,:fno,:fns,:fnb,:fnc,:fng,:fncb,:lng,:lng_base,:what,:make_instructions,:make_instructions_pod @@act=nil def initialize(a,call_path) - @cmd=@f_pth=@pth=@fno=@fns=@fnb=@fnc=@fng=@fncb=@what=@lng=@lng_base=@call_path=@base_path=@base_stub=@image_src_path=@sub_location='' - @f_pths,@files,@files_mod,@paths,@mod,@act=Array.new(5){[]} + @opt_ch=@f_pth=@pth=@fno=@fns=@fnb=@fnc=@fng=@fncb=@what=@lng=@lng_base=@call_path=@base_path=@base_stub=@image_src_path=@sub_location='' + @f_pths,@files,@files_mod,@paths,@select_arr,@act=Array.new(5){[]} + @select_str=nil @env=SiSU_Env::InfoEnv.new @lng_base=@env.language_default_set @dir_structure_by=SiSU_Env::EnvCall.new.output_dir_structure.by? @@ -269,24 +270,25 @@ module SiSU_Commandline if a.length > 0 s=expand_numeric_shortcuts(a) q=set_files_and_paths_and_general_extract(s) - @cmd,@mod=opt_cmd_and_mod_adjust(q[:cmd],q[:mod]) + files=(q[:files].length > 0) ? :true : :false + @select_arr=opt_cmd_and_mod_adjust(q[:opt_ch],q[:selections],files) @what=q[:what] unless q[:what].empty? @paths = q[:paths] @files = q[:files] @f_pths = q[:f_pths] @lngs = q[:lngs] if @files.length > 0 \ - and @cmd.empty? \ - and @mod.length==0 #% if no other action called on filename given, default is sisu --v5 -0 [filename(s)] configured as flag default + and @opt_ch.empty? \ + and @select_arr.length==0 #% if no other action called on filename given, default is sisu --v5 -0 [filename(s)] configured as flag default shortcut=SiSU_Env::InfoProcessingFlag.new - @mod=['--v5'] - @cmd=shortcut.cf_0 + ' --dal' + @select_arr=['--v5'] + @select_arr << shortcut.act_0.arr #+ ' --dal' end - if @cmd =~/[vVM]/ \ - && @cmd !~/-[ku]*v[ku]*$/ + if @select_arr.inspect =~/--verbose/ \ + && @opt_ch !~/-[ku]*v[ku]*$/ SiSU_Screen::Ansi.new( - @cmd, - "\tsisu " + @cmd + ' ' + @mod.join(' ') + ' ' + @files.join(' ') + "\n" + @opt_ch, + "\tsisu " + @opt_ch + ' ' + @select_arr.join(' ') + ' ' + @files.join(' ') + "\n" ).print_brown end end @@ -443,8 +445,8 @@ module SiSU_Commandline end end { - cmd: c, - mod: m, + opt_ch: c, + selections: m, what: w, paths: pth, files: f, @@ -454,387 +456,583 @@ module SiSU_Commandline } end def expand_numeric_shortcuts(a) + s='' + a.each do |x| + y=case x + when /0/ + (x=~/^-0\S+/) \ + ? x.gsub(/^-0(\S+)/,'--act0' + ' -\1') + : x.gsub(/^-0/,'--act0' + ' ') + when /1/ + (x=~/^-1\S+/) \ + ? x.gsub(/^-1(\S+)/,'--act1' + ' -\1') + : x.gsub(/^-1/,'--act1' + ' ') + when /2/ + (x=~/^-2\S+/) \ + ? x.gsub(/^-2(\S+)/,'--act2' + ' -\1') + : x.gsub(/^-2/,'--act2' + ' ') + when /3/ + (x=~/^-3\S+/) \ + ? x.gsub(/^-3(\S+)/,'--act3' + ' -\1') + : x.gsub(/^-3/,'--act3' + ' ') + when /4/ + (x=~/^-4\S+/) \ + ? x.gsub(/^-4(\S+)/,'--act4' + ' -\1') + : x.gsub(/^-4/,'--act4' + ' ') + when /5/ + (x=~/^-5\S+/) \ + ? x.gsub(/^-5(\S+)/,'--act5' + ' -\1') + : x.gsub(/^-5/,'--act5' + ' ') + when /6/ + (x=~/^-6\S+/) \ + ? x.gsub(/^-6(\S+)/,'--act6' + ' -\1') + : x.gsub(/^-6/,'--act6' + ' ') + when /7/ + (x=~/^-7\S+/) \ + ? x.gsub(/^-7(\S+)/,'--act7' + ' -\1') + : x.gsub(/^-7/,'--act7' + ' ') + when /8/ + (x=~/^-8\S+/) \ + ? x.gsub(/^-8(\S+)/,'--act8' + ' -\1') + : x.gsub(/^-8/,'--act8' + ' ') + when /9/ + (x=~/^-9\S+/) \ + ? x.gsub(/^-9(\S+)/,'--act9' + ' -\1') + : x.gsub(/^-9/,'--act9' + ' ') + else x + end + s << " #{y}" unless y.empty? + end + s.strip! + end + def expand_numeric_shortcuts_(a) shortcut=SiSU_Env::InfoProcessingFlag.new s='' a.each do |x| y=case x when /0/ (x=~/^-0\S+/) \ - ? x.gsub(/^-0(\S+)/,shortcut.cf_0 + ' -\1') - : x.gsub(/^-0/,shortcut.cf_0 + ' ') + ? x.gsub(/^-0(\S+)/,shortcut.act_0.str + ' -\1') + : x.gsub(/^-0/,shortcut.act_0.str + ' ') when /1/ (x=~/^-1\S+/) \ - ? x.gsub(/^-1(\S+)/,shortcut.cf_1 + ' -\1') - : x.gsub(/^-1/,shortcut.cf_1 + ' ') + ? x.gsub(/^-1(\S+)/,shortcut.act_1.str + ' -\1') + : x.gsub(/^-1/,shortcut.act_1.str + ' ') when /2/ (x=~/^-2\S+/) \ - ? x.gsub(/^-2(\S+)/,shortcut.cf_2 + ' -\1') - : x.gsub(/^-2/,shortcut.cf_2 + ' ') + ? x.gsub(/^-2(\S+)/,shortcut.act_2.str + ' -\1') + : x.gsub(/^-2/,shortcut.act_2.str + ' ') when /3/ (x=~/^-3\S+/) \ - ? x.gsub(/^-3(\S+)/,shortcut.cf_3 + ' -\1') - : x.gsub(/^-3/,shortcut.cf_3 + ' ') + ? x.gsub(/^-3(\S+)/,shortcut.act_3.str + ' -\1') + : x.gsub(/^-3/,shortcut.act_3.str + ' ') when /4/ (x=~/^-4\S+/) \ - ? x.gsub(/^-4(\S+)/,shortcut.cf_4 + ' -\1') - : x.gsub(/^-4/,shortcut.cf_4 + ' ') + ? x.gsub(/^-4(\S+)/,shortcut.act_4.str + ' -\1') + : x.gsub(/^-4/,shortcut.act_4.str + ' ') when /5/ (x=~/^-5\S+/) \ - ? x.gsub(/^-5(\S+)/,shortcut.cf_5 + ' -\1') - : x.gsub(/^-5/,shortcut.cf_5 + ' ') + ? x.gsub(/^-5(\S+)/,shortcut.act_5.str + ' -\1') + : x.gsub(/^-5/,shortcut.act_5.str + ' ') when /6/ (x=~/^-6\S+/) \ - ? x.gsub(/^-6(\S+)/,shortcut.cf_5 + ' -\1') - : x.gsub(/^-6/,shortcut.cf_5 + ' ') + ? x.gsub(/^-6(\S+)/,shortcut.act_6.str + ' -\1') + : x.gsub(/^-6/,shortcut.act_6.str + ' ') + when /7/ + (x=~/^-7\S+/) \ + ? x.gsub(/^-7(\S+)/,shortcut.act_7.str + ' -\1') + : x.gsub(/^-7/,shortcut.act_7.str + ' ') + when /8/ + (x=~/^-8\S+/) \ + ? x.gsub(/^-8(\S+)/,shortcut.act_8.str + ' -\1') + : x.gsub(/^-8/,shortcut.act_8.str + ' ') + when /9/ + (x=~/^-9\S+/) \ + ? x.gsub(/^-9(\S+)/,shortcut.act_9.str + ' -\1') + : x.gsub(/^-9/,shortcut.act_9.str + ' ') else x end s << " #{y}" unless y.empty? end s.strip! end - def opt_cmd_and_mod_adjust(c,m) - cmd,mod,files=@cmd,@mod,@files - if not m.empty? \ - and m.inspect =~/"--pdf-/ - mod << '--pdf' - m.each do |s| - if s =~ /^--pdf-(?:(?:l|landscape)(?:-(?:a4|letter|a5|b5|legal))?|(?:a4|letter|a5|b5|legal)-(?:l|landscape))$/ - mod << '--landscape' - end - if s =~ /^--pdf-(?:(?:p|portrait)(?:-(?:a4|letter|a5|b5|legal))?|(?:a4|letter|a5|b5|legal)-(?:p|portrait))$/ - mod << '--portrait' - end - if s =~ /^--pdf(?:-(?:a4|letter|a5|b5|legal)(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))(?:-(?:a4|letter|a5|b5|legal)))$/ - if s =~ /^--pdf(?:-a4(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-a4)$/ - mod << '--papersize-a4' - end - if s =~ /^--pdf(?:-a5(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-a5)$/ - mod << '--papersize-a5' + def opt_cmd_and_mod_adjust(ch,select_arr,files) +if @select_arr.length > 0 + p __LINE__ + p @selection +end + select_arr=select_arr.flatten + sel_init=select_arr.flatten + shortcut=SiSU_Env::InfoProcessingFlag.new + if files ==:true + if not sel_init.empty? \ + and sel_init.inspect =~/"--act[0-9]/ + sel_init.each do |s| + select_arr <<=case s + when /--act0/ then shortcut.act_0.arr + when /--act1/ then shortcut.act_1.arr + when /--act2/ then shortcut.act_2.arr + when /--act3/ then shortcut.act_3.arr + when /--act4/ then shortcut.act_4.arr + when /--act5/ then shortcut.act_5.arr + when /--act6/ then shortcut.act_6.arr + when /--act7/ then shortcut.act_7.arr + when /--act8/ then shortcut.act_8.arr + when /--act9/ then shortcut.act_9.arr end - if s =~ /^--pdf(?:-b5(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-b5)$/ - mod << '--papersize-b5' + end + end + if not sel_init.empty? \ + and sel_init.inspect =~/"--pdf-/ + select_arr << '--pdf' + sel_init.each do |s| + if s =~ /^--pdf-(?:(?:l|landscape)(?:-(?:a4|letter|a5|b5|legal))?|(?:a4|letter|a5|b5|legal)-(?:l|landscape))$/ + select_arr << '--landscape' end - if s =~ /^--pdf(?:-letter(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-letter)$/ - mod << '--papersize-letter' + if s =~ /^--pdf-(?:(?:p|portrait)(?:-(?:a4|letter|a5|b5|legal))?|(?:a4|letter|a5|b5|legal)-(?:p|portrait))$/ + select_arr << '--portrait' end - if s =~ /^--pdf(?:-legal(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-legal)$/ - mod << '--papersize-legal' + if s =~ /^--pdf(?:-(?:a4|letter|a5|b5|legal)(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))(?:-(?:a4|letter|a5|b5|legal)))$/ + if s =~ /^--pdf(?:-a4(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-a4)$/ + select_arr << '--papersize-a4' + end + if s =~ /^--pdf(?:-a5(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-a5)$/ + select_arr << '--papersize-a5' + end + if s =~ /^--pdf(?:-b5(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-b5)$/ + select_arr << '--papersize-b5' + end + if s =~ /^--pdf(?:-letter(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-letter)$/ + select_arr << '--papersize-letter' + end + if s =~ /^--pdf(?:-legal(?:-(?:[lp]|landscape|portrait))?|(?:-(?:[lp]|landscape|portrait))-legal)$/ + select_arr << '--papersize-legal' + end end end + select_arr=select_arr.uniq end - mod=mod.uniq - end - unless m.empty? - m.each do |s| - case s - when /^--(?:color-toggle)$/ then c=c+'c' - when /^--(?:color-off)$/ then c=c+'k' - when /^--(?:conf|config|configure|init|initialize|init-site)$/ then c=c+'CC' - when /^--(?:ao|dal?|machine|abstraction|abs)$/ then c=c+'m' - when /^--(?:txt|text|plaintext)$/ then c=c+'t' - when /^--(?:html)$/ then c=c+'h' - when /^--(?:html-scroll|html-seg)$/ then c=c+'H' - mod << s - when /^--(?:epub)$/ then c=c+'e' - when /^--(?:od[ft])$/ then c=c+'o' - when /^--docbook$/ then c=c+'d' - when /^--(?:pdf)$/ then c=c+'p' - when /^--pdf-(?:a4|a5|b5|legal|letter)$/ then c=c+'p' - when /^--pdf-(?:p|l|portrait|landscape)$/ then c=c+'L' - when /^--pdf-(?:p(?:ortrait)?|l(?:andscape)?)-(?:a4|letter|a5|b5|legal)$/ then c=c+'L' - when /^--pdf-(?:a4|letter|a5|b5|legal)-(?:p(?:ortrait)?|l(?:andscape)?)$/ then c=c+'L' - when /^--(?:concordance|wordmap)$/ then c=c+'w' - when /^--(?:manpage|man)$/ then c=c+'i' - when /^--(?:texinfo)$/ then c=c+'I' - when /^--(?:xhtml)$/ then c=c+'b' - when /^--(?:xml-sax)$/ then c=c+'x' - when /^--(?:xml-dom)$/ then c=c+'X' - when /^--(?:images)$/ then c=c+'j' - when /^--(?:digests?|hash-digests)$/ then c=c+'N' - when /^--(?:po4a|pot?)$/ then c=c+'P' - when /^--(?:termsheet)$/ then c=c+'T' - when /^--(?:manifest)$/ then c=c+'y' - when /^--(?:qrcode)$/ then c=c+'Q' - when /^--(?:remote|rsync)$/ then c=c+'R' - when /^--(?:scp)$/ then c=c+'r' - when /^--(?:source)$/ then c=c+'s' - when /^--(?:sisupod|pod)$/ then c=c+'S' - when /^--(?:git)$/ then c=c+'g' - when /^--(?:urls)$/ then c=c+'U' - when /^--(?:zap|delete)$/ then c=c+'Z' - when /^--(?:sample-search-form)$/ then c=c+'F' - when /^--(?:webserv|webrick)$/ then c=c+'W' - when /^--(?:profile)$/ then c=c+'E' - when /^--(?:maintenance|keep-processing-files)$/ then c=c+'M' - when /^--(?:verbose[=-]3)$/ then c=c+'VM' - when /^--(?:verbose[=-]2|Verbose|VERBOSE)$/ then c=c+'V' - when /^--(?:verbose(?:[=-]1)?)$/ then c=c+'v' - when /^--(?:version)$/ then c=c+'v' - when /^--(?:verbose[=-]0|quiet|silent)$/ then c=c+'q' - else mod << s #mod only contains command modifiers; commands converted to character + if ch.empty? \ + and sel_init.length == 0 + select_arr << shortcut.act_0.arr ################ & --flag empty + elsif not ch.empty? + if ch =~/c/ then select_arr << '--color-toggle' + ch=ch.gsub(/[c]/,'') + end + if ch =~/k/ then select_arr << '--color-off' + ch=ch.gsub(/[k]/,'') + end + if ch =~/C/ then select_arr << '--config' + ch=ch.gsub(/[C]+/,'') + end + if ch =~/m/ then select_arr << '--dal' + ch=ch.gsub(/[m]/,'') + end + if ch =~/t/ then select_arr << '--txt' + ch=ch.gsub(/[t]/,'') + end + if ch =~/h/ then select_arr << '--html' + ch=ch.gsub(/[h]/,'') + end + if ch =~/e/ then select_arr << '--epub' + ch=ch.gsub(/[e]/,'') + end + if ch =~/o/ then select_arr << '--odt' + ch=ch.gsub(/[o]/,'') + end + if ch =~/d/ then select_arr << '--docbook' + ch=ch.gsub(/[d]/,'') + end + if ch =~/p/ then select_arr << '--pdf' + ch=ch.gsub(/[p]/,'') + end + if ch =~/w/ then select_arr << '--concordance' + ch=ch.gsub(/[w]/,'') + end + if ch =~/i/ then select_arr << '--manpage' + ch=ch.gsub(/[i]/,'') + end + if ch =~/I/ then select_arr << '--texinfo' + ch=ch.gsub(/[I]/,'') + end + if ch =~/b/ then select_arr << '--xhtml' + ch=ch.gsub(/[b]/,'') + end + if ch =~/x/ then select_arr << '--xml-sax' + ch=ch.gsub(/[x]/,'') + end + if ch =~/X/ then select_arr << '--xml-dom' + ch=ch.gsub(/[X]/,'') + end + if ch =~/j/ then select_arr << '--images' + ch=ch.gsub(/[j]/,'') + end + if ch =~/N/ then select_arr << '--digests' + ch=ch.gsub(/[N]/,'') + end + if ch =~/P/ then select_arr << '--po4a' + ch=ch.gsub(/[P]/,'') + end + if ch =~/d/ then select_arr << '--sqlite' + ch=ch.gsub(/[d]/,'') + end + if ch =~/D/ then select_arr << '--pg' + ch=ch.gsub(/[D]/,'') + end + if ch =~/Q/ then select_arr << '--qrcode' + ch=ch.gsub(/[Q]/,'') + end + if ch =~/s/ then select_arr << '--source' + ch=ch.gsub(/[s]/,'') + end + if ch =~/S/ then select_arr << '--sisupod' + ch=ch.gsub(/[S]/,'') + end + if ch =~/m/ then select_arr << '--manifest' + ch=ch.gsub(/[m]/,'') + end + if ch =~/R/ then select_arr << '--rsync' + ch=ch.gsub(/[R]/,'') + end + if ch =~/r/ then select_arr << '--scp' + ch=ch.gsub(/[r]/,'') + end + if ch =~/g/ then select_arr << '--git' + ch=ch.gsub(/[g]/,'') + end + if ch =~/U/ then select_arr << '--urls' + ch=ch.gsub(/[u]/,'') + end + if ch =~/Z/ then select_arr << '--zap' + ch=ch.gsub(/[Z]/,'') + end + if ch =~/F/ then select_arr << '--sample-search-form' + ch=ch.gsub(/[F]/,'') + end + if ch =~/w/ then select_arr << '--webrick' + ch=ch.gsub(/[w]/,'') + end + if ch =~/M/ then select_arr << '--maintenance' + ch=ch.gsub(/[M]/,'') + end + if ch =~/V/ then select_arr << '--very-verbose' + ch=ch.gsub(/[V]/,'') + end + if ch =~/v/ then select_arr << '--verbose' + ch=ch.gsub(/[v]/,'') + end + if ch =~/q/ then select_arr << '--quiet' + ch=ch.gsub(/[q]/,'') + end + if select_arr.inspect !~/--urls/ \ + and select_arr.inspect \ + !~/"--harvest/ + select_arr << '--urls' + end + if select_arr.inspect !~/--dal/ \ + and select_arr.inspect =~/txt|text|html|odt|epub|docbook|xml|pdf|manpage|texinfo|concordance|qrcode|source|sisupod|pg|sqlite|zap/ + select_arr << '--dal' + end + if select_arr.inspect !~/--manifest/ \ + and select_arr.inspect =~/txt|text|html|odt|epub|docbook|xml|pdf|manpage|texinfo|concordance|qrcode|source|sisupod|pg|sqlite|zap/ + select_arr << '--manifest' + end + if select_arr.inspect !~/--images/ \ + and select_arr.inspect =~/html|odt|docbook|xml|qrcode/ + select_arr << '--images' end end - end - ca=[] - unless c.empty? - c=c.gsub(/-/,'') - c.scan(/CC|\S/) {|x| ca << x} - cmd= '-' + ca.uniq.join - end - extra='' - if cmd !~/[mn]/ - extra+=if cmd =~/[abegHhIiLNOoPpQTtwXxyz]/ \ - and cmd !~/[mn]/ - 'm' #% add ao - elsif ((mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/) \ - and mod.inspect !~/(?:remove|(?:(?:re)?create(?:all)?|dropall|drop)$)/) \ - and cmd !~/[mn]/ - 'm' #% add ao - else '' + else + if ch =~/C/ then select_arr << '--config' + ch=ch.gsub(/[C]+/,'') end - end - if cmd !~/j/ - extra+=if cmd =~/[bdHhwXxyz]/ \ - and cmd !~/[j]/ - 'j' #% copy images - else '' + if sel_init.inspect =~/"--createdb"|"--create(?:all)?"|"--dropall"|"--recreate(?:all)?"/ + if ch =~/d/ then select_arr << '--sqlite' + ch=ch.gsub(/[d]/,'') + end + if ch =~/D/ then select_arr << '--pg' + ch=ch.gsub(/[D]/,'') + end end - end - if cmd !~/y/ - extra+=if cmd =~/[abdeHhIiNopQSstwXxz]/ \ - and cmd !~/y/ - 'ym' #% add manifest - elsif mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ \ - and files[0] !~/^remove$/ \ - and cmd !~/y/ - 'ym' #% add manifest - else '' + if ch =~/v/ then select_arr << '--version' + ch=ch.gsub(/[v]/,'') end end - if cmd !~/u/ #% add urls - extra+='u' - end - cmd=cmd + extra - cmds=cmd.scan(/CC|\S/) - [cmds.uniq.join,mod] + select_arr=select_arr.flatten.compact.uniq.sort end - def opt_act #note mod line commands have already been converted to command characters, cmd - cmd,mod=@cmd,@mod + def opt_act + select_arr=@select_arr @@act=if @@act @act=@@act else act={} - act[:license]=(mod.inspect =~/"--license/) \ + act[:license]=(select_arr.inspect \ + =~/"--license/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:site_init]=(cmd =~/C/ \ - || mod.inspect =~/"--init"|"--initialize"|"--init-site"|"--conf"|"--config"|"--configure"/) \ + act[:site_init]=(select_arr.inspect \ + =~/"--init"|"--initialize"|"--init-site"|"--conf"|"--config"|"--configure"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:rc]=if mod.inspect =~/"--rc=/ - x=Dir.pwd + '/' + mod.join.gsub(/--rc=/,'') + act[:rc]=if select_arr.inspect \ + =~/"--rc=/ + x=Dir.pwd + '/' + select_arr.join.gsub(/--rc=/,'') { bool: true, set: :on, inst: x } else { bool: false, set: :na, inst: '' } end - act[:processing_path]=if mod.inspect =~/"--processing-path=/ - base_pth=mod.join(';').gsub(/^.*--processing-path=['"]?(.+?)(?:['"]?;.+)?$/,'\1') + act[:processing_path]=if select_arr.inspect \ + =~/"--processing-path=/ + base_pth=select_arr.join(';').gsub(/^.*--processing-path=['"]?(.+?)(?:['"]?;.+)?$/,'\1') { bool: true, set: :on, inst: base_pth } - elsif mod.inspect =~/"--processing-path/ + elsif select_arr.inspect \ + =~/"--processing-path/ { bool: true, set: :on, inst: @base_path } else { bool: false, set: :na, inst: nil } end - act[:dump]=if mod.inspect =~/"--dump=/ - base_pth=mod.join(';').gsub(/^.*--dump=['"]?(.+?)(?:['"]?;.+)?$/,'\1') + act[:dump]=if select_arr.inspect \ + =~/"--dump=/ + base_pth=select_arr.join(';'). + gsub(/^.*--dump=['"]?(.+?)(?:['"]?;.+)?$/,'\1') { bool: true, set: :on, inst: base_pth } - elsif mod.inspect =~/"--dump/ + elsif select_arr.inspect =~/"--dump/ { bool: true, set: :on, inst: @base_path } else { bool: false, set: :na, inst: nil } end - act[:redirect]=if mod.inspect =~/"--redirect=/ - base_pth=mod.join(';').gsub(/^.*--redirect=['"]?(.+?)(?:['"]?;.+)?$/,'\1') + act[:redirect]=if select_arr.inspect \ + =~/"--redirect=/ + base_pth=select_arr.join(';'). + gsub(/^.*--redirect=['"]?(.+?)(?:['"]?;.+)?$/,'\1') { bool: true, set: :on, inst: base_pth } - elsif mod.inspect =~/"--redirect/ + elsif select_arr.inspect \ + =~/"--redirect/ { bool: true, set: :on, inst: @base_path } else { bool: false, set: :na, inst: nil } end - act[:switch]=if mod.inspect =~/"--switch-off=/ - off_list=mod.join(';').gsub(/^.*--switch-off=['"]?(.+?)(?:['"];.+)?$/,'\1') + act[:switch]=if select_arr.inspect \ + =~/"--switch-off=/ + off_list=select_arr.join(';'). + gsub(/^.*--switch-off=['"]?(.+?)(?:['"];.+)?$/,'\1') off_list=off_list.scan(/[^,;\s]+/) { bool: false, set: :off, off: off_list} else { bool: true, set: :na, off: [] } end - act[:default_language]=if mod.inspect =~/"--(?:default-)?language[-=](\S{2})"/ + act[:default_language]=if select_arr.inspect \ + =~/"--(?:default-)?language[-=](\S{2})"/ { set: :on, code: $1 } elsif lng_base { set: :on, code: lng_base } else { set: :na, code: 'en' } end - act[:i18n]=if mod.inspect =~/"(?:--monolingual|--i18n-mono(?:lingual)?)"/ #if monolingual possible outputs output_by :filename & :filetype only, without language code in default language name; give warning of conflict settings if monolingual & :language selected + act[:i18n]=if select_arr.inspect \ + =~/"(?:--monolingual|--i18n-mono(?:lingual)?)"/ #if monolingual possible outputs output_by :filename & :filetype only, without language code in default language name; give warning of conflict settings if monolingual & :language selected @lingual=:mono { set: :mono } - elsif mod.inspect =~/"(?:--multilingual|--i18n-multi(?:lingual)?)"/ + elsif select_arr.inspect \ + =~/"(?:--multilingual|--i18n-multi(?:lingual)?)"/ @lingual=:multi { set: :multi } else { set: :na } end - act[:output_by]=if mod.inspect =~/"--(?:output-)?by-language"/ + act[:output_by]=if select_arr.inspect \ + =~/"--(?:output-)?by-language"/ @dir_structure_by=:language { set: :language } - elsif mod.inspect =~/"--(?:output-)?by-filename"/ + elsif select_arr.inspect \ + =~/"--(?:output-)?by-filename"/ @dir_structure_by=:filename { set: :filename } - elsif mod.inspect =~/"--(?:output-)?by-filetype"/ + elsif select_arr.inspect \ + =~/"--(?:output-)?by-filetype"/ @dir_structure_by=:filetype { set: :filetype } else { set: :na } end - act[:ocn]=if mod.inspect =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/ + act[:ocn]=if select_arr.inspect \ + =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/ { bool: true, set: :on } - elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ \ + elsif select_arr.inspect \ + =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ \ || act[:switch][:off].inspect =~/"ocn"|"--numbering"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:toc]=if mod.inspect =~/"--inc-toc"/ + act[:toc]=if select_arr.inspect \ + =~/"--inc-toc"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-toc"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-toc"/ \ || act[:switch][:off].inspect =~/"toc"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:minitoc]=if mod.inspect =~/"--inc-minitoc"/ + act[:minitoc]=if select_arr.inspect \ + =~/"--inc-minitoc"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-minitoc"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-minitoc"/ \ || act[:switch][:off].inspect =~/"minitoc"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:links_to_manifest]=if mod.inspect =~/"--inc-links-to-manifest"|"--inc-manifest-links"/ + act[:links_to_manifest]=if select_arr.inspect \ + =~/"--inc-links-to-manifest"|"--inc-manifest-links"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-manifest"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-manifest"/ \ || act[:switch][:off].inspect =~/"manifest"/ #place lower { bool: false, set: :off } - elsif mod.inspect =~/"--(?:exc|no)-links-to-manifest"|"--(?:exc|no)-manifest-links"/ \ - || act[:switch][:off].inspect =~/"links_to_manifest"|"manifest_links"|"--(?:exc|no)-manifest"/ \ - || mod.inspect =~/"--(?:redirect|dump)/ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-links-to-manifest"|"--(?:exc|no)-manifest-links"/ \ + || act[:switch][:off].inspect \ + =~/"links_to_manifest"|"manifest_links"|"--(?:exc|no)-manifest"/ \ + || select_arr.inspect \ + =~/"--(?:redirect|dump)/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:manifest_minitoc]=if mod.inspect =~/"--inc-manifest-minitoc"|"--inc-minitoc"/ + act[:manifest_minitoc]=if select_arr.inspect \ + =~/"--inc-manifest-minitoc"|"--inc-minitoc"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-manifest-minitoc"|"--(?:exc|no)-minitoc"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-manifest-minitoc"|"--(?:exc|no)-minitoc"/ \ || act[:switch][:off].inspect =~/"manifest_minitoc"|"minitoc"/ - #|| mod.inspect =~/"--(?:redirect|dump)/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:metadata]=if mod.inspect =~/"--inc-metadata"/ + act[:metadata]=if select_arr.inspect \ + =~/"--inc-metadata"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-metadata"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-metadata"/ \ || act[:switch][:off].inspect =~/"metadata"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:html_minitoc]=if mod.inspect =~/"--inc-html-minitoc"|"--inc-minitoc"/ + act[:html_minitoc]=if select_arr.inspect \ + =~/"--inc-html-minitoc"|"--inc-minitoc"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-html-minitoc"|"--(?:exc|no)-minitoc"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-html-minitoc"|"--(?:exc|no)-minitoc"/ \ || act[:switch][:off].inspect =~/"html_minitoc"|"minitoc"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:html_navigation]=if mod.inspect =~/"--inc-html-navigation"|"--inc-navigation"/ + act[:html_navigation]=if select_arr.inspect \ + =~/"--inc-html-navigation"|"--inc-navigation"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-html-navigation"|"--(?:exc|no)-navigation"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-html-navigation"|"--(?:exc|no)-navigation"/ \ || act[:switch][:off].inspect =~/"html_navigation"|"nav"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:html_navigation_bar]=if mod.inspect =~/"--inc-html-navigation-bar"|"--inc-navigation-bar"/ + act[:html_navigation_bar]=if select_arr.inspect \ + =~/"--inc-html-navigation-bar"|"--inc-navigation-bar"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-html-navigation-bar"|"--(?:exc|no)-navigation-bar"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-html-navigation-bar"|"--(?:exc|no)-navigation-bar"/ \ || act[:switch][:off].inspect =~/"html_navigation_bar"|"navbar"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:segsubtoc]=if mod.inspect =~/"--inc-segsubtoc"/ + act[:segsubtoc]=if select_arr.inspect \ + =~/"--inc-segsubtoc"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-segsubtoc"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-segsubtoc"/ \ || act[:switch][:off].inspect =~/"segsubtoc"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:search_form]=if mod.inspect =~/"--inc-search-form"/ + act[:search_form]=if select_arr.inspect \ + =~/"--inc-search-form"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-search-form"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-search-form"/ \ || act[:switch][:off].inspect =~/"search_form"|"search"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:html_search_form]=if mod.inspect =~/"--inc-html-search-form"|"--inc-search-form"/ + act[:html_search_form]=if select_arr.inspect \ + =~/"--inc-html-search-form"|"--inc-search-form"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-html-search-form"|"--(?:exc|no)-search-form"/ \ - || act[:switch][:off].inspect =~/"html_search_form"|"search_form"|"search"/ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-html-search-form"|"--(?:exc|no)-search-form"/ \ + || act[:switch][:off].inspect \ + =~/"html_search_form"|"search_form"|"search"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:html_right_pane]=if mod.inspect =~/"--inc-html-right-pane"|"--inc-right-pane"|"--inc-html-right-column"|"--inc-right-column"/ + act[:html_right_pane]=if select_arr.inspect \ + =~/"--inc-html-right-pane"|"--inc-right-pane"|"--inc-html-right-column"|"--inc-right-column"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-html-right-pane"|"--(?:exc|no)-right-pane"|"--(?:exc|no)-html-right-column"|"--(?:exc|no)-right-column"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-html-right-pane"|"--(?:exc|no)-right-pane"|"--(?:exc|no)-html-right-column"|"--(?:exc|no)-right-column"/ \ || act[:switch][:off].inspect =~/"html_right_pane"|"html_right_column"|"promo"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:html_top_band]=if mod.inspect =~/"--inc-html-top-band"|"--inc-top-band"/ + act[:html_top_band]=if select_arr.inspect \ + =~/"--inc-html-top-band"|"--inc-top-band"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-html-top-band"|"--(?:exc|no)-top-band"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-html-top-band"|"--(?:exc|no)-top-band"/ \ || act[:switch][:off].inspect =~/"html-top-band"|"top-band"/ { bool: false, set: :off } else { bool: true, set: :na } end - act[:html]=if mod.inspect =~/"--html-strict"/ \ - or ((cmd =~/h/ || mod.inspect =~/"--html"/) \ - && mod.inspect =~/"--strict"/) + act[:html]=if select_arr.inspect \ + =~/"--html-strict"/ \ + or ((select_arr.inspect \ + =~/"--html"/) \ + && select_arr.inspect \ + =~/"--strict"/) act[:html_strict]={ bool: true, set: :on } act[:html_scroll]={ bool: true, set: :on } act[:html_seg]={ bool: true, set: :on } { bool: true, set: :on } - elsif (cmd =~/h/ \ - || mod.inspect =~/"--html"/) + elsif (select_arr.inspect \ + =~/"--html"/) act[:html_strict]={ bool: false, set: :off } act[:html_scroll]={ bool: true, set: :on } act[:html_seg]={ bool: true, set: :on } { bool: true, set: :on } else - act[:html_strict]=(mod.inspect =~/"--strict"/) \ + act[:html_strict]=(select_arr.inspect \ + =~/"--strict"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:html_scroll]=(mod.inspect =~/"--html-scroll"/) \ + act[:html_scroll]=(select_arr.inspect \ + =~/"--html-scroll"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:html_seg]=(mod.inspect =~/"--html-seg"/) \ + act[:html_seg]=(select_arr.inspect \ + =~/"--html-seg"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } { bool: false, set: :na } end - act[:concordance]=(cmd =~/w/ \ - || mod.inspect =~/"--concordance"/) \ + act[:concordance]=(select_arr.inspect \ + =~/"--concordance"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:images]=(cmd =~/j/ \ - || mod.inspect =~/"--images"/) \ + act[:images]=(select_arr.inspect \ + =~/"--images"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - if (cmd =~/p/ \ - || mod.inspect =~/"--pdf"/) - if mod.inspect =~/"--portrait"/ + if select_arr.inspect \ + =~/"--pdf"/ + if select_arr.inspect \ + =~/"--portrait"/ act[:pdf]= { bool: false, set: :na } act[:pdf_l]={ bool: false, set: :na } act[:pdf_p]={ bool: true, set: :on } - elsif mod.inspect =~/"--landscape"/ + elsif select_arr.inspect \ + =~/"--landscape"/ act[:pdf]= { bool: false, set: :na } act[:pdf_l]={ bool: true, set: :on } act[:pdf_p]={ bool: false, set: :na } @@ -856,47 +1054,60 @@ module SiSU_Commandline if act[:pdf][:set]==:on \ or act[:pdf_p][:set]==:on \ or act[:pdf_l][:set]==:on - act[:pdf_a4]=if mod.inspect =~/"--a4"|--papersize-a4"/ \ - or mod.inspect =~/"--papersize=\S*a4\b\S*"/ #--papersize=a4,a5 + act[:pdf_a4]=if select_arr.inspect \ + =~/"--a4"|--papersize-a4"/ \ + or select_arr.inspect \ + =~/"--papersize=\S*a4\b\S*"/ #--papersize=a4,a5 { bool: true, set: :on } else { bool: false, set: :na } end - act[:pdf_a5]=if mod.inspect =~/"--a5"|"--papersize-a5"/ \ - or mod.inspect =~/"--papersize=\S*a5\b\S*"/ #--papersize=a4,a5 + act[:pdf_a5]=if select_arr.inspect \ + =~/"--a5"|"--papersize-a5"/ \ + or select_arr.inspect \ + =~/"--papersize=\S*a5\b\S*"/ #--papersize=a4,a5 { bool: true, set: :on } else { bool: false, set: :na } end - act[:pdf_b5]=if mod.inspect =~/"--b5"|"--papersize-b5"/ \ - or mod.inspect =~/"--papersize=\S*b5\b\S*"/ + act[:pdf_b5]=if select_arr.inspect \ + =~/"--b5"|"--papersize-b5"/ \ + or select_arr.inspect \ + =~/"--papersize=\S*b5\b\S*"/ { bool: true, set: :on } else { bool: false, set: :na } end - act[:pdf_letter]=if mod.inspect =~/"--letter"|"--papersize-letter"/ \ - or mod.inspect =~/"--papersize=\S*letter\b\S*"/ + act[:pdf_letter]=if select_arr.inspect \ + =~/"--letter"|"--papersize-letter"/ \ + or select_arr.inspect \ + =~/"--papersize=\S*letter\b\S*"/ { bool: true, set: :on } else { bool: false, set: :na } end - act[:pdf_legal]=if mod.inspect =~/"--legal"|"--papersize-legal"/ \ - or mod.inspect =~/"--papersize=\S*legal\b\S*"/ + act[:pdf_legal]=if select_arr.inspect \ + =~/"--legal"|"--papersize-legal"/ \ + or select_arr.inspect \ + =~/"--papersize=\S*legal\b\S*"/ { bool: true, set: :on } else { bool: false, set: :na } end end - act[:epub]=(cmd =~/e/ \ - || mod.inspect =~/"--epub"/) \ + act[:epub]=(select_arr.inspect \ + =~/"--epub"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:odt]=if cmd =~/o/ \ - or mod.inspect =~/"--odt"|"--odf"|"--odt-(?:ocn|numbering)"|"--odf-(?:ocn|numbering)"/ - act[:odt_ocn]=if (mod.inspect =~/"--odt-(?:ocn|numbering)"|"--odf-(?:ocn|numbering)"/ \ - or mod.inspect =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/) + act[:odt]=if select_arr.inspect \ + =~/"--odt"|"--odf"|"--odt-(?:ocn|numbering)"|"--odf-(?:ocn|numbering)"/ + act[:odt_ocn]=if (select_arr.inspect \ + =~/"--odt-(?:ocn|numbering)"|"--odf-(?:ocn|numbering)"/ \ + or select_arr.inspect \ + =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/) { bool: true, set: :on } - elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ + elsif select_arr.inspect \ + =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ { bool: false, set: :off } else { bool: false, set: :na } @@ -905,38 +1116,43 @@ module SiSU_Commandline else { bool: false, set: :na } end - act[:xml_sax]=(cmd =~/x/ \ - || mod.inspect =~/"--xml-sax"/) \ + act[:xml_sax]=(select_arr.inspect \ + =~/"--xml-sax"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:xml_dom]=(cmd =~/X/ \ - || mod.inspect =~/"--xml-dom"/) \ + act[:xml_dom]=(select_arr.inspect \ + =~/"--xml-dom"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:xml_docbook_book]=(cmd =~/d/ \ - || mod.inspect =~/"--docbook"|"--docbook-book"|"--xml-docbook"|"--xml-docbook_book"/) \ + act[:xml_docbook_book]=(select_arr.inspect \ + =~/"--docbook"|"--docbook-book"|"--xml-docbook"|"--xml-docbook_book"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:xml_fictionbook]=(cmd =~/f/ \ - || mod.inspect =~/"--fictionbook"|"--xml-fictionbook"/) \ + act[:xml_fictionbook]=(select_arr.inspect \ + =~/"--fictionbook"|"--xml-fictionbook"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:xml_scaffold_structure_sisu]=mod.inspect =~/"--xml-scaffold"|"--xml-scaffold-sisu"/ \ + act[:xml_scaffold_structure_sisu]=select_arr.inspect \ + =~/"--xml-scaffold"|"--xml-scaffold-sisu"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:xml_scaffold_structure_collapse]=mod.inspect =~/"--xml-scaffold-collapse"/ \ + act[:xml_scaffold_structure_collapse]=select_arr.inspect \ + =~/"--xml-scaffold-collapse"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:xhtml]=(cmd =~/b/ \ - || mod.inspect =~/"--xhtml"/) \ + act[:xhtml]=(select_arr.inspect \ + =~/"--xhtml"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:txt]=if cmd =~/[at]/ \ - or mod.inspect =~/"--txt"|"--text"|"--plaintext"|"--txt-(?:ocn|numbering)"|"--text-(?:ocn|numbering)"|"--plaintext-(?:ocn|numbering)"/ - act[:txt_ocn]=if (mod.inspect =~/"--txt-(?:ocn|numbering)"|"--text-(?:ocn|numbering)"|"--plaintext-(?:ocn|numbering)"/ \ - or mod.inspect =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/) + act[:txt]=if select_arr.inspect \ + =~/"--txt"|"--text"|"--plaintext"|"--txt-(?:ocn|numbering)"|"--text-(?:ocn|numbering)"|"--plaintext-(?:ocn|numbering)"/ + act[:txt_ocn]=if (select_arr.inspect \ + =~/"--txt-(?:ocn|numbering)"|"--text-(?:ocn|numbering)"|"--plaintext-(?:ocn|numbering)"/ \ + or select_arr.inspect \ + =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/) { bool: true, set: :on } - elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ + elsif select_arr.inspect \ + =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ { bool: false, set: :off } else { bool: false, set: :na } @@ -945,66 +1161,71 @@ module SiSU_Commandline else { bool: false, set: :na } end - act[:txt_textile]=(mod.inspect =~/"--textile"/) \ + act[:txt_textile]=(select_arr.inspect \ + =~/"--textile"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:txt_asciidoc]=(mod.inspect =~/"--asciidoc"/) \ + act[:txt_asciidoc]=(select_arr.inspect \ + =~/"--asciidoc"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:txt_markdown]=(mod.inspect =~/"--markdown"/) \ + act[:txt_markdown]=(select_arr.inspect \ + =~/"--markdown"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:txt_rst]=(mod.inspect =~/"--rst"|"--rest"|"--restructuredtext"/) \ + act[:txt_rst]=(select_arr.inspect \ + =~/"--rst"|"--rest"|"--restructuredtext"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:manpage]=(cmd =~/i/ \ - || mod.inspect =~/"--manpage"|"--man"/) \ + act[:manpage]=(select_arr.inspect \ + =~/"--manpage"|"--man"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:texinfo]=(cmd =~/I/ \ - || mod.inspect =~/"--texinfo"/) \ + act[:texinfo]=(select_arr.inspect \ + =~/"--texinfo"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:psql]=if mod.inspect =~/"--pg-\S+"/ \ - or ((mod.inspect =~/"--pg"/) \ - && (mod.inspect \ + act[:psql]=if select_arr.inspect \ + =~/"--pg-\S+"/ \ + or ((select_arr.inspect =~/"--pg"/) \ + && (select_arr.inspect \ =~/"--createdb"|"--create(?:all)?"|"--dropall"|"--recreate(?:all)?"|"--import"|"--update"|"--remove"/)) - act[:psql_createdb]=if mod.inspect \ + act[:psql_createdb]=if select_arr.inspect \ =~/"--pg-createdb"|"--createdb"/ { bool: true, set: :on } else { bool: false, set: :na } end - if mod.inspect \ + if select_arr.inspect \ =~/"--pg-recreate(?:all)?"|"--recreate(?:all)?"/ act[:psql_drop]={ bool: true, set: :on } act[:psql_create]={ bool: true, set: :on } else - act[:psql_drop]=if mod.inspect \ + act[:psql_drop]=if select_arr.inspect \ =~/"--pg-dropall"|"--dropall"/ { bool: true, set: :on } else { bool: false, set: :na } end - act[:psql_create]=if mod.inspect \ + act[:psql_create]=if select_arr.inspect \ =~/"--pg-create(?:all)?"|"--create(?:all)?"/ { bool: true, set: :on } else { bool: false, set: :na } end end - act[:psql_import]=if mod.inspect \ + act[:psql_import]=if select_arr.inspect \ =~/"--pg-import"|"--import"/ { bool: true, set: :on } else { bool: false, set: :na } end - act[:psql_update]=if mod.inspect \ + act[:psql_update]=if select_arr.inspect \ =~/"--pg-update"|"--update"/ act[:psql_remove]={ bool: true, set: :on } { bool: true, set: :on } else - act[:psql_remove]=if mod.inspect \ + act[:psql_remove]=if select_arr.inspect \ =~/"--pg-remove"|"--remove"/ { bool: true, set: :on } else @@ -1028,46 +1249,48 @@ module SiSU_Commandline { bool: false, set: :na } { bool: false, set: :na } end - act[:sqlite]=if (mod.inspect =~/"--sqlite-\S+"/) \ - or ((mod.inspect =~/"--sqlite"/) \ - && (mod.inspect \ - =~/"--createdb"|"--create(?:all)?"|"--dropall"|"--recreate(?:all)?"|"--import"|"--update"|"--remove"/)) - act[:sqlite_createdb]=if mod.inspect \ + act[:sqlite]=if select_arr.inspect \ + =~/"--sqlite-\S+"/ \ + or (select_arr.inspect \ + =~/"--sqlite"/ \ + && select_arr.inspect \ + =~/"--createdb"|"--create(?:all)?"|"--dropall"|"--recreate(?:all)?"|"--import"|"--update"|"--remove"/) + act[:sqlite_createdb]=if select_arr.inspect \ =~/"--sqlite-createdb"|"--createdb"/ { bool: true, set: :on } else { bool: false, set: :na } end - if mod.inspect \ + if select_arr.inspect \ =~/"--sqlite-recreate(?:all)?"|"--recreate(?:all)?"/ act[:sqlite_drop]={ bool: true, set: :on } act[:sqlite_create]={ bool: true, set: :on } else - act[:sqlite_create]=if mod.inspect \ + act[:sqlite_create]=if select_arr.inspect \ =~/"--sqlite-create(?:all)?"|"--create(?:all)?"/ { bool: true, set: :on } else { bool: false, set: :na } end - act[:sqlite_drop]=if mod.inspect \ + act[:sqlite_drop]=if select_arr.inspect \ =~/"--sqlite-dropall"|"--dropall"/ { bool: true, set: :on } else { bool: false, set: :na } end end - act[:sqlite_import]=if mod.inspect \ + act[:sqlite_import]=if select_arr.inspect \ =~/"--sqlite-import"|"--import"/ { bool: true, set: :on } else { bool: false, set: :na } end - act[:sqlite_update]=if mod.inspect \ + act[:sqlite_update]=if select_arr.inspect \ =~/"--sqlite-update"|"--update"/ act[:sqlite_remove]={ bool: true, set: :on } { bool: true, set: :on } else - act[:sqlite_remove]=if mod.inspect \ + act[:sqlite_remove]=if select_arr.inspect \ =~/"--sqlite-remove"|"--sqlite-remove"/ { bool: true, set: :on } else @@ -1091,92 +1314,110 @@ module SiSU_Commandline { bool: false, set: :na } { bool: false, set: :na } end - act[:sqlite_discrete]=mod.inspect =~/"--sql"|"--sqlite"/ \ - && (mod.inspect !~/"--createdb"|"--create(?:all)?"|"--dropall"|"--recreate(?:all)?"|"--import"|"--update"|"--remove"/) \ + act[:sqlite_discrete]=select_arr.inspect \ + =~/"--sql"|"--sqlite"/ \ + && (select_arr.inspect \ + !~/"--createdb"|"--create(?:all)?"|"--dropall"|"--recreate(?:all)?"|"--import"|"--update"|"--remove"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:harvest]=(mod.inspect =~/"--harvest"/) \ + act[:harvest]=(select_arr.inspect \ + =~/"--harvest"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:po4a]=(cmd =~/P/ \ - || mod.inspect =~/"--po4a"|"--pot?"/) \ + act[:po4a]=(select_arr.inspect \ + =~/"--po4a"|"--pot?"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:git]=(cmd =~/g/ \ - || mod.inspect =~/"--git"/) \ + act[:git]=(select_arr.inspect \ + =~/"--git"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:hash_digests]=(cmd =~/N/ \ - || mod.inspect =~/"--digests?"|"--hash-digests"/) \ + act[:hash_digests]=(select_arr.inspect \ + =~/"--digests?"|"--hash-digests"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:pdf_font_size]=if mod.inspect =~/"--(?:pdf-)?font-?size[=-](\d{1,2})(?:pt)?"/ + act[:pdf_font_size]=if select_arr.inspect \ + =~/"--(?:pdf-)?font-?size[=-](\d{1,2})(?:pt)?"/ $1 else :na end - act[:pdf_hyperlink_colors]=if mod.inspect =~/"--pdf-hyperlinks-(?:mono(?:chrome)?|no-color)"/ + act[:pdf_hyperlink_colors]=if select_arr.inspect \ + =~/"--pdf-hyperlinks-(?:mono(?:chrome)?|no-color)"/ :mono - elsif mod.inspect =~/"--pdf-hyperlinks-color"/ + elsif select_arr.inspect \ + =~/"--pdf-hyperlinks-color"/ :color else :na end - act[:hash_digest_algo]=if mod.inspect =~/"--hash-(?:sha)?512"/ + act[:hash_digest_algo]=if select_arr.inspect \ + =~/"--hash-(?:sha)?512"/ :sha512 - elsif mod.inspect =~/"--hash-(?:sha)?256"/ + elsif select_arr.inspect \ + =~/"--hash-(?:sha)?256"/ :sha256 - elsif mod.inspect =~/"--hash-md5"/ + elsif select_arr.inspect \ + =~/"--hash-md5"/ :md5 else :na end - act[:sample_search_form]=(cmd =~/F/ \ - || mod.inspect =~/"--sample-search-form"/) \ + act[:sample_search_form]=select_arr.inspect \ + =~/"--sample-search-form"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:webrick]=(cmd =~/W/ \ - || mod.inspect =~/"--webrick"/) \ + act[:webrick]=select_arr.inspect \ + =~/"--webrick"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:share_source]=(cmd =~/s/ \ - || mod.inspect =~/"--source"/) \ + act[:share_source]=select_arr.inspect \ + =~/"--source"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:sisupod]=(cmd =~/S/ \ - || mod.inspect =~/"--sisupod"/) \ + act[:sisupod]=select_arr.inspect \ + =~/"--sisupod"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:scp]=(cmd =~/r/ \ - || mod.inspect =~/"--scp"/) \ + act[:scp]=select_arr.inspect \ + =~/"--scp"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:rsync]=(cmd =~/R/ \ - || mod.inspect =~/"--rsync"|"--remote"/) \ + act[:rsync]=select_arr.inspect \ + =~/"--rsync"|"--remote"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:zap]=(cmd =~/Z/ \ - || mod.inspect =~/"--zap"|"--delete"/) \ + act[:zap]=select_arr.inspect \ + =~/"--zap"|"--delete"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:urls_all]=(cmd =~/U/ \ - || mod.inspect =~/"--urls-all"/) \ + act[:urls_all]=select_arr.inspect \ + =~/"--urls-all"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:urls_selected]=(cmd =~/u/ \ - || mod.inspect =~/"--urls"/) \ - ? { bool: true, set: :on } - : { bool: false, set: :na } - act[:sitemap]=(cmd =~/Y/ \ - || mod.inspect =~/"--sitemap"/) \ + act[:urls_selected]=if select_arr.inspect \ + =~/"--urls"/ + { bool: true, set: :on } + elsif select_arr.inspect \ + =~/"--harvest/ + { bool: false, set: :off } + elsif select_arr.inspect \ + =~/"--verbose"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + act[:sitemap]=select_arr.inspect \ + =~/"--sitemap"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:qrcode]=(cmd =~/Q/ \ - || mod.inspect =~/"--qrcode"/) \ + act[:qrcode]=select_arr.inspect \ + =~/"--qrcode"/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:help]=(mod.inspect =~/"--help/) \ + act[:help]=select_arr.inspect \ + =~/"--help/ \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:ao]=if (cmd =~/m/ \ - || mod.inspect =~/"--ao"|"--dal"/) + act[:ao]=if select_arr.inspect \ + =~/"--ao"|"--dal"/ { bool: true, set: :on } elsif (act[:txt][:set]==:on \ || act[:txt_textile][:set]==:on \ @@ -1199,6 +1440,13 @@ module SiSU_Commandline || act[:share_source][:set]==:on \ || act[:sisupod][:set]==:on \ || act[:concordance][:set]==:on \ + || act[:sqlite_discrete][:set]==:on \ + || act[:sqlite_import][:set]==:on \ + || act[:sqlite_update][:set]==:on \ + || act[:sqlite_remove][:set]==:on \ + || act[:psql_import][:set]==:on \ + || act[:psql_update][:set]==:on \ + || act[:psql_remove][:set]==:on \ || act[:xml_dom][:set]==:on \ || act[:xml_sax][:set]==:on \ || act[:xml_docbook_book][:set]==:on \ @@ -1206,27 +1454,18 @@ module SiSU_Commandline || act[:xml_scaffold_structure_sisu][:set]==:on \ || act[:xml_scaffold_structure_collapse][:set]==:on ) { bool: true, set: :on } - #if cmd !~/[mn]/ - # extra+=if cmd =~/[abegHhIiLNOoPpQTtwXxyz]/ \ - # and cmd !~/[mn]/ - # 'm' #% add ao - #elsif (act[:txt][:set]==:on \ - # { bool: true, set: :on } - # elsif ((cmd =~/[Dd]/ \ - # or (mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/)) \ - # and mod.inspect !~/(?:remove|(?:(?:re)?create(?:all)?|dropall|drop)$)/) \ - # and cmd !~/[mn]/ - # 'm' #% add ao else { bool: false, set: :na } end - act[:manifest]=if mod.inspect =~/"--inc-manifest"/ + act[:manifest]=if select_arr.inspect \ + =~/"--inc-manifest"/ { bool: true, set: :on } - elsif mod.inspect =~/"--(?:exc|no)-manifest"/ \ + elsif select_arr.inspect \ + =~/"--(?:exc|no)-manifest"/ \ || act[:switch][:off].inspect =~/"manifest"/ { bool: false, set: :off } - elsif (cmd =~/y/ \ - || mod.inspect =~/"--manifest"/) + elsif select_arr.inspect \ + =~/"--manifest"/ { bool: true, set: :on } elsif (act[:txt][:set]==:on \ || act[:txt_textile][:set]==:on \ @@ -1256,71 +1495,55 @@ module SiSU_Commandline || act[:xml_scaffold_structure_sisu][:set]==:on \ || act[:xml_scaffold_structure_collapse][:set]==:on ) { bool: true, set: :on } - ## if cmd !~/y/ - ## extra+=if cmd =~/[abeHhIiNopQSstwXxz]/ \ - ## and cmd !~/y/ - ## 'ym' #% add manifest - #elsif (act[:txt][:set]==:on \ - # { bool: true, set: :on } - # elsif (cmd =~/[Dd]/ \ - # or mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/) \ - # and files[0] !~/^remove$/ \ - # and cmd !~/y/ - # 'ym' #% add manifest else { bool: true, set: :na } end act[:console_messages] = '' - act[:verbose]=if (cmd =~/v/ \ - || mod.inspect =~/"--verbose"/) + act[:verbose]=if select_arr.inspect \ + =~/"--verbose"/ act[:console_messages] << ' --verbose ' { bool: true, set: :on } else { bool: false, set: :na } end - act[:verbose_plus]=if (cmd =~/V/ \ - || mod.inspect =~/"--very-verbose"/) + act[:verbose_plus]=if select_arr.inspect \ + =~/"--very-verbose"/ act[:console_messages] << ' --very-verbose ' { bool: true, set: :on } else { bool: false, set: :na } end - act[:version_info]=if (cmd =~/[vVM]/ \ - || mod.inspect =~/"--verbose"|"--maintenance"/) + act[:version_info]=if select_arr.inspect \ + =~/"--version"|"--verbose"|"--maintenance"/ act[:console_messages] << ' --maintenance ' { bool: true, set: :on } else { bool: false, set: :na } end - act[:quiet]=if (cmd =~/q/ \ - || mod.inspect =~/"--quiet"/) + act[:quiet]=if (select_arr.inspect =~/"--quiet"/) act[:console_messages] << ' --quiet ' { bool: true, set: :on } else { bool: false, set: :na } end - act[:color_state]=if mod.inspect =~/"--color-on"|"--color"/ + act[:color_state]=if select_arr.inspect =~/"--color-on"|"--color"/ act[:console_messages] << ' --color-on ' { bool: true, set: :on } - elsif (cmd =~/k/ \ - || mod.inspect =~/"--color-off"/) + elsif (select_arr.inspect =~/"--color-off"/) act[:console_messages] << ' --color-off ' { bool: false, set: :off } else { bool: true, set: :na } #fix default color end -# act[:color_toggle]=if cmd =~/c/ \ -# or mod.inspect =~/"--color-toggle"/ +# act[:color_toggle]=if select_arr.inspect =~/"--color-toggle"/ # true # else false # end - act[:maintenance]=if (cmd =~/M/ \ - || mod.inspect =~/"--maintenance|--keep-processing-files"/) + act[:maintenance]=if (select_arr.inspect =~/"--maintenance|--keep-processing-files"/) act[:console_messages] << ' --maintenance ' { bool: true, set: :on } else { bool: false, set: :na } end - act[:profile]=if (cmd =~/E/ \ - || mod.inspect =~/"--profile"/) + act[:profile]=if (select_arr.inspect =~/"--profile"/) act[:console_messages] << ' --color-off ' { bool: true, set: :on } else @@ -1329,11 +1552,17 @@ module SiSU_Commandline @act=act end end - def cmd - @cmd + def opt_ch + @opt_ch end - def mod - @mod + def selections + def arr + @select_arr.sort + end + def str + @select_str ||= arr.join(' ') + end + self end def act @@act @@ -1342,6 +1571,9 @@ module SiSU_Commandline files_mod=files @files_mod=files_mod end + def files + @files + end def f_pth @f_pth end @@ -1394,6 +1626,6 @@ module SiSU_Commandline end end __END__ -note usually named @opt is carried in Param (usually as @md.opt), @opt is a +note usually named @opt is carried in dp document parameters (usually as @md.opt), @opt is a subset of @md where @md is passed, contents of @opt are available as @md.opt passing @opt as well is duplication check for fns & fnb diff --git a/lib/sisu/v6/manifest.rb b/lib/sisu/v6/manifest.rb index 21350938..6f22eefb 100644 --- a/lib/sisu/v6/manifest.rb +++ b/lib/sisu/v6/manifest.rb @@ -61,15 +61,15 @@ =end module SiSU_Manifest - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'prog_text_translation' # prog_text_translation.rb - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'html_minitoc' # html_minitoc.rb require_relative 'html' # html.rb include SiSU_HTML_Format - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'i18n' # i18n.rb include SiSU_Viz @@ -116,7 +116,7 @@ module SiSU_Manifest data=SiSU_HTML::Source::HTML_Environment.new(@particulars).tuned_file_instructions SiSU_Manifest::Source::Output.new(@md).check_output(data) rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -1019,7 +1019,7 @@ WOK WOK output rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/manpage.rb b/lib/sisu/v6/manpage.rb index 4f2bb803..602a383e 100644 --- a/lib/sisu/v6/manpage.rb +++ b/lib/sisu/v6/manpage.rb @@ -63,7 +63,7 @@ =end module SiSU_Manpage require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Param include SiSU_Viz @@ -94,7 +94,7 @@ module SiSU_Manpage (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ - && @opt.cmd !~/q/ \ + && @opt.act[:quiet][:set]==:on \ ? SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], 'Manpage', @@ -116,7 +116,7 @@ module SiSU_Manpage @ao_array=SiSU_AO::Source.new(@opt).get # ao file drawn here SiSU_Manpage::Source::Scroll.new(@md,@ao_array).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/manpage_format.rb b/lib/sisu/v6/manpage_format.rb index 1bb0e423..b64911e7 100644 --- a/lib/sisu/v6/manpage_format.rb +++ b/lib/sisu/v6/manpage_format.rb @@ -61,7 +61,7 @@ =end module SiSU_ManpageFormat - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class ParagraphNumber diff --git a/lib/sisu/v6/po4a.rb b/lib/sisu/v6/po4a.rb index c4e074ec..e6042492 100644 --- a/lib/sisu/v6/po4a.rb +++ b/lib/sisu/v6/po4a.rb @@ -63,7 +63,7 @@ =end module SiSU_Po4a require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'ao_composite' # ao_composite.rb require_relative 'shared_metadata' # shared_metadata.rb @@ -167,7 +167,7 @@ module SiSU_Po4a SiSU_Po4a::Source::Scroll.new(fn,@ao_array_lang_src,@ao_array_lang_translation,@@md_src,@@md_trn,wrap_width).songsheet end rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/prog_text_translation.rb b/lib/sisu/v6/prog_text_translation.rb index 177f17b9..6a82f3de 100644 --- a/lib/sisu/v6/prog_text_translation.rb +++ b/lib/sisu/v6/prog_text_translation.rb @@ -61,7 +61,7 @@ =end module SiSU_Translate - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Param class Source def initialize(md,doc_lang,trans_str='') diff --git a/lib/sisu/v6/qrcode.rb b/lib/sisu/v6/qrcode.rb index b9aee5a2..aa31236c 100644 --- a/lib/sisu/v6/qrcode.rb +++ b/lib/sisu/v6/qrcode.rb @@ -61,13 +61,13 @@ =end module SiSU_QRcode - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'prog_text_translation' # prog_text_translation.rb - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'html' # html.rb - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'i18n' # i18n.rb include SiSU_Viz @@ -111,7 +111,7 @@ module SiSU_QRcode data=SiSU_HTML::Source::HTML_Environment.new(@particulars).tuned_file_instructions OutputInfo.new(@md).check_output(data) rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -152,7 +152,7 @@ module SiSU_QRcode mn += x end manifest.close if @md.opt.act[:maintenance][:set]==:on - cmd=SiSU_Env::SystemCall.new(mn,@f.place_file.qrcode_md.dir,@md.opt.cmd) + cmd=SiSU_Env::SystemCall.new(mn,@f.place_file.qrcode_md.dir,@md.opt.selections.str) cmd.qrencode end def output_metadata_short @@ -160,7 +160,7 @@ module SiSU_QRcode @manifest[:txt_title].each do |x| mn += x end - cmd=SiSU_Env::SystemCall.new(mn,@f.place_file.qrcode_title.dir,@md.opt.cmd) + cmd=SiSU_Env::SystemCall.new(mn,@f.place_file.qrcode_title.dir,@md.opt.selections.str) cmd.qrencode end def summarize(id,file,pth='',rel='',url='',img='● ') @@ -193,7 +193,7 @@ WOK || @md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new( - @md.opt.cmd, + @md.opt.selections.str, "#{dgst[1]} #{file}" ).warn end @@ -403,12 +403,13 @@ WOK summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.txt.dir)==true - id=if @md.opt.cmd =~/a/ then 'Plaintext (Unix (UTF-8) with footnotes)' - elsif @md.opt.cmd =~/e/ then 'Plaintext (Unix (UTF-8) with endnotes)' - elsif @md.opt.cmd =~/A/ then 'Plaintext (dos (UTF-8) with footnotes)' - elsif @md.opt.cmd =~/E/ then 'Plaintext (dos (UTF-8) with endnotes)' - else 'Plaintext (UTF-8)' - end + id='Plaintext (UTF-8)' + #id=if @md.opt.selections.str =~/a/ then 'Plaintext (Unix (UTF-8) with footnotes)' + #elsif @md.opt.selections.str =~/e/ then 'Plaintext (Unix (UTF-8) with endnotes)' + #elsif @md.opt.selections.str =~/A/ then 'Plaintext (dos (UTF-8) with footnotes)' + #elsif @md.opt.selections.str =~/E/ then 'Plaintext (dos (UTF-8) with endnotes)' + #else 'Plaintext (UTF-8)' + #end pth=@f.output_path.txt.dir rel=@f.output_path.txt.rel_sm url=@f.output_path.txt.url @@ -746,7 +747,7 @@ WOK output_metadata output_metadata_short rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/relaxng.rb b/lib/sisu/v6/relaxng.rb index 1270ada3..c8d85d44 100644 --- a/lib/sisu/v6/relaxng.rb +++ b/lib/sisu/v6/relaxng.rb @@ -61,7 +61,7 @@ =end module SiSU_Relaxng - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb class RelaxNG def gpl3_or_later @gpl3_or_later =<<RELAXNG diff --git a/lib/sisu/v6/remote.rb b/lib/sisu/v6/remote.rb index 54fd144a..3a8b58d0 100644 --- a/lib/sisu/v6/remote.rb +++ b/lib/sisu/v6/remote.rb @@ -61,7 +61,7 @@ =end module SiSU_Remote - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Put def initialize(opt) diff --git a/lib/sisu/v6/rexml.rb b/lib/sisu/v6/rexml.rb index 7321ebf5..7960a3ec 100644 --- a/lib/sisu/v6/rexml.rb +++ b/lib/sisu/v6/rexml.rb @@ -67,9 +67,9 @@ module SiSU_Rexml rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('rexml/document NOT FOUND (LoadError)') end - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Viz class Rexml @@ -130,7 +130,7 @@ module SiSU_Rexml exit end rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/se.rb index 26ce7cdf..c79f38b5 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/se.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/sysenv.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/se.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> @@ -156,7 +156,7 @@ module SiSU_Env end end module SiSU_Screen - require_relative 'screen_text_color' # screen_text_color.rb + require_relative 'utils_screen_text_color' # utils_screen_text_color.rb end module SiSU_Errors require_relative 'errors' # errors.rb diff --git a/lib/sisu/v6/se_createsite.rb b/lib/sisu/v6/se_createsite.rb index c35d24d4..450ee10d 100644 --- a/lib/sisu/v6/se_createsite.rb +++ b/lib/sisu/v6/se_createsite.rb @@ -63,7 +63,7 @@ module SiSU_Create_Site require_relative 'constants' # constants.rb require_relative 'utils' # utils.rb - require_relative 'screen_text_color' # screen_text_color.rb + require_relative 'utils_screen_text_color' # utils_screen_text_color.rb require_relative 'se_info_env' # se_info_env.rb begin require 'fileutils' @@ -190,16 +190,20 @@ module SiSU_Create_Site if defined? @rc['permission_set']['css_modify'] \ and @rc['permission_set']['css_modify'] SiSU_Screen::Ansi.new( - @opt.cmd, + @opt.selections.str, "*WARN* modify is css set to: #{@rc['permission_set']['css_modify']}" - ).warn if @opt.cmd=~/[MV]/ + ).warn if @opt.act[:verbose_plus][:set]==:on \ + or @opt.act[:maintenance][:set]==:on css_path.each do |x| if FileTest.directory?(x) FileUtils::cd(x) source=Dir.glob("*.{css}") source.each do |i| if FileTest.file?(i) - FileUtils::cp(i,"#{@env.path.output}/#{@env.path.style}") + FileUtils::cp( + i, + @env.path.output + '/' + @env.path.style + ) else STDERR.puts %{\t*WARN* did not find css - "#{i}" [#{__FILE__}:#{__LINE__}]} end end @@ -208,62 +212,63 @@ module SiSU_Create_Site end else SiSU_Screen::Ansi.new( - @opt.cmd, + @opt.selections.str, "*WARN* modify css is not set or is set to: false" - ).warn if @opt.cmd=~/[MV]/ + ).warn if @opt.act[:verbose_plus][:set]==:on \ + or @opt.act[:maintenance][:set]==:on end fn_css=SiSU_Env::CSS_Default.new css=SiSU_Style::CSS.new path_style="#{@env.path.output}/#{@env.path.style}" FileUtils::mkdir_p(path_style) \ unless FileTest.directory?(path_style) - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or not FileTest.file?("#{path_style}/#{fn_css.homepage}") style=File.new("#{path_style}/#{fn_css.homepage}",'w') style << css.homepage style.close end - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or not FileTest.file?("#{path_style}/#{fn_css.html_tables}") style=File.new("#{path_style}/#{fn_css.html_tables}",'w') style << css.html_tables style.close end - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or not FileTest.file?("#{path_style}/#{fn_css.html}") style=File.new("#{path_style}/#{fn_css.html}",'w') style << css.html style.close end - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or not FileTest.file?("#{path_style}/#{fn_css.harvest}") style=File.new("#{path_style}/#{fn_css.harvest}",'w') style << css.harvest style.close end - if @opt.cmd =~/C/ \ - or (@opt.cmd =~/[x]/ \ + if @opt.act[:site_init][:set]==:on \ + or (@opt.act[:xml_sax][:set]==:on \ and not FileTest.file?("#{path_style}/#{fn_css.xml_sax}")) style=File.new("#{path_style}/#{fn_css.xml_sax}",'w') style << css.xml_sax style.close end - if @opt.cmd =~/C/ \ - or (@opt.cmd =~/[X]/ \ + if @opt.act[:site_init][:set]==:on \ + or (@opt.act[:xml_dom][:set]==:on \ and not FileTest.file?("#{path_style}/#{fn_css.xml_dom}")) style=File.new("#{path_style}/#{fn_css.xml_dom}",'w') style << css.xml_dom style.close end - if @opt.cmd =~/C/ \ + if @opt.act[:site_init][:set]==:on \ or (@opt.act[:xml_docbook_book][:set] == :on \ and not FileTest.file?("#{path_style}/#{fn_css.xml_docbook}")) style=File.new("#{path_style}/#{fn_css.xml_docbook}",'w') style << css.xml_docbook style.close end - if @opt.cmd =~/C/ \ - or (@opt.cmd =~/[b]/ \ + if @opt.act[:site_init][:set]==:on \ + or (@opt.act[:xhtml][:set] == :on \ and not FileTest.file?("#{path_style}/#{fn_css.xhtml}")) style=File.new("#{path_style}/#{fn_css.xhtml}",'w') style << css.xhtml diff --git a/lib/sisu/v6/se_db.rb b/lib/sisu/v6/se_db.rb index 37b51ed2..542b4ef3 100644 --- a/lib/sisu/v6/se_db.rb +++ b/lib/sisu/v6/se_db.rb @@ -94,7 +94,7 @@ module SiSU_Info_Db def psql def user(opt=nil) if opt \ - and opt.mod.inspect =~/--db-user[=-]["']?(\S+)["']+/ + and opt.selections.str.inspect =~/--db-user[=-]["']?(\S+)["']+/ $1 elsif opt \ and opt.mod =~/--webserv[=-]webrick/ @@ -176,7 +176,7 @@ module SiSU_Db_Op begin @md=md rescue - SiSU_Screen::Ansi.new(md.opt.cmd,$!,$@).rescue do + SiSU_Screen::Ansi.new(md.opt.selections.str,$!,$@).rescue do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/se_file_op.rb b/lib/sisu/v6/se_file_op.rb index 1dc02775..7338133c 100644 --- a/lib/sisu/v6/se_file_op.rb +++ b/lib/sisu/v6/se_file_op.rb @@ -188,7 +188,7 @@ module SiSU_File_Op @md,@fno=md,fno @env=SiSU_Env::InfoEnv.new(@md.fns) rescue - SiSU_Screen::Ansi.new(md.opt.cmd,$!,$@).rescue do + SiSU_Screen::Ansi.new(md.opt.selections.str,$!,$@).rescue do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/se_filemap.rb b/lib/sisu/v6/se_filemap.rb index 987f8f4f..4e5abe57 100644 --- a/lib/sisu/v6/se_filemap.rb +++ b/lib/sisu/v6/se_filemap.rb @@ -68,7 +68,7 @@ module SiSU_File_Map attr_accessor :local_sisu_source def initialize(opt='') #watch / REVIEW super() - @opt=opt #,opt.fns,opt.cmd + @opt=opt #,opt.fns,opt.selections.str @env=(@opt.fns && !(@opt.fns.empty?) \ ? (SiSU_Env::InfoEnv.new(@opt.fns)) : (SiSU_Env::InfoEnv.new('dummy.sst'))) @@ -145,7 +145,7 @@ module SiSU_File_Map ft << @md.fn[:xml_scaffold_structure_collapse] end @fnb=@md.fnb - else # still needed where/when param is not parsed + else # still needed where/when dp document param is not parsed if @opt.act[:html][:set]==:on #% --html, -h -H ft << '.html' << '.html.??' end @@ -216,7 +216,7 @@ module SiSU_File_Map ft=ft.uniq filetypes=ft.join(',') @filetypes=if filetypes !~/..+/ then '' # -r called alone, copy all - elsif @opt.cmd =~/u/ then '' # -u added, copy all, (used to create remote directory tree see output path), not the usual function of -u + elsif @opt.selections.str =~/u/ then '' # -u added, copy all, (used to create remote directory tree see output path), not the usual function of -u elsif filetypes =~/\S+?,\S+/ then '*{' + filetypes + '}' # more than one relevant file type else '*' + filetypes # one relevant file type end diff --git a/lib/sisu/v6/particulars.rb b/lib/sisu/v6/se_hub_particulars.rb index 7e850f4c..99bdf9f6 100644 --- a/lib/sisu/v6/particulars.rb +++ b/lib/sisu/v6/se_hub_particulars.rb @@ -52,7 +52,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/particulars.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/se_hub_particulars.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> @@ -67,9 +67,9 @@ module SiSU_Particulars rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('singleton NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'ao' # ao.rb class CombinedSingleton @@ -127,7 +127,7 @@ module SiSU_Particulars @md=SiSU_Param::Parameters.new(opt).get self rescue - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end @@ -138,7 +138,7 @@ module SiSU_Particulars @env=SiSU_Env::InfoEnv.new(opt.fns) self rescue - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end @@ -149,7 +149,7 @@ module SiSU_Particulars @file=SiSU_Env::FileOp.new(@md) self rescue - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end @@ -160,7 +160,7 @@ module SiSU_Particulars @ao_array=SiSU_AO::Source.new(opt).get self rescue - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end @@ -170,7 +170,7 @@ module SiSU_Particulars @sst_idx=SiSU_AO::Source.new(opt).get_idx_sst self rescue - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end @@ -180,7 +180,7 @@ module SiSU_Particulars @raw_idx=SiSU_AO::Source.new(opt).get_idx_raw self rescue - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end @@ -190,7 +190,7 @@ module SiSU_Particulars @html_idx=SiSU_AO::Source.new(opt).get_idx_html self rescue - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end @@ -200,7 +200,7 @@ module SiSU_Particulars @xhtml_idx=SiSU_AO::Source.new(opt).get_idx_xhtml self rescue - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end @@ -213,11 +213,11 @@ module SiSU_Particulars self rescue if @md - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end else - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end @@ -229,7 +229,7 @@ module SiSU_Particulars @ocn_htmlseg_map=SiSU_AO::Source.new(@md).get_map_ocn_htmlseg self rescue - SiSU_Errors::Rescued.new($!,$@,opt.cmd,opt.fnl).location do + SiSU_Errors::Rescued.new($!,$@,opt.selections.str,opt.fnl).location do __LINE__.to_s + ':' + __FILE__ end end diff --git a/lib/sisu/v6/se_info_env.rb b/lib/sisu/v6/se_info_env.rb index a03c7d65..bda773ff 100644 --- a/lib/sisu/v6/se_info_env.rb +++ b/lib/sisu/v6/se_info_env.rb @@ -1634,7 +1634,7 @@ WOK http=http.strip end def webserv_base_cgi(opt=nil) #web url for local webserv (localhost, or hostname) - http=if opt.mod.inspect =~/--webserv-(?:cgi|db|search)[=-]["']?(\S+)["']+/ + http=if opt.selections.str =~/--webserv-(?:cgi|db|search)[=-]["']?(\S+)["']+/ m=$1 (m=~/http\/\/:/) ? m : %{http://#{m}} elsif defined? @rc['webserv_cgi']['host'] \ @@ -1708,7 +1708,7 @@ WOK end end def webserv_files_from_db(opt=nil) #sort this out, messy - if opt.mod.inspect =~/--webserv-output[=-]["']?(\S+)["']+/ + if opt.selections.str =~/--webserv-output[=-]["']?(\S+)["']+/ m=$1 (m=~/(?:http|file\/)\/\/:/) ? m : %{http://#{m}} else @@ -1729,10 +1729,10 @@ WOK #%q{http://#{ENV['HTTP_HOST']}/cgi-bin} end def cgi_sample_search_form_name(opt=nil) - if opt.mod.inspect \ + if opt.selections.str \ =~/--(?:cgi-)?search-form-name[=-]["']?(\S+?\.cgi)/ $1 - elsif not opt.mod.inspect =~/--db[=-]["']?sqlite/ \ + elsif not opt.selections.str =~/--db[=-]["']?sqlite/ \ and defined? @rc['search'] \ and defined? @rc['search']['sisu'] \ and defined? @rc['search']['sisu']['action'] \ @@ -1740,7 +1740,7 @@ WOK /(?:https?:\/\/\S+?)\/([^\/]+?\.cgi)$/. match(@rc['search']['sisu']['action'])[1] else - (opt.mod.inspect =~/--db[=-]["']?sqlite/) \ + (opt.selections.str =~/--db[=-]["']?sqlite/) \ ? "#{Db[:name_prefix_db]}sqlite.cgi" \ : "#{Db[:name_prefix_db]}pg.cgi" end @@ -1783,12 +1783,12 @@ WOK path.image_source_include else if @@local_image==true - cmd=@cmd ? @cmd : '' + cmd=@selections.str ? @selections.str : '' SiSU_Screen::Ansi.new( cmd, "WARNING - no local image directory or images:", defaults[:image_local] - ).warn unless cmd =~/q/ + ).warn unless @md.opt.act[:quiet][:set]==:on @@local_image=false end url.images @@ -1813,7 +1813,7 @@ WOK @cmd, 'WARNING - image directory for external images or no such images:', :image_external - ).warn unless @cmd =~/q/ + ).warn unless @md.opt.act[:quiet][:set]==:on @@local_image=false end url.images_external @@ -1827,15 +1827,15 @@ WOK def port def webrick_port if @md \ - and @md.opt.cmd.inspect=~/-F/ \ - and @md.opt.mod.inspect=~/port=(\d+)/ + and @md.opt.act[:sample_search_form][:set]==:on \ + and @md.opt.selections.str=~/port=(\d+)/ $1 else if defined? @rc['webserv_cgi']['port'] if @rc['webserv_cgi']['port'].nil? \ and (defined? @md.opt.mod \ and not @md.opt.mod.nil? \ - and @md.opt.mod.inspect=~/webrick/) + and @md.opt.selections.str=~/webrick/) defaults[:webserv_port_cgi] elsif not @rc['webserv_cgi']['port'].nil? @rc['webserv_cgi']['port'] @@ -1847,15 +1847,15 @@ WOK end def webserv_port_cgi(opt=nil) port=if opt \ - and opt.cmd.inspect=~/-F/ \ - and opt.mod.inspect=~/port=(\d+)/ + and @md.opt.act[:sample_search_form][:set]==:on \ + and opt.selections.str=~/port=(\d+)/ $1 else port=if defined? @rc['webserv_cgi']['port'] if @rc['webserv_cgi']['port'].nil? \ and (defined? opt.mod \ and not opt.mod.nil? \ - and opt.mod.inspect=~/webrick/) + and opt.selections.str=~/webrick/) defaults[:webserv_port_cgi] elsif not @rc['webserv_cgi']['port'].nil? @rc['webserv_cgi']['port'] @@ -1864,7 +1864,7 @@ WOK else if (defined? opt.mod \ and not opt.mod.nil? \ - and opt.mod.inspect=~/webrick/) + and opt.selections.str=~/webrick/) defaults[:webserv_port_cgi] else nil end @@ -2145,7 +2145,7 @@ WOK SiSU_Screen::Ansi.new( '', '*WARN* file not found: ' + fns_pod - ).warn unless @cmd=~/q/ + ).warn unless @md.opt.act[:quiet][:set]==:on end sisupod_processing_path end @@ -2164,7 +2164,7 @@ WOK : (SiSU_Screen::Ansi.new( '', "*WARN* file not found: #{fns_pod}" - ).warn unless @cmd=~/q/) + ).warn unless @md.opt.act[:quiet][:set]==:on) sisupod_processing_path end end diff --git a/lib/sisu/v6/se_processing.rb b/lib/sisu/v6/se_processing.rb index 46bed123..32b2490a 100644 --- a/lib/sisu/v6/se_processing.rb +++ b/lib/sisu/v6/se_processing.rb @@ -465,62 +465,172 @@ module SiSU_Processing_Settings end module SiSU_Info_Processing_Flag class InfoProcessingFlag - attr_accessor :color,:cf_0,:cf_1,:cf_2,:cf_3,:cf_4,:cf_5 + attr_accessor :color,:act_0,:act_1,:act_2,:act_3,:act_4,:act_5,:act_6,:act_7,:act_8,:act_9 def initialize @rc=SiSU_Get_Init::GetInit.new.sisu_yaml.rc end - def color #processing flag shortcuts + def color #configurable processing flag shortcuts (defined? @rc['flag']['color']) \ ? @rc['flag']['color'] : false end - def cf_0 #processing flag shortcuts - if defined? @rc['flag']['default'] \ - and @rc['flag']['default'].is_a?(String) - @rc['flag']['default'] - else #'-NQhewpotbxXdyYv' - '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' + def act_0 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act0'] \ + and @rc['flag']['act0'].is_a?(String) + @rc['flag']['act0'] + elsif defined? @rc['flag']['default'] \ + and @rc['flag']['default'].is_a?(String) + @rc['flag']['default'] + else + '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --verbose' + end + end + def arr + str.scan(/\S+/) + end + self + end + def act_1 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act1'] \ + and @rc['flag']['act1'].is_a?(String) + @rc['flag']['act1'] + elsif defined? @rc['flag']['i'] \ + and @rc['flag']['i'].is_a?(String) + @rc['flag']['i'] + else + '--digest --text --html --manifest' + end + end + def arr + str.scan(/\S+/) + end + self + end + def act_2 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act2'] \ + and @rc['flag']['act2'].is_a?(String) + @rc['flag']['act2'] + elsif defined? @rc['flag']['ii'] \ + and @rc['flag']['ii'].is_a?(String) + @rc['flag']['ii'] + else + '--digest --text --html --epub --pdf --manifest' + end + end + def arr + str.scan(/\S+/) + end + self + end + def act_3 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act3'] \ + and @rc['flag']['act3'].is_a?(String) + @rc['flag']['act3'] + elsif defined? @rc['flag']['iii'] \ + and @rc['flag']['iii'].is_a?(String) + @rc['flag']['iii'] + else + '--digest --qrcode --text --html --epub --concordance --pdf --manifest' + end + end + def arr + str.scan(/\S+/) + end + self + end + def act_4 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act4'] \ + and @rc['flag']['act4'].is_a?(String) + @rc['flag']['act4'] + elsif defined? @rc['flag']['iv'] \ + and @rc['flag']['iv'].is_a?(String) + @rc['flag']['iv'] + else + '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --manifest' + end + end + def arr + str.scan(/\S+/) end + self end - def cf_1 #processing flag shortcuts - if defined? @rc['flag']['i'] \ - and @rc['flag']['i'].is_a?(String) - @rc['flag']['i'] - else #'-Qhewpoty' - '--digest --qrcode --text --html --epub --concordance --pdf --manifest' + def act_5 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act5'] \ + and @rc['flag']['act5'].is_a?(String) + @rc['flag']['act5'] + elsif defined? @rc['flag']['v'] \ + and @rc['flag']['v'].is_a?(String) + @rc['flag']['v'] + else + '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --sqlite --manifest' + end end + def arr + str.scan(/\S+/) + end + self end - def cf_2 #processing flag shortcuts - if defined? @rc['flag']['ii'] \ - and @rc['flag']['ii'].is_a?(String) - @rc['flag']['ii'] - else #'-NQhewpotbxXdy' - '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --manifest' + def act_6 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act6'] \ + and @rc['flag']['act6'].is_a?(String) + @rc['flag']['act6'] + else + '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' + end + end + def arr + str.scan(/\S+/) end + self end - def cf_3 #processing flag shortcuts - if defined? @rc['flag']['iii'] \ - and @rc['flag']['iii'].is_a?(String) - @rc['flag']['iii'] - else #'-NQhewpotbxXdyY' - '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest' + def act_7 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act7'] \ + and @rc['flag']['act7'].is_a?(String) + @rc['flag']['act7'] + else + '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --source --sisupod --manifest' + end + end + def arr + str.scan(/\S+/) end + self end - def cf_4 #processing flag shortcuts - if defined? @rc['flag']['iv'] \ - and @rc['flag']['iv'].is_a?(String) - @rc['flag']['iv'] - else #'-NQhewpotbxXdDyY --update' - '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --postresql --update --manifest' + def act_8 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act8'] \ + and @rc['flag']['act8'].is_a?(String) + @rc['flag']['act8'] + else + '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --manifest' + end end + def arr + str.scan(/\S+/) + end + self end - def cf_5 #processing flag shortcuts - if defined? @rc['flag']['v'] \ - and @rc['flag']['v'].is_a?(String) - @rc['flag']['v'] - else #'-NQhewpotbxXdyYsS' - '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --sqlite --manifest --sisupod --source' + def act_9 #configurable processing flag shortcuts + def str + if defined? @rc['flag']['act9'] \ + and @rc['flag']['act9'].is_a?(String) + @rc['flag']['act9'] + else + '--digest --qrcode --text --html --epub --concordance --pdf --odf --docbook --xhtml --xml-sax --xml-dom --pg --update --source --sisupod --manifest' + end + end + def arr + str.scan(/\S+/) end + self end end end diff --git a/lib/sisu/v6/se_programs.rb b/lib/sisu/v6/se_programs.rb index 5771c4a4..448ac98e 100644 --- a/lib/sisu/v6/se_programs.rb +++ b/lib/sisu/v6/se_programs.rb @@ -87,7 +87,7 @@ module SiSU_Sys_Call end @sys.locale end - def file_encoding(filename,cmd='') #file encoding + def file_encoding(filename,act='') #file encoding program='file' fnsp=SiSU_Env::InfoEnv.new(filename).source_file_with_path if program_found?(program) @@ -98,9 +98,13 @@ module SiSU_Sys_Call encoding else 'UTF-8 assumed, encoding undetermined' end - puts encoding if cmd =~/[VM]/ + if act[:verbose_plus][:set] ==:on \ + or act[:maintenance][:set] ==:on + puts encoding + end encoding - else encoding='UTF-8 assumed, file encoding check program unavailable' + else + 'UTF-8 assumed, file encoding check program unavailable' end end def wc #word count diff --git a/lib/sisu/v6/shared_images.rb b/lib/sisu/v6/shared_images.rb index 536a2f21..073ed6d8 100644 --- a/lib/sisu/v6/shared_images.rb +++ b/lib/sisu/v6/shared_images.rb @@ -60,7 +60,7 @@ ** Description: common file for xml generation =end module SiSU_Images - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb class Source def initialize(opt) @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt) diff --git a/lib/sisu/v6/shared_sem.rb b/lib/sisu/v6/shared_sem.rb index 02c04a85..26fe5884 100644 --- a/lib/sisu/v6/shared_sem.rb +++ b/lib/sisu/v6/shared_sem.rb @@ -62,7 +62,7 @@ =end module SiSU_Sem - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb class Tags def initialize(para,md) @para,@md=para,md diff --git a/lib/sisu/v6/sitemaps.rb b/lib/sisu/v6/sitemaps.rb index 0b19314a..e656693a 100644 --- a/lib/sisu/v6/sitemaps.rb +++ b/lib/sisu/v6/sitemaps.rb @@ -57,13 +57,13 @@ <ralph@amissah.com> <ralph.amissah@gmail.com> - ** Description: sitemap created from parameters extracted from input file(s) + ** Description: sitemap created from document parameters =end module SiSU_Sitemaps - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'xml_shared' # xml_shared.rb include SiSU_XML_Munge diff --git a/lib/sisu/v6/src_kdissert_share.rb b/lib/sisu/v6/src_kdissert_share.rb index 8d6e95fa..ebe761f0 100644 --- a/lib/sisu/v6/src_kdissert_share.rb +++ b/lib/sisu/v6/src_kdissert_share.rb @@ -61,7 +61,7 @@ =end module SiSU_KdiSource - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source begin diff --git a/lib/sisu/v6/src_share.rb b/lib/sisu/v6/src_share.rb index b132038a..c043f42b 100644 --- a/lib/sisu/v6/src_share.rb +++ b/lib/sisu/v6/src_share.rb @@ -63,7 +63,7 @@ module SiSU_Markup require_relative 'src_shared' # src_shared.rb include SiSU_Source - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source < SiSU_Source::SiSUpodSource def initialize(opt,build=nil,place=nil) diff --git a/lib/sisu/v6/src_shared.rb b/lib/sisu/v6/src_shared.rb index 514e0458..f36bf308 100644 --- a/lib/sisu/v6/src_shared.rb +++ b/lib/sisu/v6/src_shared.rb @@ -63,8 +63,8 @@ module SiSU_Source include SiSU_Env class SiSUpodSource - require_relative 'sysenv' # sysenv.rb - require_relative 'particulars' # particulars.rb + require_relative 'se' # se.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb def initialize(opt,build=nil,place=nil) @opt=opt @date=SiSU_Env::InfoDate.new.dt diff --git a/lib/sisu/v6/src_sisupod_make.rb b/lib/sisu/v6/src_sisupod_make.rb index a1319e32..57f13e66 100644 --- a/lib/sisu/v6/src_sisupod_make.rb +++ b/lib/sisu/v6/src_sisupod_make.rb @@ -63,10 +63,10 @@ module SiSU_Doc require_relative 'src_shared' # scr_shared.rb include SiSU_Source - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source < SiSU_Source::SiSUpodSource - require_relative 'response' # response.rb + require_relative 'utils_response' # utils_response.rb def initialize(opt,build=nil,place=nil) super(opt,build,place) @zipfile=@opt.fno.gsub(/(?:\~\S{2,3})?(\.ss[tm])$/,'\1') diff --git a/lib/sisu/v6/sst_convert_markup.rb b/lib/sisu/v6/sst_convert_markup.rb index 8d523d0f..6e73d25f 100644 --- a/lib/sisu/v6/sst_convert_markup.rb +++ b/lib/sisu/v6/sst_convert_markup.rb @@ -65,7 +65,7 @@ module SiSU_Modify require_relative 'sst_identify_markup' # sst_identify_markup.rb require_relative 'sst_from_xml' # sst_from_xml.rb - require_relative 'response' # response.rb + require_relative 'utils_response' # utils_response.rb class ConvertMarkup def initialize(opt) @opt=opt @@ -311,7 +311,7 @@ WOK end end #%% files to match for this conversion set -------------------------> -require_relative 'options' # options.rb +require_relative 'hub_options' # hub_options.rb argv=$* base_path=Dir.pwd @opt=SiSU_Commandline::Options.new(argv,base_path) diff --git a/lib/sisu/v6/sst_do_inline_footnotes.rb b/lib/sisu/v6/sst_do_inline_footnotes.rb index 7affab1f..afa4ca3a 100644 --- a/lib/sisu/v6/sst_do_inline_footnotes.rb +++ b/lib/sisu/v6/sst_do_inline_footnotes.rb @@ -64,9 +64,9 @@ module SiSU_ConvertFootnotes require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param require_relative 'ao_syntax' # ao_syntax.rb include SiSU_AO_Syntax @@ -277,7 +277,7 @@ module SiSU_ConvertFootnotes data=@data tuned_file=[] data.each do |para| - if @md.markup =~/0\.16|0\.37/ #parameters not extracted/available + if @md.markup =~/0\.16|0\.37/ #parameters not extracted/available para.gsub!(/^0~\S+\s+/,'@\1: ') para.gsub!(/^1~/,':A~') para.gsub!(/^2~/,':B~') diff --git a/lib/sisu/v6/sst_from_xml.rb b/lib/sisu/v6/sst_from_xml.rb index 12919a17..56083ff9 100644 --- a/lib/sisu/v6/sst_from_xml.rb +++ b/lib/sisu/v6/sst_from_xml.rb @@ -62,7 +62,7 @@ =end module SiSU_sstFromXML - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb class Convert begin require 'rexml/document' diff --git a/lib/sisu/v6/sst_to_s_xml_sax.rb b/lib/sisu/v6/sst_to_s_xml_sax.rb index ecdfb94e..0be6ffa0 100644 --- a/lib/sisu/v6/sst_to_s_xml_sax.rb +++ b/lib/sisu/v6/sst_to_s_xml_sax.rb @@ -61,13 +61,13 @@ =end module SiSU_SimpleXML_ModelSax - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'ao_doc_str' # ao_doc_str.rb require_relative 'xml_shared' # xml_shared.rb diff --git a/lib/sisu/v6/termsheet.rb b/lib/sisu/v6/termsheet.rb index 834ca819..60202725 100644 --- a/lib/sisu/v6/termsheet.rb +++ b/lib/sisu/v6/termsheet.rb @@ -62,8 +62,8 @@ sample files must be provided - (saved till later as may confuse) =end -require_relative 'sysenv' # sysenv.rb -require_relative 'param' # param.rb +require_relative 'se' # se.rb +require_relative 'dp' # dp.rb include SiSU_Param @do,@done,@used,@html_output,@txt_input,@txt_output,@@report=Array.new(7){[]} @@info=nil @@ -123,7 +123,7 @@ WOK @@report << @done << @used << "\n" @done,@used=[],[] end -require_relative 'param' # param.rb +require_relative 'dp' # dp.rb @argv=$* @proc="#{@argv[0].to_s}" if @proc =~ /^-?[wft]/ diff --git a/lib/sisu/v6/texinfo.rb b/lib/sisu/v6/texinfo.rb index 459d3ac5..509afdd7 100644 --- a/lib/sisu/v6/texinfo.rb +++ b/lib/sisu/v6/texinfo.rb @@ -62,7 +62,7 @@ =end module SiSU_TexInfo require_relative 'html' # html.rb - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz #include Stamp ... needed removed arbitrarily 2005w05/1 (warnings about undefined flags) @@ -132,7 +132,7 @@ module SiSU_TexInfo @marshalfile=SiSU_Env::InfoFile.new(@opt.fns).marshal.ao_content if FileTest.file?(@marshalfile)==true File.open(@marshalfile) { |f| @@tuned_file=Marshal.load(f)} - #tell.meta_verse_skipped if @opt.cmd =~/[vVM]/ + #tell.meta_verse_skipped if @opt.selections.str =~/[vVM]/ else tex_array=IO.readlines(@opt.fns,'') SiSU_Metaverse.songsheet(tex_array) @@ -418,7 +418,7 @@ module SiSU_TexInfo pwd=Dir.pwd case sfx when /(?:-|ssm\.)?sst$/ - @env=SiSU_Env::InfoEnv.new(@md.fns,@md.opt.cmd) + @env=SiSU_Env::InfoEnv.new(@md.fns,@md.opt.selections.str) Dir.chdir(@env.processing_path.texi) texinfo=SiSU_Env::SystemCall.new("#{fnb}.texinfo") texinfo.makeinfo diff --git a/lib/sisu/v6/texinfo_format.rb b/lib/sisu/v6/texinfo_format.rb index 884abfcb..66ebbc7b 100644 --- a/lib/sisu/v6/texinfo_format.rb +++ b/lib/sisu/v6/texinfo_format.rb @@ -62,7 +62,7 @@ =end module SiSU_TexInfoFormat @@table_pg_break_counter=1 - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class Texinfo diff --git a/lib/sisu/v6/texpdf.rb b/lib/sisu/v6/texpdf.rb index 2869c59b..42e8383f 100644 --- a/lib/sisu/v6/texpdf.rb +++ b/lib/sisu/v6/texpdf.rb @@ -68,7 +68,7 @@ module SiSU_TeX end require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'texpdf_format' # texpdf_format.rb include SiSU_TeX_Pdf @@ -87,7 +87,7 @@ module SiSU_TeX rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Viz require_relative 'ao' # ao.rb @@ -107,7 +107,7 @@ module SiSU_TeX Dir.mkdir(@env.processing_path.tex) unless FileTest.directory?(@env.processing_path.tex) end rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -148,7 +148,7 @@ module SiSU_TeX end end @md=@particulars.md - $flag=@md.opt.cmd #introduced to pass 0 for no object citation numbers... to texpdf_format + $flag=@md.opt.selections.str #introduced to pass 0 for no object citation numbers... to texpdf_format directories #% needed needs to be reprogrammed !!! ao_array=SiSU_AO::Source.new(@opt).get # ao file drawn here @@ -158,7 +158,7 @@ module SiSU_TeX SiSU_TeX::Source::LaTeXtoPdf.new(@md,@particulars.env).latexrun_selective Dir.chdir(pwd) rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -180,7 +180,7 @@ module SiSU_TeX @@date=SiSU_Env::InfoDate.new @@flag={} $flag=1 #remove at some stage - SiSU_Env::Clear.new(@opt.cmd,@opt.fns).param_instantiate + SiSU_Env::Clear.new(@opt.selections.str,@opt.fns).param_instantiate end end private @@ -194,7 +194,7 @@ module SiSU_TeX @texfilename=texfilename @@n_lpdf=@@n_lpdf+1 tex_fn_base=@texfilename.gsub(/\.tex$/,'') - tell=SiSU_Screen::Ansi.new(@md.opt.cmd) + tell=SiSU_Screen::Ansi.new(@md.opt.selections.str) if @md.opt.act[:pdf_p][:set]==:on if (@md.opt.act[:verbose][:set]==:on \ || @md.opt.act[:verbose_plus][:set]==:on \ @@ -204,13 +204,21 @@ module SiSU_TeX "#{papersize} portrait ->" ).dark_grey_title_hi end - cmd=SiSU_Env::SystemCall.new("#{tex_fn_base}.tex",'',@md.opt.cmd) - tell.grey_open if @md.opt.cmd =~/[MVv]/ + cmd=SiSU_Env::SystemCall.new("#{tex_fn_base}.tex",'',@md.opt.selections.str) + if @md.opt.act[:verbose][:set]==:on \ + || @md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on + tell.grey_open + end if "#{tex_fn_base}" =~/\w+/ \ and "#{papersize}" =~/\w+/ 2.times { |i| cmd.latex2pdf(@md,papersize) } #comment out to skip processing of latex portrait end - tell.p_off if @md.opt.cmd =~/[MVv]/ + if @md.opt.act[:verbose][:set]==:on \ + || @md.opt.act[:verbose_plus][:set]==:on \ + || @md.opt.act[:maintenance][:set]==:on + tell.p_off + end end if @md.opt.act[:pdf_l][:set]==:on if (@md.opt.act[:verbose][:set]==:on \ @@ -221,7 +229,7 @@ module SiSU_TeX "#{papersize} landscape ->" ).dark_grey_title_hi end - cmd=SiSU_Env::SystemCall.new("#{tex_fn_base}.landscape.tex",'',@md.opt.cmd) + cmd=SiSU_Env::SystemCall.new("#{tex_fn_base}.landscape.tex",'',@md.opt.selections.str) if (@md.opt.act[:verbose][:set]==:on \ || @md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) @@ -357,7 +365,7 @@ module SiSU_TeX lst=Dir["*.{aux,log,out}"] lst.each {|file| File.unlink(file)} if lst rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -438,7 +446,7 @@ module SiSU_TeX data=markup(data) output(data) rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/txt_asciidoc.rb b/lib/sisu/v6/txt_asciidoc.rb index fd10b25c..fbf9bb29 100644 --- a/lib/sisu/v6/txt_asciidoc.rb +++ b/lib/sisu/v6/txt_asciidoc.rb @@ -62,7 +62,7 @@ =end module SiSU_Txt_AsciiDoc require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb @@ -121,7 +121,7 @@ module SiSU_Txt_AsciiDoc #wrap_width=(defined? md.make.plaintext_wrap) ? md.make.plaintext_wrap : 78 SiSU_Txt_AsciiDoc::Source::Scroll.new(md,ao_array,wrap_width).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/txt_markdown.rb b/lib/sisu/v6/txt_markdown.rb index 1fc488be..54d48eab 100644 --- a/lib/sisu/v6/txt_markdown.rb +++ b/lib/sisu/v6/txt_markdown.rb @@ -62,7 +62,7 @@ =end module SiSU_Txt_Markdown require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb @@ -120,7 +120,7 @@ module SiSU_Txt_Markdown #wrap_width=(defined? md.make.plaintext_wrap) ? md.make.plaintext_wrap : 78 SiSU_Txt_Markdown::Source::Scroll.new(md,ao_array,wrap_width).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/txt_plain.rb b/lib/sisu/v6/txt_plain.rb index 3f54e749..69008276 100644 --- a/lib/sisu/v6/txt_plain.rb +++ b/lib/sisu/v6/txt_plain.rb @@ -63,7 +63,7 @@ =end module SiSU_Txt_Plain require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb @@ -122,7 +122,7 @@ module SiSU_Txt_Plain #wrap_width=(defined? md.make.plaintext_wrap) ? md.make.plaintext_wrap : 78 SiSU_Txt_Plain::Source::Scroll.new(md,ao_array,wrap_width).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -139,7 +139,7 @@ module SiSU_Txt_Plain @env=SiSU_Env::InfoEnv.new(@md.fns) @brace_url=SiSU_Viz::Defaults.new.url_decoration @tab="\t" - @@endnotes_=case md.opt.mod.inspect + @@endnotes_=case md.opt.selections.str when /--footnote/ then false when /--endnote/ then true else true diff --git a/lib/sisu/v6/txt_rst.rb b/lib/sisu/v6/txt_rst.rb index e60d5761..0b3dcdde 100644 --- a/lib/sisu/v6/txt_rst.rb +++ b/lib/sisu/v6/txt_rst.rb @@ -62,7 +62,7 @@ =end module SiSU_Txt_rST require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb @@ -121,7 +121,7 @@ module SiSU_Txt_rST #wrap_width=(defined? md.make.plaintext_wrap) ? md.make.plaintext_wrap : 78 SiSU_Txt_rST::Source::Scroll.new(md,ao_array,wrap_width).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/txt_textile.rb b/lib/sisu/v6/txt_textile.rb index 00baaa1f..09ca494d 100644 --- a/lib/sisu/v6/txt_textile.rb +++ b/lib/sisu/v6/txt_textile.rb @@ -62,7 +62,7 @@ =end module SiSU_Txt_Textile require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb @@ -121,7 +121,7 @@ module SiSU_Txt_Textile #wrap_width=(defined? md.make.plaintext_wrap) ? md.make.plaintext_wrap : 78 SiSU_Txt_Textile::Source::Scroll.new(md,ao_array,wrap_width).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/update.rb b/lib/sisu/v6/update.rb index 40817138..4333b77d 100644 --- a/lib/sisu/v6/update.rb +++ b/lib/sisu/v6/update.rb @@ -61,7 +61,7 @@ =end module SiSU_UpdateControlFlag - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Param class Check @@ -81,7 +81,7 @@ module SiSU_UpdateControlFlag ).green_hi_blue unless @md.opt.act[:quiet][:set]==:on SetCF.new(@md).set_flags rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/urls.rb b/lib/sisu/v6/urls.rb index 9cc47afd..068b5e85 100644 --- a/lib/sisu/v6/urls.rb +++ b/lib/sisu/v6/urls.rb @@ -61,9 +61,9 @@ =end module SiSU_Urls - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen class Source attr_reader :opt @@ -74,7 +74,7 @@ module SiSU_Urls begin SiSU_Urls::OutputUrls.new(@opt).songsheet if @opt.fnb rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -82,11 +82,20 @@ module SiSU_Urls end end class OutputUrls - attr_reader :fns,:fnb,:cmd,:dir,:m_regular,:u + attr_reader :fns,:fnb,:act,:dir,:m_regular,:u def initialize(opt) @opt=opt @particulars=SiSU_Particulars::CombinedSingleton.instance.get_env_md(opt) - @cmd=@opt.cmd + if @particulars.is_a?(NilClass) + if @opt.act[:verbose_plus][:set]==:on \ + or @opt.act[:maintenance][:set]==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + mark("@particulars is NilClass, acceptable e.g. for --harvest") + end + exit + end + @selections=@opt.selections.str + @act=@opt.act @md=@particulars.md @env=@particulars.env @fnb=@env.fnb @@ -95,308 +104,29 @@ module SiSU_Urls @fn=SiSU_Env::EnvCall.new(@opt.fns).lang(fn_set_lang[:c]) @m_regular=/(.+?)\.(?:(?:-|ssm\.)?sst|ssm)$/ @prog=@env.program - @u ||= { - 'b --xhtml (XHTML)'=>@fn[:xhtml], - 'D[iu] --psql (DBI import/update postgresql)'=>'dbi psql', - 'd --sqlite (DBI sqlite)'=>'dbi sqlite3', - 'd[iu] --sqlite (DBI sqlite)'=>'dbi sqlite3', - 'e --epub (EPUB)'=>@fn[:epub], - 'P --pot (Pot)'=>@fn[:pot], - 'h --html (HTML segmented)'=>@fn[:toc], - 'h --html (HTML scroll)'=>@fn[:doc], - 'I --texinfo (Info file)'=>'info', - 'i --manpage (manpage)'=>'manpage', - 'm --ao (Document Abstraction)'=>'ao', - 'N --hash-digests (Digests sha512/sha256/md5)'=>@fn[:digest], - 'o --odt (ODF:ODT - Open Document)'=>@fn[:odf], - 'p --pdf (PDF landscape)'=>@fn[:pdf_l], - 'p --pdf (PDF portrait)'=>@fn[:pdf_p], - 'E --profile (Ruby profiler)'=>'profile', - 's --source (sisu markup)'=>@opt.fno, - 'S --sisupod (sisupod)'=>@fn[:sisupod], - 't --txt (Plain-text (endnotes))'=>@fn[:plain], - ' --textile (textile txt)'=>@fn[:txt_textile], - ' --asciidoc (AsciiDoc txt)'=>@fn[:txt_asciidoc], - ' --markdown (markdown txt)'=>@fn[:txt_markdown], - ' --rst (rST restructured-text)'=>@fn[:txt_rst], - ' --docbook-book (DocBook Book)'=>@fn[:xml_docbook_book], - ' --fictionbook (Fictionbook)'=>@fn[:xml_fictionbook], - 'x --xml-sax (XML sax type)'=>@fn[:sax], - 'X --xml-dom (XML dom type)'=>@fn[:dom], - ' --xml-scaffold-sisu (XML scaffold)'=>@fn[:xml_scaffold_structure_sisu], - ' --xml-scaffold-collapse (XML scaffold)'=>@fn[:xml_scaffold_structure_collapse], - 'Q --qrcode (QR Code jpg)'=>@fn[:qrcode], - 'y --manifest (Manifest, html)'=>@fn[:manifest], - 'Y (Sitemap, xml)'=>@fn[:sitemap], - 'w --concordance (Concordance, html)'=>@fn[:concordance], - }.sort {|a,b| a[0].downcase<=>b[0].downcase} end def songsheet begin - @opt.cmd=~/U/ ? urls_all : (urls_select unless @opt.act[:quiet][:set]==:on) + (@opt.act[:urls_all][:set]==:on) \ + ? urls_all \ + : (urls_select unless @opt.act[:quiet][:set]==:on) rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure end end def show - def source - def src(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.text_editor} #{@md.file.output_path.src.dir}/#{y}" - ).result - end - def pod(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.sisupod.dir}/#{y}" - ).result - end - self - end - def generic(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} #{@env.url.output_tell}/#{@fnb}/#{y}" - ).result - end - def meta(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.text_editor} ~#{y}/#{@fnb}.#{y}" - ).result - end - def text(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.txt.dir}/#{@md.file.base_filename.txt}" - ).result - end - def textile(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.textile.dir}/#{@md.file.base_filename.textile}" - ).result - end - def asciidoc(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.asciidoc.dir}/#{@md.file.base_filename.asciidoc}" - ).result - end - def markdown(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.markdown.dir}/#{@md.file.base_filename.markdown}" - ).result - end - def rst(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.rst.dir}/#{@md.file.base_filename.rst}" - ).result - end - def epub(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.epub_viewer} #{@md.file.output_path.epub.dir}/#{@md.file.base_filename.epub}" - ).result - end - def html - def scroll(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.html_scroll.dir}/#{@md.file.base_filename.html_scroll}" - ).result - end - def toc(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.html_seg.dir}/#{@md.file.base_filename.html_segtoc}" - ).result - end - def concordance(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.html_concordance.dir}/#{@md.file.base_filename.html_concordance}" - ).result - end - def manifest(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}" - ).result - end - self - end - def qrcode(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.manifest.dir}/#{@md.file.base_filename.manifest}" - ).result - end - def odt(x) + def report(x) SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.odf_viewer} file://#{@md.file.output_path.odt.dir}/#{@md.file.base_filename.odt}" + "[#{@opt.f_pth[:lng_is]}]", + x[:cmd], + x[:viewer] + ' ' \ + + x[:f_pth] ).result end - def pdf - def portrait(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_p}#{@md.papersize_array[0]}.pdf" - ).result - end - def landscape(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.pdf_viewer} #{@md.file.output_path.pdf.dir}/#{@md.file.base_filename.pdf_l}#{@md.papersize_array[0]}.pdf" - ).result - end - self - end - def manpage(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.manpage_viewer} #{@md.file.output_path.manpage.dir}/#{@md.file.base_filename.manpage}" - ).result - end - def pinfo(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "cd #{@md.file.output_path.texinfo.dir} && #{@env.program.texinfo} #{@md.file.base_filename.info}; cd -" - ).result - end - def po4a - def po(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "-#{x}", - "#{@prog.text_editor} #{@md.file.output_path.po.dir}/#{y}" - ).result - end - def pot(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "-#{x}", - "#{@prog.text_editor} #{@md.file.output_path.pot.dir}/#{y}" - ).result - end - self - end - def xhtml(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xhtml.dir}/#{@md.file.base_filename.xhtml}" - ).result - end - def xml - def sax(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_sax.dir}/#{@md.file.base_filename.xml_sax}" - ).result - end - def dom(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set],"[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_dom.dir}/#{@md.file.base_filename.xml_dom}" - ).result - end - def docbook_book(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_docbook_book.dir}/#{@md.file.base_filename.xml_docbook_book}" - ).result - end - def fictionbook(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_fictionbook.dir}/#{@md.file.base_filename.xml_fictionbook}" - ).result - end - def scaffold_structure_sisu(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_scaffold_structure_sisu.dir}/#{@md.file.base_filename.xml_scaffold_structure_sisu}" - ).result - end - def scaffold_structure_collapse(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.xml_scaffold_structure_collapse.dir}/#{@md.file.base_filename.xml_scaffold_structure_collapse}" - ).result - end - def sitemap(x) #BROKEN - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.sitemaps.dir}/#{@md.file.base_filename.sitemap}" - ).result - end - self - end - def hash_digest(x) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "#{@prog.web_browser} file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}" - ).result - end - def db - def psql(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x} DBI psql","#{@pwd_stub}::#{@opt.fns}", - y - ).result - end - def sqlite(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x} DBI sqlite", - "sqlite3 #{@env.path.webserv}/#{@md.opt.f_pth[:pth_stub]}/sisu_sqlite.db" - ).result - end - def sqlite_discrete(x,y) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - "[#{@opt.f_pth[:lng_is]}] -#{x}", - "sqlite3 #{@md.file.output_path.sqlite_discrete.dir}/#{@md.file.base_filename.sqlite_discrete}" - ).result - end - self - end self end def urls_maintenance(opt,x,y) @@ -472,8 +202,341 @@ module SiSU_Urls end end end + def report_info + def dal + { + cmd: '--ao', + fn: 'ao', + } + end + def hash_digests + { + cmd: '--hash-digests (sha512/sha256/md5)', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.hash_digest.dir + '/' \ + + @md.file.base_filename.hash_digest, + fn: @fn[:digest], + } + end + def text + def txt + { + cmd: '--txt', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.txt.dir + '/' \ + + @md.file.base_filename.txt, + fn: @fn[:plain], + } + end + def asciidoc + { + cmd: '--asciidoc', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.asciidoc.dir + '/' \ + + @md.file.base_filename.asciidoc, + fn: @fn[:txt_asciidoc], + } + end + def markdown + { + cmd: '--markdown', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.markdown.dir + '/' \ + + @md.file.base_filename.markdown, + fn: @fn[:txt_markdown], + } + end + def rst + { + cmd: '--rst', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.rst.dir + '/' \ + + @md.file.base_filename.rst, + fn: @fn[:txt_rst], + } + end + def textile + { + cmd: '--textile', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.textile.dir + '/' \ + + @md.file.base_filename.textile, + fn: @fn[:txt_textile], + } + end + self + end + def html + def seg + { + cmd: '--html-seg', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.html_seg.dir + '/' \ + + @md.file.base_filename.html_segtoc, + fn: @fn[:toc], + } + end + def scroll + { + cmd: '--html-scroll', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.html_scroll.dir + '/' \ + + @md.file.base_filename.html_scroll, + fn: @fn[:doc], + } + end + def concordance + { + cmd: '--concordance', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.html_concordance.dir + '/' \ + + @md.file.base_filename.html_concordance, + fn: @fn[:concordance], + } + end + self + end + def xhtml + def xhtml + { + cmd: '--xhtml', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xhtml.dir + '/' \ + + @md.file.base_filename.xhtml, + fn: @fn[:xhtml], + } + end + def epub + { + cmd: '--epub', + viewer: @prog.epub_viewer, + f_pth: @md.file.output_path.epub.dir + '/' \ + + @md.file.base_filename.epub, + fn: @fn[:epub], + } + end + self + end + def xml + def odt + { + cmd: '--odt (ODF:ODT)', + viewer: @prog.odf_viewer, + f_pth: @md.file.output_path.odt.dir + '/' \ + + @md.file.base_filename.odt, + fn: @fn[:odf], + } + end + def docbook + { + cmd: '--docbook', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_docbook_book.dir + '/' \ + + @md.file.base_filename.xml_docbook_book, + fn: @fn[:xml_docbook_book], + } + end + def fictionbook + { + cmd: '--fictionbook', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_fictionbook.dir + '/' \ + + @md.file.base_filename.xml_fictionbook, + fn: @fn[:xml_fictionbook], + } + end + def sax + { + cmd: '--xml-sax', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_sax.dir + '/' \ + + @md.file.base_filename.xml_sax, + fn: @fn[:sax], + } + end + def dom + { + cmd: '--xml-dom', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_dom.dir + '/' \ + + @md.file.base_filename.xml_dom, + fn: @fn[:dom], + } + end + def scaffold_sisu + { + cmd: '--xml-scaffold-sisu', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_scaffold_structure_sisu.dir + '/' \ + + @md.file.base_filename.xml_scaffold_structure_sisu, + fn: @fn[:xml_scaffold_structure_sisu], + } + end + def scaffold_collapse + { + cmd: '--xml-scaffold-collapse', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.xml_scaffold_structure_collapse.dir + '/' \ + + @md.file.base_filename.xml_scaffold_structure_collapse, + fn: @fn[:xml_scaffold_structure_collapse], + } + end + self + end + def pdf + def landscape + { + cmd: '--pdf (landscape)', + viewer: @prog.pdf_viewer, + f_pth: @md.file.output_path.pdf.dir + '/' \ + + @md.file.base_filename.pdf_l \ + + @md.papersize_array[0] + '.pdf', + fn: @fn[:pdf_l], + } + end + def portrait + { + cmd: '--pdf (portrait)', + viewer: @prog.pdf_viewer, + f_pth: @md.file.output_path.pdf.dir + '/' \ + + @md.file.base_filename.pdf_p \ + + @md.papersize_array[0] + '.pdf', + fn: @fn[:pdf_p], + } + end + self + end + def manpage + { + cmd: '--manpage', + viewer: @prog.manpage_viewer, + f_pth: @md.file.output_path.manpage.dir + '/' \ + + @md.file.base_filename.manpage, + fn: 'manpage', + } + end + def texinfo + { + cmd: '--texinfo', + viewer: '', + f_pth: 'cd ' \ + + @md.file.output_path.texinfo.dir + ' && ' \ + + @env.program.texinfo + ' ' \ + + @md.file.base_filename.info \ + + '; cd -', + fn: 'info', + } + end + def db + def psql + { + cmd: '--psql --update/--import', + viewer: '', + f_pth: @pwd_stub + '::' \ + + @opt.fns \ + + 'dbi psql', + fn: 'dbi psql', + } + end + def sqlite + { + cmd: '--sqlite --update/--import', + viewer: 'sqlite3 ', + f_pth: @env.path.webserv + '/' \ + + @md.opt.f_pth[:pth_stub] + '/' \ + + 'sisu_sqlite.db', + fn: 'dbi sqlite3', + } + end + def sqlite_discrete + { + cmd: '--sqlite --update/--import', + viewer: 'sqlite3 ', + f_pth: @md.file.output_path.sqlite_discrete.dir + '/' \ + + @md.file.base_filename.sqlite_discrete, + fn: 'dbi sqlite3', + } + end + self + end + def po4a + def po + { + cmd: '--po4a/--pot', + viewer: @prog.web_browser, + f_pth: @prog.text_editor + ' ' \ + + @md.file.output_path.po.dir \ + + '/' + y, + fn: @fn[:pot], + } + end + def pot + { + cmd: '--po4a/--pot', + viewer: @prog.web_browser, + f_pth: @prog.text_editor + ' ' \ + + @md.file.output_path.pot.dir \ + + '/' + y, + fn: @fn[:pot], + } + end + self + end + def source + { + cmd: '--source (sisu markup)', + viewer: @prog.text_editor, + f_pth: @md.file.output_path.src.dir + '/' \ + + @opt.fno, + fn: @opt.fno, + } + end + def sisupod + { + cmd: '--sisupod', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.sisupod.dir + '/' \ + + @opt.fno, + fn: @fn[:sisupod], + } + end + def ruby_profile + { + cmd: '--profile (ruby profiler)', + fn: 'profile', + } + end + def qrcode + { + cmd: '--qrcode', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.manifest.dir + '/' \ + + @md.file.base_filename.manifest, + fn: @fn[:qrcode], + } + end + def manifest + { + cmd: '--manifest', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.manifest.dir + '/' \ + + @md.file.base_filename.manifest, + fn: @fn[:manifest], + } + end + def sitemap + { + cmd: '--sitemap', + viewer: @prog.web_browser, + f_pth: @md.file.output_path.sitemaps.dir + '/' \ + + @md.file.base_filename.sitemap, + fn: @fn[:sitemap], + } + end + self + end def urls_select - unless @opt.cmd =~/q/ + unless @opt.act[:quiet][:set]==:on i1='[' + @opt.f_pth[:lng_is] + ']' i2='file://' \ + @md.file.output_path.manifest.dir + '/' \ @@ -490,168 +553,129 @@ module SiSU_Urls 'URL (output manifest)', i1, i2 ).grey_title_grey_blue - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - i1, i2, - ).flow if @opt.cmd =~/[MVv]/ + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + i1, i2, + ).flow + end end m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @pwd_stub="#{@env.url.output_tell}"[m,1] unless @opt.act[:quiet][:set]==:on - @u.each do |x,y| - if @opt.fns =~ @m_regular - if (@opt.act[:verbose][:set]==:on \ - || @opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - if x=~/--txt\b/ \ - and @opt.act[:txt][:set]==:on - show.text(x) - end - if x=~/--textile\b/ \ - and @opt.act[:txt_textile][:set]==:on - show.textile(x) - end - if x=~/--asciidoc\b/ \ - and @opt.act[:txt_asciidoc][:set]==:on - show.asciidoc(x) - end - if x=~/--markdown\b/ \ - and @opt.act[:txt_markdown][:set]==:on - show.markdown(x) - end - if x=~/--rst\b/ \ - and @opt.act[:txt_rst][:set]==:on - show.rst(x) - end - if x=~/--xhtml\b/ \ - and @opt.act[:xhtml][:set]==:on - show.xhtml(x) - end - if x=~/--psql\b/ \ - and @opt.act[:psql][:set]==:on - show.db.psql(x,y) - end - if x=~/d\s+--sqlite\b|--sql\b/ \ - and @opt.act[:sqlite_discrete][:set]==:on - show.db.sqlite_discrete(x,y) - end - if x=~/d\[iu\]\s+--sqlite\b/ \ - and @opt.act[:sqlite][:set]==:on - show.db.sqlite(x,y) - end - if x=~/--epub\b/ \ - and @opt.act[:epub][:set]==:on - show.epub(x) - end - if x=~/--html\b/ \ - and (@opt.act[:html][:set]==:on \ - or @opt.act[:html_scroll][:set]==:on \ - or @opt.act[:html_seg][:set]==:on) - if x =~/scroll/ - if @opt.act[:html_scroll][:set]==:on - show.html.scroll(x) - end - else - if @opt.act[:html_seg][:set]==:on - show.html.toc(x) - end - end - end - if x=~/--texinfo\b/ \ - and @opt.cmd =~/I/ - show.pinfo(x,y) - end - if x=~/--manpage\b/ \ - and @opt.act[:manpage][:set]==:on - show.manpage(x) - end - if x=~/--hash-digests\b/ \ - and @opt.cmd =~/N/ - show.hash_digest(x) - end - if x=~/--odt\b|--odf\b/ \ - and @opt.act[:odt][:set]==:on - show.odt(x) - end - if x=~/^P/ \ - and @opt.cmd =~/P/ - if @opt.fns =~/\S+?~\S{2}(?:_\S{2})?\.ss[mt]/ - f=y.gsub(/\.pot$/,'.po') - show.po4a.po(x,f) - else - show.po4a.pot(x,f) - end - end - if x=~/--pdf\b/ \ - and (@opt.act[:pdf][:set]==:on \ - or @opt.act[:pdf_p][:set]==:on \ - or @opt.act[:pdf_l][:set]==:on) - if x =~/portrait/ - if @opt.act[:pdf_p][:set]==:on - show.pdf.portrait(x) - end - else - if @opt.act[:pdf_l][:set]==:on - show.pdf.landscape(x) - end - end - end - if x=~/--sisupod\b/ \ - and @opt.act[:sisupod][:set]==:on - (@opt.fno =~/\.ssm$/) \ - ? y.gsub(/(?:\~\S{2,3})?(\.ssm.sst\.txz)$/,'.ssm.txz') - : y.gsub(/(?:\~\S{2,3})?(\.sst\.txz)$/,'\1') - show.source.pod(x,y) - end - if x=~/--source\b/ \ - and @opt.act[:share_source][:set]==:on - show.source.src(x,y) - end - if x=~/--concordance\b/ \ - and @opt.act[:concordance][:set]==:on - show.html.concordance(x) - end - if x=~/--xml-dom\b/ \ - and @opt.act[:xml_dom][:set]==:on - show.xml.dom(x) - end - if x=~/--xml-sax\b/ \ - and @opt.act[:xml_sax][:set]==:on - show.xml.sax(x) - end - if x=~/--docbook-book\b/ \ - and @opt.act[:xml_docbook_book][:set]==:on - show.xml.docbook_book(x) - end - if x=~/--fictionbook\b/ \ - and @opt.act[:xml_fictionbook][:set]==:on - show.xml.fictionbook(x) - end - if x=~/--xml-scaffold-sisu\b/ \ - and @opt.act[:xml_scaffold_structure_sisu][:set]==:on - show.xml.scaffold_structure_sisu(x) + if @opt.fns =~ @m_regular + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + if @opt.act[:txt][:set]==:on + show.report(report_info.text.txt) + end + if @opt.act[:txt_textile][:set]==:on + show.report(report_info.text.textile) + end + if @opt.act[:txt_asciidoc][:set]==:on + show.report(report_info.text.asciidoc) + end + if @opt.act[:txt_markdown][:set]==:on + show.report(report_info.text.markdown) + end + if @opt.act[:txt_rst][:set]==:on + show.report(report_info.text.rst) + end + if (@opt.act[:html][:set]==:on \ + or @opt.act[:html_scroll][:set]==:on \ + or @opt.act[:html_seg][:set]==:on) + if @opt.act[:html_scroll][:set]==:on + show.report(report_info.html.scroll) end - if x=~/--xml-scaffold-collapse\b/ \ - and @opt.act[:xml_scaffold_structure_collapse][:set]==:on - show.xml.scaffold_structure_collapse(x) + if @opt.act[:html_seg][:set]==:on + show.report(report_info.html.seg) end - if x=~/--qrcode\b/ \ - and @opt.act[:qrcode][:set]==:on - show.qrcode(x) + end + if @opt.act[:concordance][:set]==:on + show.report(report_info.html.concordance) + end + if @opt.act[:xhtml][:set]==:on + show.report(report_info.xhtml.xhtml) + end + if @opt.act[:epub][:set]==:on + show.report(report_info.xhtml.epub) + end + if @opt.act[:odt][:set]==:on + show.report(report_info.xml.odt) + end + if @opt.act[:xml_dom][:set]==:on + show.report(report_info.xml.dom) + end + if @opt.act[:xml_sax][:set]==:on + show.report(report_info.xml.sax) + end + if @opt.act[:xml_docbook_book][:set]==:on + show.report(report_info.xml.docbook) + end + if @opt.act[:xml_fictionbook][:set]==:on + show.report(report_info.xml.fictionbook) + end + if @opt.act[:xml_scaffold_structure_sisu][:set]==:on + show.report(report_info.xml.scaffold_structure_sisu) + end + if @opt.act[:xml_scaffold_structure_collapse][:set]==:on + show.report(report_info.xml.scaffold_collapse) + end + if (@opt.act[:pdf][:set]==:on \ + or @opt.act[:pdf_p][:set]==:on \ + or @opt.act[:pdf_l][:set]==:on) + if @opt.act[:pdf_p][:set]==:on + show.report(report_info.pdf.portrait) end - if x=~/--sitemap\b/ \ - and @opt.cmd =~/Y/ #BROKEN - show.xml.sitemap(x) + if @opt.act[:pdf_l][:set]==:on + show.report(report_info.pdf.landscape) end - if x=~/--manifest\b/ \ - and @opt.act[:manifest][:set]==:on - show.html.manifest(x) + end + if @opt.act[:psql][:set]==:on + show.report(report_info.db.psql) + end + if @opt.act[:sqlite_discrete][:set]==:on + show.report(report_info.db.sqlite_discrete) + end + if @opt.act[:sqlite][:set]==:on + show.report(report_info.db.sqlite) + end + if @opt.act[:texinfo][:set]==:on + show.report(report_info.texinfo) + end + if @opt.act[:manpage][:set]==:on + show.report(report_info.manpage) + end + if @opt.act[:hash_digests][:set]==:on + show.report(report_info.hash_digests) + end + if @opt.act[:po4a][:set]==:on + if @opt.fns =~/\S+?~\S{2}(?:_\S{2})?\.ss[mt]/ + f=y.gsub(/\.pot$/,'.po') + show.po4a.po(x,f) + else + show.po4a.pot(x,f) end end - if (@opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - urls_maintenance(@opt,x,y) + if @opt.act[:share_source][:set]==:on + show.report(report_info.source) + end + if @opt.act[:sisupod][:set]==:on + show.report(report_info.sisupod) end + if @opt.act[:qrcode][:set]==:on + show.report(report_info.qrcode) + end + if @opt.act[:manifest][:set]==:on + show.report(report_info.manifest) + end + end + if (@opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + urls_maintenance(@opt,x,y) end end end diff --git a/lib/sisu/v5/response.rb b/lib/sisu/v6/utils_response.rb index 969da001..59037c2e 100644 --- a/lib/sisu/v5/response.rb +++ b/lib/sisu/v6/utils_response.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v5/response.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/utils_response.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> diff --git a/lib/sisu/v6/screen_text_color.rb b/lib/sisu/v6/utils_screen_text_color.rb index 5c4a2f72..a11360bb 100644 --- a/lib/sisu/v6/screen_text_color.rb +++ b/lib/sisu/v6/utils_screen_text_color.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/screen_text_color.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/utils_screen_text_color.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> @@ -269,7 +269,7 @@ module SiSU_Screen blue end def result - puts "\t#{@cX.green}#{@txt[0]}#{@cX.off} #{@cX.blue}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + puts "\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.green}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off}" end def maintenance puts "\t#{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" diff --git a/lib/sisu/v6/spell.rb b/lib/sisu/v6/utils_spell.rb index a0f6e904..512280cc 100644 --- a/lib/sisu/v6/spell.rb +++ b/lib/sisu/v6/utils_spell.rb @@ -51,7 +51,7 @@ * Git <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary> - <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/spell.rb;hb=HEAD> + <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/utils_spell.rb;hb=HEAD> * Ralph Amissah <ralph@amissah.com> diff --git a/lib/sisu/v6/webrick.rb b/lib/sisu/v6/webrick.rb index 97e6548d..8ebbf2d6 100644 --- a/lib/sisu/v6/webrick.rb +++ b/lib/sisu/v6/webrick.rb @@ -70,7 +70,7 @@ module SiSU_Webserv rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('time or webrick NOT FOUND (LoadError)') end - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Screen def initialize @@ -159,7 +159,7 @@ WOK get=Dir.pwd brick(@port,get) rescue - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb SiSU_Errors::Rescued.new($!,$@,'-W',nil).location do #fix __LINE__.to_s + ':' + __FILE__ end diff --git a/lib/sisu/v6/wikispeak.rb b/lib/sisu/v6/wikispeak.rb index a7f00dee..391f552d 100644 --- a/lib/sisu/v6/wikispeak.rb +++ b/lib/sisu/v6/wikispeak.rb @@ -62,7 +62,7 @@ =end module SiSU_Wikispeak require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Param include SiSU_Viz @@ -102,7 +102,7 @@ module SiSU_Wikispeak @ao_array=SiSU_AO::Source.new(@opt).get # ao file drawn here SiSU_Wikispeak::Source::Scroll.new(@ao_array,@md).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xhtml.rb b/lib/sisu/v6/xhtml.rb index dc04e8b2..ee19a12e 100644 --- a/lib/sisu/v6/xhtml.rb +++ b/lib/sisu/v6/xhtml.rb @@ -63,9 +63,9 @@ module SiSU_XHTML require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'xml_shared' # xml_shared.rb include SiSU_XML_Munge @@ -116,7 +116,7 @@ module SiSU_XHTML end SiSU_XHTML::Source::Songsheet.new(@particulars).song rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -140,7 +140,7 @@ module SiSU_XHTML end SiSU_Rexml::Rexml.new(@md,@file.place_file.xhtml.dir).xml if @md.opt.act[:maintenance][:set]==:on # test rexml parsing, comment out when not in use #debug rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xhtml_epub2.rb b/lib/sisu/v6/xhtml_epub2.rb index e978c15d..0e65b469 100644 --- a/lib/sisu/v6/xhtml_epub2.rb +++ b/lib/sisu/v6/xhtml_epub2.rb @@ -66,7 +66,7 @@ module SiSU_XHTML_EPUB2 rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('pstore NOT FOUND (LoadError)') end - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'defaults' # defaults.rb include SiSU_Viz @@ -135,7 +135,7 @@ module SiSU_XHTML_EPUB2 SiSU_XHTML_EPUB2::Source::Seg.new(@md,data).songsheet SiSU_XHTML_EPUB2::Source::Output.new(@md).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -148,7 +148,7 @@ module SiSU_XHTML_EPUB2 end end end - SiSU_Env::Clear.new(@opt.cmd,@opt.fns).param_instantiate + SiSU_Env::Clear.new(@opt.selections.str,@opt.fns).param_instantiate @@flag,@@scr,@@seg,@@seg_endnotes,@@seg_subtoc,@@seg_ad={},{},{},{},{},{} @@seg_total,@@tracker,@@loop_count,@@tablehead,@@number_of_cols=0,0,0,0,0 @@seg_name,@@seg_name_html,@@seg_subtoc_array,@@seg_endnotes_array,@@segtocband,@@tablefoot=Array.new(7){[]} @@ -393,7 +393,7 @@ module SiSU_XHTML_EPUB2 @@toc[:seg] << toc[:seg] @@toc[:scr] << toc[:seg] rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -726,7 +726,7 @@ module SiSU_XHTML_EPUB2 end out.close rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -741,7 +741,7 @@ module SiSU_XHTML_EPUB2 end out.close rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -818,7 +818,7 @@ WOK filename_xhtml.close end rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -836,7 +836,7 @@ WOK filename_xhtml.close end rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end diff --git a/lib/sisu/v6/xhtml_epub2_concordance.rb b/lib/sisu/v6/xhtml_epub2_concordance.rb index 2fb8fb91..0a80899a 100644 --- a/lib/sisu/v6/xhtml_epub2_concordance.rb +++ b/lib/sisu/v6/xhtml_epub2_concordance.rb @@ -62,9 +62,9 @@ =end module SiSU_XHTML_EPUB2_Concordance - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'defaults' # defaults.rb include SiSU_Viz @@ -96,7 +96,7 @@ module SiSU_XHTML_EPUB2_Concordance SiSU_XHTML_EPUB2_Concordance::Source::Words.new(@particulars).songsheet end rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -157,7 +157,7 @@ WOK include SiSU_Viz require_relative 'xhtml_epub2_format' # xhtml_epub2_format.rb include SiSU_XHTML_EPUB2_Format - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Screen def initialize(particulars) @particulars=particulars @@ -181,7 +181,7 @@ WOK @rgx_splitlist=%r{[—.,;:-]+|#{Mx[:nbsp]}+}mi @rgx_scanlist=%r{#{Mx[:fa_italics_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_italics_c]}|#{Mx[:fa_bold_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_bold_c]}|#{Mx[:url_o]}https?://\S+?#{Mx[:url_c]}|file://\S+|<\S+?>|\w+|[a-zA-Z]+}mi rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -195,7 +195,7 @@ WOK @file_concordance=File.open("#{@path}/content/#{@md.fn[:epub_concord]}",'w') map_para rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xhtml_epub2_segments.rb b/lib/sisu/v6/xhtml_epub2_segments.rb index 7910a746..8f44b3e8 100644 --- a/lib/sisu/v6/xhtml_epub2_segments.rb +++ b/lib/sisu/v6/xhtml_epub2_segments.rb @@ -146,7 +146,7 @@ WOK SiSU_XHTML_EPUB2_Seg::Seg.new.cleanup # (((( added )))) #### (((( END )))) #### rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xhtml_epub2_tune.rb b/lib/sisu/v6/xhtml_epub2_tune.rb index 9222f58b..a961ef1c 100644 --- a/lib/sisu/v6/xhtml_epub2_tune.rb +++ b/lib/sisu/v6/xhtml_epub2_tune.rb @@ -60,9 +60,9 @@ ** Description: epub generation, epub pre-processing =end -require_relative 'param' +require_relative 'dp' # dp.rb module SiSU_XHTML_EPUB2_Tune - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env; include SiSU_Screen require_relative 'xhtml_epub2_format' # xhtml_epub2_format.rb #watch @@line_mode='' @@ -141,7 +141,7 @@ module SiSU_XHTML_EPUB2_Tune end SiSU_XHTML_EPUB2_Tune::Tune.new(@data,@md).output rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb index c5be78fe..1941c49d 100644 --- a/lib/sisu/v6/xml_docbook5.rb +++ b/lib/sisu/v6/xml_docbook5.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_Docbook_Book - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'txt_shared' # txt_shared.rb include SiSU_TextUtils @@ -83,12 +83,12 @@ module SiSU_XML_Docbook_Book report SiSU_XML_Docbook_Book::Source::Scroll.new(@ao_array,@md).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure - #SiSU_Env::CreateSite.new(@opt.cmd).cp_css - #SiSU_Env::CreateSite.new(@opt.cmd).cp_base_images + #SiSU_Env::CreateSite.new(@opt.selections.str).cp_css + #SiSU_Env::CreateSite.new(@opt.selections.str).cp_base_images Dir.chdir(@opt.f_pth[:pth]) end end diff --git a/lib/sisu/v6/xml_dom.rb b/lib/sisu/v6/xml_dom.rb index b92c2d51..a3a64946 100644 --- a/lib/sisu/v6/xml_dom.rb +++ b/lib/sisu/v6/xml_dom.rb @@ -63,9 +63,9 @@ module SiSU_XML_DOM require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'ao' # ao.rb require_relative 'xml_shared' # xml_shared.rb @@ -117,7 +117,7 @@ module SiSU_XML_DOM end SiSU_XML_DOM::Source::Songsheet.new(@particulars).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -141,7 +141,7 @@ module SiSU_XML_DOM end SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_dom.dir).xml if @md.opt.act[:maintenance][:set]==:on # test rexml parsing, comment out when not in use #debug rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xml_fictionbook2.rb b/lib/sisu/v6/xml_fictionbook2.rb index 04303145..36b42f8f 100644 --- a/lib/sisu/v6/xml_fictionbook2.rb +++ b/lib/sisu/v6/xml_fictionbook2.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_Fictionbook - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'txt_shared' # txt_shared.rb include SiSU_TextUtils @@ -82,7 +82,7 @@ module SiSU_XML_Fictionbook report SiSU_XML_Fictionbook::Source::Scroll.new(@ao_array,@md).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xml_format.rb b/lib/sisu/v6/xml_format.rb index d310d0ca..70c1a27f 100644 --- a/lib/sisu/v6/xml_format.rb +++ b/lib/sisu/v6/xml_format.rb @@ -62,7 +62,7 @@ =end module SiSU_XML_Format - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class ParagraphNumber diff --git a/lib/sisu/v6/xml_md_oai_pmh_dc.rb b/lib/sisu/v6/xml_md_oai_pmh_dc.rb index f3a6fae7..96dd6749 100644 --- a/lib/sisu/v6/xml_md_oai_pmh_dc.rb +++ b/lib/sisu/v6/xml_md_oai_pmh_dc.rb @@ -61,9 +61,9 @@ =end module SiSU_XML_Metadata - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param class OAI_PMH def initialize(opt) diff --git a/lib/sisu/v6/xml_odf_odt.rb b/lib/sisu/v6/xml_odf_odt.rb index 224de6da..bb69be5d 100644 --- a/lib/sisu/v6/xml_odf_odt.rb +++ b/lib/sisu/v6/xml_odf_odt.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_ODF_ODT - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env include SiSU_Viz require_relative 'xml_odf_odt_format' # xml_odf_odt_format.rb @@ -117,7 +117,7 @@ module SiSU_XML_ODF_ODT end SiSU_XML_ODF_ODT::Source::Scroll.new(@particulars).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -150,7 +150,7 @@ module SiSU_XML_ODF_ODT unless (@md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) if @env.processing_path.odt =~/od[ft]/ - #p "rm -r #{@env.processing_path.odt}" if @md.opt.cmd =~/v/ + #p "rm -r #{@env.processing_path.odt}" if @md.opt.selections.str =~/v/ FileUtils::rm_r(@env.processing_path.odf_pth) #system("rm -r #{@env.processing_path.odt}") end @@ -636,7 +636,7 @@ module SiSU_XML_ODF_ODT odf_book_idx odf_metadata data.each do |dob| - #p dob.obj if dob.obj =~safe_characters and @md.opt.cmd =~/V/ #KEEP + #p dob.obj if dob.obj =~safe_characters and @md.opt.selections.str =~/V/ #KEEP dob.obj='' if dob.obj =~/#{Mx[:lv_o]}\d+:.*?#{Mx[:lv_c]}.+?#{Mx[:pa_non_object_dummy_heading]}/ #fix Mx[:lv_o] para_array=[] dob.obj=dob.obj.gsub(/</,'<').gsub(/>/,'>') diff --git a/lib/sisu/v6/xml_odf_odt_format.rb b/lib/sisu/v6/xml_odf_odt_format.rb index b2539dfd..68457d00 100644 --- a/lib/sisu/v6/xml_odf_odt_format.rb +++ b/lib/sisu/v6/xml_odf_odt_format.rb @@ -61,7 +61,7 @@ =end module SiSU_XML_ODF_ODT_Format - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class ParagraphNumber diff --git a/lib/sisu/v6/xml_sax.rb b/lib/sisu/v6/xml_sax.rb index 68932463..d90b552b 100644 --- a/lib/sisu/v6/xml_sax.rb +++ b/lib/sisu/v6/xml_sax.rb @@ -63,9 +63,9 @@ module SiSU_XML_SAX require_relative 'defaults' # defaults.rb include SiSU_Viz - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env require_relative 'xml_shared' # xml_shared.rb include SiSU_XML_Munge @@ -116,7 +116,7 @@ module SiSU_XML_SAX end SiSU_XML_SAX::Source::Songsheet.new(@particulars).song rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -141,7 +141,7 @@ module SiSU_XML_SAX end SiSU_Rexml::Rexml.new(@md,@file.place_file.xml_sax.dir).xml if @md.opt.act[:maintenance][:set]==:on # test rexml parsing, comment out when not in use #debug rescue - SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do + SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xml_scaffold_structure_collapsed.rb b/lib/sisu/v6/xml_scaffold_structure_collapsed.rb index 9fece3bf..56f27b88 100644 --- a/lib/sisu/v6/xml_scaffold_structure_collapsed.rb +++ b/lib/sisu/v6/xml_scaffold_structure_collapsed.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_Scaffold_Structure_Collapse - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source def initialize(opt) @@ -79,7 +79,7 @@ module SiSU_XML_Scaffold_Structure_Collapse @md,@ao_array=@particulars.md,@particulars.ao_array SiSU_XML_Scaffold_Structure_Collapse::Source::Scroll.new(@ao_array,@md).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xml_scaffold_structure_sisu.rb b/lib/sisu/v6/xml_scaffold_structure_sisu.rb index a21f8347..fd37b4ea 100644 --- a/lib/sisu/v6/xml_scaffold_structure_sisu.rb +++ b/lib/sisu/v6/xml_scaffold_structure_sisu.rb @@ -61,10 +61,10 @@ =end module SiSU_XML_Scaffold_Structure_Sisu - require_relative 'particulars' # particulars.rb + require_relative 'se_hub_particulars' # se_hub_particulars.rb include SiSU_Particulars require_relative 'ao' # ao.rb - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source def initialize(opt) @@ -79,7 +79,7 @@ module SiSU_XML_Scaffold_Structure_Sisu @md,@ao_array=@particulars.md,@particulars.ao_array SiSU_XML_Scaffold_Structure_Sisu::Source::Scroll.new(@ao_array,@md).songsheet rescue - SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v6/xml_shared.rb b/lib/sisu/v6/xml_shared.rb index 38c21802..35d1132d 100644 --- a/lib/sisu/v6/xml_shared.rb +++ b/lib/sisu/v6/xml_shared.rb @@ -567,7 +567,7 @@ module SiSU_XML_Munge end end module SiSU_XML_Tags #Format - require_relative 'param' # param.rb + require_relative 'dp' # dp.rb include SiSU_Param include SiSU_Viz class RDF diff --git a/lib/sisu/v6/zap.rb b/lib/sisu/v6/zap.rb index 5e30842c..33a4ef9f 100644 --- a/lib/sisu/v6/zap.rb +++ b/lib/sisu/v6/zap.rb @@ -61,7 +61,7 @@ =end module SiSU_Zap - require_relative 'sysenv' # sysenv.rb + require_relative 'se' # se.rb include SiSU_Env class Source def initialize(opt) @@ -75,7 +75,7 @@ module SiSU_Zap unless @opt.act[:quiet][:set]==:on tell=SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], - "Clean files related to processing #{@opt.cmd} ->", + "Clean files related to processing #{@opt.selections.str} ->", "#{@opt.fns} -> #{zap_path}" ) tell.warn @@ -37,8 +37,8 @@ #require 'mkmf' #create_makefile("sisu") #% manual settings, edit/update as required (note current default settings are obtained from sisu version yml file) -SiSU_version_next_stable = '5.5.5' #% set version -SiSU_version_next_unstable = '6.1.5' #% set version +SiSU_version_next_stable = '5.5.6' #% set version +SiSU_version_next_unstable = '6.2.0' #% set version #% rake file SiSU_version_generic_next_stable = '5.4.x' SiSU_version_generic_next_unstable = '6.0.x' |