From 41796e30e4597c74e7e42c3144dbe5d4fb0687c5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 Jul 2014 21:30:56 -0400 Subject: v5 v6: cosmetic code --- lib/sisu/v6/options.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/sisu/v6/options.rb') diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v6/options.rb index 104243a3..6bf3fa0f 100644 --- a/lib/sisu/v6/options.rb +++ b/lib/sisu/v6/options.rb @@ -282,7 +282,10 @@ module SiSU_Commandline end if @cmd =~/[vVM]/ \ && @cmd !~/-[ku]*v[ku]*$/ - SiSU_Screen::Ansi.new(@cmd,"\tsisu " + @cmd + ' ' + @mod.join(' ') + ' ' + @files.join(' ') + "\n").print_brown + SiSU_Screen::Ansi.new( + @cmd, + "\tsisu " + @cmd + ' ' + @mod.join(' ') + ' ' + @files.join(' ') + "\n" + ).print_brown end end @@act ? @act=@@act : @@act=@act=opt_act -- cgit v1.2.3 From dc51608775f87b03ed41defb5a2f4ea682a07982 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 Jul 2014 21:34:52 -0400 Subject: v5 v6: options, sisupod parsing, fix --- lib/sisu/v6/options.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v6/options.rb') diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v6/options.rb index 6bf3fa0f..ae641be4 100644 --- a/lib/sisu/v6/options.rb +++ b/lib/sisu/v6/options.rb @@ -70,7 +70,7 @@ module SiSU_Commandline require_relative 'sysenv' # sysenv.rb require_relative 'param_make' # param_make.rb class HeaderCommon - def sisu_document_make_instructions + def sisu_document_make_instructions(make_instruct_array=:nil) @pagenew= @pagebreak= @pageline= @@ -87,7 +87,9 @@ module SiSU_Commandline @home_button_links= @links= nil - make_instruct_array=SiSU_Env::GetInit.new.sisu_document_make.makefile_read + make_instruct_array=make_instruct_array==:nil \ + ? SiSU_Env::GetInit.new.sisu_document_make.makefile_read + : make_instruct_array @makeset=false if make_instruct_array make_instruct_array.each do |para| #% scan document @@ -334,7 +336,7 @@ module SiSU_Commandline pod_make_path=fullname + '/sisupod/doc/_sisu' make_instruct_array=sisu_document_make_pod.makefile_read(pod_make_path) @make_instructions_pod= - HeaderCommon.new(make_instruct_array).sisu_document_make_instructions + HeaderCommon.new.sisu_document_make_instructions(make_instruct_array) Dir.chdir(pt.realpath) system(" chdir #{fullname} -- cgit v1.2.3 From f36e8bf79f92b0be3d87788e6a48605f031698da Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 Jul 2014 21:39:25 -0400 Subject: v5 v6: db, pqsl, sqlite, reorganise triggers --- lib/sisu/v6/options.rb | 157 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 135 insertions(+), 22 deletions(-) (limited to 'lib/sisu/v6/options.rb') diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v6/options.rb index ae641be4..232481c8 100644 --- a/lib/sisu/v6/options.rb +++ b/lib/sisu/v6/options.rb @@ -537,6 +537,7 @@ module SiSU_Commandline 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' @@ -554,8 +555,6 @@ module SiSU_Commandline when /^--(?:termsheet)$/ then c=c+'T' when /^--(?:manifest)$/ then c=c+'y' when /^--(?:qrcode)$/ then c=c+'Q' - when /^--(?:sqlite)$/ then c=c+'d' - when /^--(?:pg|pg?sql|postgresql)$/ then c=c+'D' when /^--(?:remote|rsync)$/ then c=c+'R' when /^--(?:scp)$/ then c=c+'r' when /^--(?:source)$/ then c=c+'s' @@ -587,8 +586,7 @@ module SiSU_Commandline extra+=if cmd =~/[abegHhIiLNOoPpQTtwXxyz]/ \ and cmd !~/[mn]/ 'm' #% add ao - elsif ((cmd =~/[Dd]/ \ - or (mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/)) \ + elsif ((mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/) \ and mod.inspect !~/(?:remove|(?:(?:re)?create(?:all)?|dropall|drop)$)/) \ and cmd !~/[mn]/ 'm' #% add ao @@ -596,18 +594,17 @@ module SiSU_Commandline end end if cmd !~/j/ - extra+=if cmd =~/[bHhwXxyz]/ \ + extra+=if cmd =~/[bdHhwXxyz]/ \ and cmd !~/[j]/ 'j' #% copy images else '' end end if cmd !~/y/ - extra+=if cmd =~/[abeHhIiNopQSstwXxz]/ \ + extra+=if cmd =~/[abdeHhIiNopQSstwXxz]/ \ and cmd !~/y/ 'ym' #% add manifest - elsif (cmd =~/[Dd]/ \ - or mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/) \ + elsif mod.inspect =~/--(?:(?:sq)?lite|pg(?:sql)?)/ \ and files[0] !~/^remove$/ \ and cmd !~/y/ 'ym' #% add manifest @@ -916,7 +913,8 @@ module SiSU_Commandline || mod.inspect =~/"--xml-dom"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:xml_docbook_book]=mod.inspect =~/"--docbook"|"--docbook-book"|"--xml-docbook"|"--xml-docbook_book"/ \ + act[:xml_docbook_book]=(cmd =~/d/ \ + || mod.inspect =~/"--docbook"|"--docbook-book"|"--xml-docbook"|"--xml-docbook_book"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } act[:xml_fictionbook]=(cmd =~/f/ \ @@ -967,19 +965,134 @@ module SiSU_Commandline || mod.inspect =~/"--texinfo"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } - act[:psql]=(cmd =~/D/ \ - || mod.inspect =~/"--pg"|"--pgsql"/) \ - ? { bool: true, set: :on } - : { bool: false, set: :na } - act[:sqlite]=(cmd =~/d/ \ - || mod.inspect =~/"--sqlite"/) \ - && (mod.inspect =~/"--createdb"|"--create(?:all)?"|"--dropall"|"--recreate(?:all)?"|"--import"|"--update"|"--remove"/) \ - ? { bool: true, set: :on } - : { bool: false, set: :na } - act[:sqlite_discrete]=(cmd =~/d/ \ - || mod.inspect =~/"--sql"|"--sqlite"/) \ - && (mod.inspect =~/"--both"/ \ - || mod.inspect !~/"--createdb"|"--create(?:all)?"|"--dropall"|"--recreate(?:all)?"|"--import"|"--update"|"--remove"/) \ + act[:psql]=if mod.inspect =~/"--pg-\S+"/ \ + or ((mod.inspect =~/"--pg"/) \ + && (mod.inspect \ + =~/"--createdb"|"--create(?:all)?"|"--dropall"|"--recreate(?:all)?"|"--import"|"--update"|"--remove"/)) + act[:psql_createdb]=if mod.inspect \ + =~/"--pg-createdb"|"--createdb"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + if mod.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 \ + =~/"--pg-dropall"|"--dropall"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + act[:psql_create]=if mod.inspect \ + =~/"--pg-create(?:all)?"|"--create(?:all)?"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + end + act[:psql_import]=if mod.inspect \ + =~/"--pg-import"|"--import"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + act[:psql_update]=if mod.inspect \ + =~/"--pg-update"|"--update"/ + act[:psql_remove]={ bool: true, set: :on } + { bool: true, set: :on } + else + act[:psql_remove]=if mod.inspect \ + =~/"--pg-remove"|"--remove"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + { bool: false, set: :na } + end + { bool: true, set: :on } + else + act[:psql_createdb]= + { bool: false, set: :na } + act[:psql_drop]= + { bool: false, set: :na } + act[:psql_create]= + { bool: false, set: :na } + act[:psql_import]= + { bool: false, set: :na } + act[:psql_update]= + { bool: false, set: :na } + act[:psql_remove]= + { 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 \ + =~/"--sqlite-createdb"|"--createdb"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + if mod.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 \ + =~/"--sqlite-create(?:all)?"|"--create(?:all)?"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + act[:sqlite_drop]=if mod.inspect \ + =~/"--sqlite-dropall"|"--dropall"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + end + act[:sqlite_import]=if mod.inspect \ + =~/"--sqlite-import"|"--import"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + act[:sqlite_update]=if mod.inspect \ + =~/"--sqlite-update"|"--update"/ + act[:sqlite_remove]={ bool: true, set: :on } + { bool: true, set: :on } + else + act[:sqlite_remove]=if mod.inspect \ + =~/"--sqlite-remove"|"--sqlite-remove"/ + { bool: true, set: :on } + else + { bool: false, set: :na } + end + { bool: false, set: :na } + end + { bool: true, set: :on } + else + act[:sqlite_createdb]= + { bool: false, set: :na } + act[:sqlite_drop]= + { bool: false, set: :na } + act[:sqlite_create]= + { bool: false, set: :na } + act[:sqlite_import]= + { bool: false, set: :na } + act[:sqlite_update]= + { bool: false, set: :na } + act[:sqlite_remove]= + { 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"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } act[:harvest]=(mod.inspect =~/"--harvest"/) \ -- cgit v1.2.3 From 0ec06db262b3ae933667cb4f71681d763985074f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 Jul 2014 21:50:52 -0400 Subject: v5 v6: sysenv, processing shortcuts, options, adjust * (further refinement necessary) --- lib/sisu/v6/options.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sisu/v6/options.rb') diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v6/options.rb index 232481c8..c71372e0 100644 --- a/lib/sisu/v6/options.rb +++ b/lib/sisu/v6/options.rb @@ -550,7 +550,7 @@ module SiSU_Commandline when /^--(?:xml-sax)$/ then c=c+'x' when /^--(?:xml-dom)$/ then c=c+'X' when /^--(?:images)$/ then c=c+'j' - when /^--(?:hash-digests)$/ then c=c+'N' + 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' @@ -1107,7 +1107,7 @@ module SiSU_Commandline ? { bool: true, set: :on } : { bool: false, set: :na } act[:hash_digests]=(cmd =~/N/ \ - || mod.inspect =~/"--hash-digests"/) \ + || mod.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)?"/ -- cgit v1.2.3