From c977c09968f2b79c122c71d58862fb50278eee61 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 31 Dec 2011 08:46:30 -0500 Subject: sha256 (3.1.10) --- data/doc/sisu/CHANGELOG_v3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index d2c6c402..10ff0851 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -17,9 +17,9 @@ v3 branch once stable will supersede & replace current stable v2 branch http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.10 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.10-1 http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.10.orig.tar.xz - sisu_3.1.10.orig.tar.xz - sisu_3.1.10-1.dsc - sisu_3.1.10-1.debian.tar.gz + 196ca267b15a6a60680dcb3d73c3790f61463705c00bf3b936119f0030109ece 1650104 sisu_3.1.10.orig.tar.xz + 9f1bfe338374af55dbc1c08ed098073535c6de3d224e773457abe5341411fa6d 1389 sisu_3.1.10-1.dsc + 35dead701be5bb0c378586fbffc924efd9c3275d00c465757c0767c049e8e1fe 290907 sisu_3.1.10-1.debian.tar.gz * html, epub, (& xml) codeblocks, treatment of '<<' & '>>', fix (codeblock, remove legacy match rule, watch) -- cgit v1.2.3 From aef3a251a37625be65c4cddb1ab14c1616e13bce Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 10 Jan 2012 22:25:52 -0500 Subject: v2 v3: 3.1.11 version & changelog "opened" --- data/doc/sisu/CHANGELOG_v2 | 4 ++++ data/doc/sisu/CHANGELOG_v3 | 8 ++++++++ data/sisu/v2/v/version.yml | 6 +++--- data/sisu/v3/v/version.yml | 6 +++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v2 b/data/doc/sisu/CHANGELOG_v2 index 8291cad0..248fff73 100644 --- a/data/doc/sisu/CHANGELOG_v2 +++ b/data/doc/sisu/CHANGELOG_v2 @@ -12,6 +12,10 @@ Reverse Chronological: %% STABLE Branch +%% 2.9.11 (2012-01-10:02/2) [see 3.1.11.orig.tar.xz] +http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.11 +http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.11-1 + %% 2.9.10 (2011-10-15:41/6) [see 3.1.1.orig.tar.xz] http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.1 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.1-1 diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 10ff0851..5a93092c 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -13,6 +13,14 @@ Reverse Chronological: %% Development branch UNSTABLE v3 branch once stable will supersede & replace current stable v2 branch +%% 3.1.11.orig.tar.xz (2012-01-10:02/2) +http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.11 +http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.11-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.11.orig.tar.xz + sisu_3.1.11.orig.tar.xz + sisu_3.1.11-1.dsc + sisu_3.1.11-1.debian.tar.gz + %% 3.1.10.orig.tar.xz (2011-12-31:52/6) http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.10 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.10-1 diff --git a/data/sisu/v2/v/version.yml b/data/sisu/v2/v/version.yml index 9b6ee9e6..fe766598 100644 --- a/data/sisu/v2/v/version.yml +++ b/data/sisu/v2/v/version.yml @@ -1,5 +1,5 @@ --- -:version: 2.9.10 -:date_stamp: 2011w41/6 -:date: "2011-10-15" +:version: 2.9.11 +:date_stamp: 2012w02/2 +:date: "2012-01-10" :project: SiSU diff --git a/data/sisu/v3/v/version.yml b/data/sisu/v3/v/version.yml index d719f3fb..94485abd 100644 --- a/data/sisu/v3/v/version.yml +++ b/data/sisu/v3/v/version.yml @@ -1,5 +1,5 @@ --- -:version: 3.1.10 -:date_stamp: 2011w52/6 -:date: "2011-12-31" +:version: 3.1.11 +:date_stamp: 2012w02/2 +:date: "2012-01-10" :project: SiSU -- cgit v1.2.3 From 9d687db126f64614d5ef05bf51e43429e7c03bd7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 10 Jan 2012 22:27:33 -0500 Subject: v2: modify, sisu markup version script (take from v3) --- data/doc/sisu/CHANGELOG_v2 | 2 ++ data/sisu/v2/conf/convert/modify.rb | 44 +++++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v2 b/data/doc/sisu/CHANGELOG_v2 index 248fff73..7101d7af 100644 --- a/data/doc/sisu/CHANGELOG_v2 +++ b/data/doc/sisu/CHANGELOG_v2 @@ -16,6 +16,8 @@ Reverse Chronological: http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.11 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.11-1 + * modify sisu markup version script + %% 2.9.10 (2011-10-15:41/6) [see 3.1.1.orig.tar.xz] http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.1 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.1-1 diff --git a/data/sisu/v2/conf/convert/modify.rb b/data/sisu/v2/conf/convert/modify.rb index 5f4f9ae0..c3fe47c9 100644 --- a/data/sisu/v2/conf/convert/modify.rb +++ b/data/sisu/v2/conf/convert/modify.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# encoding: utf-8 =begin * Name: modify.rb * Author: Ralph Amissah @@ -36,13 +37,12 @@ http://www.gnu.org/copyleft/gpl.html http://www.jus.uio.no/sisu/gpl3.fsf - © Ralph Amissah 1997, current 2006. - All Rights Reserved. + (C) Ralph Amissah 1997, current 2009. + All Rights Reserved. * Ralph Amissah: ralph@amissah.com ralph.amissah@gmail.com - * Notes: configure rc in ~/.sisu/sisurc.yaml =end module SiSU_Modify class Convert_markup @@ -51,6 +51,7 @@ module SiSU_Modify @description="This is a script that contains canned text conversions for reuse" end def current_match_and_replace #Disable, edit manually + clean_non_regular_characters #convert_pre_37_to_38_experimental end def message(text) @@ -93,6 +94,27 @@ WOK exit end #%% substitutions to be made + def clean_non_regular_characters + #/[^ a-zA-Z0-9,.!?;:/={}()%@#~\[\]"'´&$_+^-] + #/[^ a-zA-Z0-9,.!?;:/={}()%@#~\[\]"'´&$_+^•’‘`“”–ffifffflfifl-] + #message(%w{[^ a-zA-Z0-9,.!?;:/={}()%@#~\[\]"'´&$_+^-]}) + message(%q{clean non regular characters}) + [ + [/’/, "'"], + [/‘/, "'"], + [/´/, "'"], + [/`/, "'"], + [/[“”]/, '"'], + [/–/, '-'], + [/ff/, 'ff'], + [/ffi/, 'ffi'], + [/ffl/, 'ffl'], + [/fi/, 'fi'], + [/fl/, 'fl'], + [/^•/, '_* '], + [/•/, '*'] + ] + end def convert_pre_37_to_38_experimental message('convert sisu markup from 0.37 to 0.38 experimental (rad)') [ @@ -149,13 +171,13 @@ WOK p @files mr=nil #%% changes to make m match, r replace --------------------------> - if @cf =~/--help/: help + if @cf =~/--help/; help else message("WARNING, proceed at your own risk,\npermanent changes requested for the above named files\n best that you check (manually) what this file is set to do\n conversions set are at the top of the file") mr=case @cf - when /--convert|default/: current_match_and_replace - when /--(?:(?:37)?to38|rad)/: convert_pre_37_to_38_experimental - when /--(?:(?:38)?to37)/: convert_38_experimental_to_37 + when /--convert|default/; current_match_and_replace + when /--(?:(?:37)?to38|rad)/; convert_pre_37_to_38_experimental + when /--(?:(?:38)?to37)/; convert_38_experimental_to_37 else help end end @@ -190,7 +212,7 @@ WOK puts "match in #{i}" @flag_start=true cont.each do |y| - if y =~end_processing: @flag_end=true + if y =~end_processing; @flag_end=true end if @flag_start and not @flag_end match_and_replace.each do |m,r| @@ -206,11 +228,11 @@ WOK #end #if y =~m1 #end - if y=~/^\s*$/: @empty1=true + if y=~/^\s*$/; @empty1=true else @empty1=false end @file.puts y unless (@empty1==true and @empty2==true) - if y=~/^\s*$/: @empty2=true + if y=~/^\s*$/; @empty2=true else @empty2=false end #@file << y + "\n" @@ -242,7 +264,7 @@ match_and_replace=Array.new #WOK # exit #end -unless f.length > 0: f=Dir.glob("[a-z]*.ss?") #restricted to sisu type files, it need not be +unless f.length > 0; f=Dir.glob("[a-z]*.ss?") #restricted to sisu type files, it need not be end #f=Dir.glob("{bin,conf,data,lib}/**/*.rb") #sisu development #f=Dir.glob("[^_]/**/*") #all files subdirectories beneath pwd except those starting with _ -- cgit v1.2.3 From a0c28268123aa8f3aa103dcefaa09486626a140a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 10 Jan 2012 22:29:08 -0500 Subject: v3: modify.rb, prep script for year update, & changing module & class names --- data/doc/sisu/CHANGELOG_v3 | 2 + data/sisu/v3/conf/convert/modify.rb | 511 ++++++++++++++++++++++-------------- 2 files changed, 309 insertions(+), 204 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 5a93092c..d48aaad9 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -21,6 +21,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.11.orig.tar.xz sisu_3.1.11-1.dsc sisu_3.1.11-1.debian.tar.gz + * modify.rb, prep script for year update, & changing module & class names + %% 3.1.10.orig.tar.xz (2011-12-31:52/6) http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.10 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.10-1 diff --git a/data/sisu/v3/conf/convert/modify.rb b/data/sisu/v3/conf/convert/modify.rb index 858ffe08..fab7832d 100644 --- a/data/sisu/v3/conf/convert/modify.rb +++ b/data/sisu/v3/conf/convert/modify.rb @@ -1,66 +1,104 @@ #!/usr/bin/env ruby # encoding: utf-8 =begin + * Name: modify.rb - * Author: Ralph Amissah - * http://www.jus.uio.no/sisu - * http://www.jus.uio.no/sisu/SiSU/download + * Description: A conversion script for canned substitutions, - a fairly generic simple tool that can be used to store other canned conversions, - used here for altering SiSU markup - * Copyright (C) 2004, 2006 Ralph Amissah - * Packaged with: SiSU information Structuring Universe - - Structured information, Serialized Units - * SiSU Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Ralph Amissah + a fairly generic simple tool that can be used to store other canned conversions, + (used here for altering SiSU markup or the SiSU program) + + * Author: Ralph Amissah + + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. - * License: GPL 3 or later + * License: GPL 3 or later: - Summary of GPL 3 + * Packaged with: SiSU a framework for document structuring, publishing & search - 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. + Copyright (C) Ralph Amissah - 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. + 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. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + 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. - If you have Internet connection, the latest version of the GPL should be - available at these locations: - http://www.fsf.org/licenses/gpl.html - http://www.gnu.org/copyleft/gpl.html - http://www.jus.uio.no/sisu/gpl3.fsf + You should have received a copy of the GNU General Public License along with + this program. If not, see . - © Ralph Amissah 1997, current 2006. - All Rights Reserved. + If you have Internet connection, the latest version of the GPL should be + available at these locations: + + - * Ralph Amissah: ralph@amissah.com - ralph.amissah@gmail.com + + + + + * Hompages: + + + + * Download: + + + * Ralph Amissah + + - * Notes: configure rc in ~/.sisu/sisurc.yaml =end module SiSU_Modify - class Convert_markup + class Operations def initialize(cf,files) @cf,@files=cf,files @description="This is a script that contains canned text conversions for reuse" + pwd=Dir.pwd + @mod_inst='modify_instructions.rb' + @modify_instructions_script="#{pwd}/#{@mod_inst}" + if FileTest.file?(@modify_instructions_script) ==true + puts <<-WOK + autoload script: "#{@modify_instructions_script}" + used by "ruby #{__FILE__} --convert" if + "Extracted.new.modify.modules_and_classes" is used + (see "matches_and_replaces") + EDIT this file manually + [to rebuild run: "ruby #{__FILE__} --build-gsub"] + + WOK + else + puts <<-WOK + autoload script does not exist: "#{@modify_instructions_script}" + needed for "ruby #{__FILE__} --convert" if + "Extracted.new.modify.modules_and_classes" is used + (see "matches_and_replaces") + try run: "ruby #{__FILE__} --build-gsub" + + WOK + end + autoload :Extracted, "./#{@mod_inst}" end - def current_match_and_replace #Disable, edit manually - clean_non_regular_characters - #convert_pre_37_to_38_experimental + def matches_and_replaces #edit manually + [ + #Extracted.new.modify.modules_and_classes, + #Extracted.new.modify.modules, + #Extracted.new.modify.classes, + #modify.dates, + #modify.modules, + #modify.classes, + #modify.misc, + ] end def message(text) response='' while response !~/yes/ print %{ #{text} - to continue type "yes" [to exit type "no" or "quit"]: } + To continue type "yes" [to exit type "no" or "quit"]: } response=File.new('/dev/tty').gets.strip exit if response =~/^(?:quit|no)$/ end @@ -68,206 +106,271 @@ module SiSU_Modify def help print < 0 + @files.each do |i| + @new,@matched,@empty1,@empty2=true,false,false,false + file=File.open(i,'r') + cont=file.readlines + file.close + @file=File.new(i,'w') + cont.each do |t| + matches_and_replaces.each do |match_and_replace| + match_and_replace.each do |m,r| + if t =~m + p m.to_s + ' -> ' + r + puts "in: #{t}" + t.gsub!(m,r) if m and r + puts "out: #{t}" + end + end + end + if t=~/^\s*$/; @empty1=true + else @empty1=false + end + @file.puts t unless (@empty1==true and @empty2==true) + if t=~/^\s*$/; @empty2=true + else @empty2=false + end + end + @file.close + end + end end - def markup_version?(i) - file=File.open(i,'r') - cont=file.readlines - file.close - markup_version=nil - cont.each do |y| - if y =~/^:?A~/ - markup_version='0.38' - break + def report_modules_and_classes + @f=nil + @structure={} + @arr={mod: [], cl: []} + @files.each do |f| + @new,@matched,@empty1,@empty2=true,false,false,false + file=File.open(f,'r') + cont=file.readlines + file.close + cont.each do |t| + if f != @f + @f=f + @mod=nil + #puts "---\n#{@f}" + @structure[@f]={} + end + if t =~/^\s*module\s+\S+/ + @mod=t.match(/^\s*module\s+(\S+)/)[1] + #puts ' ' + @mod + @arr[:mod] << @mod + @structure[@f].store(@mod,[]) + #@structure[@f] = {@mod => []} + end + if t =~/^\s*class\s+\S+/ + cl=t.match(/^\s*class\s+(\S+)/)[1] + #puts ' ' + cl + @arr[:cl] << cl + @structure[@f][@mod] << cl + end end - if y =~/^1~/ - markup_version='0.37' - break + end + @structure.sort.each do |fl,modules| + puts "---\n" + fl + modules.sort.each do |mod,classes| + puts ' ' + mod + classes.sort.each do |cl| + puts ' ' + cl + end + end + end + puts '---' + puts 'number of modules: ' + @arr[:mod].length.to_s + ', unique: ' + @arr[:mod].uniq.length.to_s + puts 'number of classes: ' + @arr[:cl].length.to_s + ', unique: ' + @arr[:cl].uniq.length.to_s + end + def build_search_and_replace_method_for_modules_and_classes + @f=nil + @structure={} + @arr={mod: [], cl: []} + @files.each do |f| + @new,@matched,@empty1,@empty2=true,false,false,false + file=File.open(f,'r') + cont=file.readlines + file.close + cont.each do |t| + if f != @f + @f=f + @mod=nil + #puts "---\n#{@f}" + @structure[@f]={} + end + if t =~/^\s*module\s+\S+/ + @mod=t.match(/^\s*module\s+(\S+)/)[1] + #puts ' ' + @mod + @arr[:mod] << @mod + @structure[@f].store(@mod,[]) + #@structure[@f] = {@mod => []} + end + if t =~/^\s*class\s+\S+/ + cl=t.match(/^\s*class\s+(\S+)/)[1] + #puts ' ' + cl + @arr[:cl] << cl + @structure[@f][@mod] << cl + end end - #if y =~/^1{~/ - # markup_version='0.16' - # break - #end - markup_version='0.37' end - markup_version + puts 'number of modules: ' + @arr[:mod].length.to_s + ', unique: ' + @arr[:mod].uniq.length.to_s + puts 'number of classes: ' + @arr[:cl].length.to_s + ', unique: ' + @arr[:cl].uniq.length.to_s + method_modules_and_classes=[] + method_modules_and_classes <<<<-WOK +#module SiSU_MC + class Extracted + def modify + WOK + #% modules_and_classes + method_modules_and_classes <<<<-WOK + def modules_and_classes + [ + WOK + @structure.sort.each do |fl,modules| + method_modules_and_classes << ' '*8 + "##% -- " + fl + modules.sort.each do |mod,classes| + method_modules_and_classes << ' '*8 + '# ' + "[/#{mod}/," + ' '*(67 - mod.length) + "'#{mod}']," + classes.uniq.sort.each do |cl| + method_modules_and_classes << ' '*8 + '# ' + "[/#{cl}/," + ' '*(65 - cl.length) + "'#{cl}']," + end + end + end + method_modules_and_classes <<<<-WOK + ] + end + WOK + #% modules + method_modules_and_classes <<<<-WOK + def modules + [ + WOK + method_modules_and_classes << ' '*8 + '# ' + 'number of modules: ' + @arr[:mod].length.to_s + + ', unique: ' + @arr[:mod].uniq.length.to_s + @arr[:mod].uniq.sort.each do |mod| + method_modules_and_classes << ' '*8 + '# ' + "[/#{mod}/," + ' '*(67 - mod.length) + "'#{mod}']," + end + method_modules_and_classes <<<<-WOK + ] + end + WOK + #% classes + method_modules_and_classes <<<<-WOK + def classes + [ + WOK + method_modules_and_classes << ' '*8 + '# ' + 'number of classes: ' + @arr[:cl].length.to_s + + ', unique: ' + @arr[:cl].uniq.length.to_s + @arr[:cl].uniq.sort.each do |cl| + method_modules_and_classes << ' '*8 + '# ' + "[/#{cl}/," + ' '*(67 - cl.length) + "'#{cl}']," + end + method_modules_and_classes <<<<-WOK + ] + end + WOK + method_modules_and_classes <<<<-WOK + self + end + end +#end + WOK + #method_modules_and_classes.each{|x| puts x} + if FileTest.file?(@modify_instructions_script) ==true + message("WARNING << #{@mod_inst} >> exists (and may have been edited). The existing << #{@mod_inst} >> will be overwritten if you proceed.") + end + instructs=File.new(@modify_instructions_script,'w') + method_modules_and_classes.each do |x| + puts x + instructs.puts x + end + instructs.close end - def conversion - #%% do it --------------------------> + def action if @files and @files.length > 0 p @files mr=nil #%% changes to make m match, r replace --------------------------> if @cf =~/--help/; help else - message("WARNING, proceed at your own risk,\npermanent changes requested for the above named files\n best that you check (manually) what this file is set to do\n conversions set are at the top of the file") - mr=case @cf - when /--convert|default/; current_match_and_replace - when /--(?:(?:37)?to38|rad)/; convert_pre_37_to_38_experimental - when /--(?:(?:38)?to37)/; convert_38_experimental_to_37 + case @cf + when /--convert/; convert + when /--report/; report_modules_and_classes + when /--build-gsub/; build_search_and_replace_method_for_modules_and_classes else help end - end - match_and_replace=mr - #start_processing =/not used in this example/i - end_processing =/END\s+OF\s+FILE/ - @files.each do |i| - @new,@matched,@flag_start,@flag_end,@empty1,@empty2=true,false,false,false,false,false - o="#{i}.bk" #o is for old - file=File.open(i,'r') - cont=file.readlines - file.close - cont.each do |y| - #p y - #p y if y =~/^[1-6]~/ - match_and_replace.each do |m,r| - if y =~m - if @new - @new=false - File.unlink(o) if File.exists?(o) - #system("lv #{i} > #{o}") - File.rename(i,o) - File.unlink(i) if File.exists?(i) - @file=File.new(i,'w') - @matched=true - break - end - end - end - end - if @matched - puts "match in #{i}" - @flag_start=true - cont.each do |y| - if y =~end_processing; @flag_end=true - end - if @flag_start and not @flag_end - match_and_replace.each do |m,r| - if y =~m - p m.to_s + ' -> ' + r - puts "in: #{y}" - y.gsub!(m,r) if m and r - puts "out: #{y}" - end - end - end - #if y =~start_processing: @flag_start=true - #end - #if y =~m1 - #end - if y=~/^\s*$/; @empty1=true - else @empty1=false - end - @file.puts y unless (@empty1==true and @empty2==true) - if y=~/^\s*$/; @empty2=true - else @empty2=false - end - #@file << y + "\n" - end - @file.close - else puts "NO match in #{f}" - end + #act end else puts "this routine makes permanent changes to the contents of the files matched, as instructed within [no matches]" end end end end -#%% files to match for this conversion set -------------------------> -f=$* -p $* +#% files to match for this conversion set -------------------------> +f=$* #; p $* cf=f[0].to_s f.shift match_and_replace=Array.new -#unless cf and cf =~/--/ -# puts < 0; f=Dir.glob("[a-z]*.ss?") #restricted to sisu type files, it need not be +unless f.length > 0 + f=if cf == '--report' \ + or cf == '--build-gsub' + Dir.glob("[a-zA-Z]*.rb") #restrict to ruby files + else + Dir.glob("[a-zA-Z]*") + end + f=f.sort.delete_if { |x| x == __FILE__ or x == 'modify_instructions.rb' } end +SiSU_Modify::Operations.new(cf,f).action +__END__ #f=Dir.glob("{bin,conf,data,lib}/**/*.rb") #sisu development #f=Dir.glob("[^_]/**/*") #all files subdirectories beneath pwd except those starting with _ -SiSU_Modify::Convert_markup.new(cf,f).conversion -__END__ -- cgit v1.2.3 From 1677a583866e0450a134d6223081a89803f6e785 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 10 Jan 2012 22:32:13 -0500 Subject: v3: date, year 2012, update --- bin/sisu | 4 +- bin/sisu3 | 4 +- bin/sisu_termsheet | 4 +- bin/sisu_webrick | 4 +- data/doc/sisu/CHANGELOG_v3 | 2 + lib/sisu/v3/air.rb | 2 +- lib/sisu/v3/author_format.rb | 2 +- lib/sisu/v3/cgi.rb | 2 +- lib/sisu/v3/cgi_pgsql.rb | 2 +- lib/sisu/v3/cgi_sql_common.rb | 8 +- lib/sisu/v3/cgi_sqlite.rb | 2 +- lib/sisu/v3/character_encoding.rb | 2 +- lib/sisu/v3/composite.rb | 2 +- lib/sisu/v3/concordance.rb | 2 +- lib/sisu/v3/conf.rb | 2 +- lib/sisu/v3/constants.rb | 2 +- lib/sisu/v3/css.rb | 2 +- lib/sisu/v3/dal.rb | 2 +- lib/sisu/v3/dal_character_check.rb | 2 +- lib/sisu/v3/dal_doc_objects.rb | 2 +- lib/sisu/v3/dal_doc_str.rb | 2 +- lib/sisu/v3/dal_endnotes.rb | 2 +- lib/sisu/v3/dal_expand_insertions.rb | 2 +- lib/sisu/v3/dal_hash_digest.rb | 2 +- lib/sisu/v3/dal_idx.rb | 2 +- lib/sisu/v3/dal_images.rb | 2 +- lib/sisu/v3/dal_metadata.rb | 2 +- lib/sisu/v3/dal_numbering.rb | 2 +- lib/sisu/v3/dal_substitutions_and_insertions.rb | 2 +- lib/sisu/v3/dal_syntax.rb | 2 +- lib/sisu/v3/db_columns.rb | 2 +- lib/sisu/v3/db_create.rb | 2 +- lib/sisu/v3/db_dbi.rb | 2 +- lib/sisu/v3/db_drop.rb | 2 +- lib/sisu/v3/db_import.rb | 2 +- lib/sisu/v3/db_indexes.rb | 2 +- lib/sisu/v3/db_load_tuple.rb | 2 +- lib/sisu/v3/db_remove.rb | 2 +- lib/sisu/v3/db_select.rb | 2 +- lib/sisu/v3/db_sqltxt.rb | 8 +- lib/sisu/v3/db_tests.rb | 2 +- lib/sisu/v3/dbi.rb | 2 +- lib/sisu/v3/defaults.rb | 2 +- lib/sisu/v3/digests.rb | 2 +- lib/sisu/v3/embedded.rb | 2 +- lib/sisu/v3/epub.rb | 2 +- lib/sisu/v3/epub_concordance.rb | 2 +- lib/sisu/v3/epub_format.rb | 3 +- lib/sisu/v3/epub_segments.rb | 2 +- lib/sisu/v3/epub_tune.rb | 2 +- lib/sisu/v3/errors.rb | 2 +- lib/sisu/v3/git.rb | 2 +- lib/sisu/v3/harvest.rb | 2 +- lib/sisu/v3/harvest_authors.rb | 2 +- lib/sisu/v3/harvest_topics.rb | 2 +- lib/sisu/v3/help.rb | 10 +- lib/sisu/v3/html.rb | 2 +- lib/sisu/v3/html_format.rb | 2 +- lib/sisu/v3/html_minitoc.rb | 2 +- lib/sisu/v3/html_promo.rb | 2 +- lib/sisu/v3/html_scroll.rb | 2 +- lib/sisu/v3/html_segments.rb | 2 +- lib/sisu/v3/html_table.rb | 2 +- lib/sisu/v3/html_tune.rb | 2 +- lib/sisu/v3/hub.rb | 2 +- lib/sisu/v3/i18n.rb | 4 +- lib/sisu/v3/manifest.rb | 2 +- lib/sisu/v3/manpage.rb | 2 +- lib/sisu/v3/manpage_format.rb | 2 +- lib/sisu/v3/modify.rb | 376 ++++++++++++++++++++++++ lib/sisu/v3/odf.rb | 2 +- lib/sisu/v3/odf_format.rb | 2 +- lib/sisu/v3/options.rb | 2 +- lib/sisu/v3/param.rb | 2 +- lib/sisu/v3/param_identify_markup.rb | 2 +- lib/sisu/v3/particulars.rb | 2 +- lib/sisu/v3/plaintext.rb | 2 +- lib/sisu/v3/plaintext_format.rb | 2 +- lib/sisu/v3/po4a.rb | 2 +- lib/sisu/v3/po4a_set.rb | 2 +- lib/sisu/v3/prog_text_translation.rb | 2 +- lib/sisu/v3/qrcode.rb | 2 +- lib/sisu/v3/relaxng.rb | 6 +- lib/sisu/v3/remote.rb | 2 +- lib/sisu/v3/response.rb | 2 +- lib/sisu/v3/rexml.rb | 2 +- lib/sisu/v3/screen_text_color.rb | 2 +- lib/sisu/v3/share_src.rb | 2 +- lib/sisu/v3/share_src_kdissert.rb | 2 +- lib/sisu/v3/shared_html.rb | 2 +- lib/sisu/v3/shared_html_lite.rb | 2 +- lib/sisu/v3/shared_markup_alt.rb | 2 +- lib/sisu/v3/shared_metadata.rb | 2 +- lib/sisu/v3/shared_sem.rb | 2 +- lib/sisu/v3/shared_txt.rb | 2 +- lib/sisu/v3/shared_xhtml.rb | 2 +- lib/sisu/v3/shared_xml.rb | 2 +- lib/sisu/v3/sisupod_make.rb | 2 +- lib/sisu/v3/sitemaps.rb | 2 +- lib/sisu/v3/spell.rb | 2 +- lib/sisu/v3/sst_convert_markup.rb | 2 +- lib/sisu/v3/sst_do_inline_footnotes.rb | 3 +- lib/sisu/v3/sst_from_xml.rb | 2 +- lib/sisu/v3/sst_identify_markup.rb | 2 +- lib/sisu/v3/sst_to_s_xml_sax.rb | 2 +- lib/sisu/v3/sysenv.rb | 4 +- lib/sisu/v3/termsheet.rb | 2 +- lib/sisu/v3/texinfo.rb | 2 +- lib/sisu/v3/texinfo_format.rb | 2 +- lib/sisu/v3/texpdf.rb | 2 +- lib/sisu/v3/texpdf_format.rb | 2 +- lib/sisu/v3/update.rb | 2 +- lib/sisu/v3/urls.rb | 2 +- lib/sisu/v3/webrick.rb | 2 +- lib/sisu/v3/wikispeak.rb | 2 +- lib/sisu/v3/xhtml.rb | 2 +- lib/sisu/v3/xhtml_table.rb | 2 +- lib/sisu/v3/xml.rb | 2 +- lib/sisu/v3/xml_dom.rb | 2 +- lib/sisu/v3/xml_fictionbook.rb | 2 +- lib/sisu/v3/xml_format.rb | 2 +- lib/sisu/v3/xml_md_oai_pmh_dc.rb | 2 +- lib/sisu/v3/xml_scaffold.rb | 2 +- lib/sisu/v3/xml_tables.rb | 2 +- lib/sisu/v3/zap.rb | 2 +- 125 files changed, 516 insertions(+), 146 deletions(-) create mode 100644 lib/sisu/v3/modify.rb diff --git a/bin/sisu b/bin/sisu index 240cbc54..4c949760 100644 --- a/bin/sisu +++ b/bin/sisu @@ -1,6 +1,6 @@ #!/usr/bin/env ruby # encoding: utf-8 -#SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information +#SiSU: copyright (C) 1997 - 2012 Ralph Amissah; License GPL, see appended program information begin def ruby_version_ok?(base_version) @v ||=RUBY_VERSION.scan(/\d+/) @@ -88,7 +88,7 @@ __END__ * Author: Ralph Amissah * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011 Ralph Amissah All Rights Reserved. + 2007, 2008, 2009, 2010, 2011, 2012 Ralph Amissah All Rights Reserved. * License: GPL 3 or later: diff --git a/bin/sisu3 b/bin/sisu3 index 240cbc54..4c949760 100644 --- a/bin/sisu3 +++ b/bin/sisu3 @@ -1,6 +1,6 @@ #!/usr/bin/env ruby # encoding: utf-8 -#SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information +#SiSU: copyright (C) 1997 - 2012 Ralph Amissah; License GPL, see appended program information begin def ruby_version_ok?(base_version) @v ||=RUBY_VERSION.scan(/\d+/) @@ -88,7 +88,7 @@ __END__ * Author: Ralph Amissah * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011 Ralph Amissah All Rights Reserved. + 2007, 2008, 2009, 2010, 2011, 2012 Ralph Amissah All Rights Reserved. * License: GPL 3 or later: diff --git a/bin/sisu_termsheet b/bin/sisu_termsheet index a127d615..e896dd93 100644 --- a/bin/sisu_termsheet +++ b/bin/sisu_termsheet @@ -1,6 +1,6 @@ #!/usr/bin/env ruby # encoding: utf-8 -#SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information +#SiSU: copyright (C) 1997 - 2012 Ralph Amissah; License GPL, see appended program information begin def ruby_version_ok?(base_version) @v ||=RUBY_VERSION.scan(/\d+/) @@ -87,7 +87,7 @@ __END__ * Author: Ralph Amissah * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011 Ralph Amissah All Rights Reserved. + 2007, 2008, 2009, 2010, 2011, 2012 Ralph Amissah All Rights Reserved. * License: GPL 3 or later: diff --git a/bin/sisu_webrick b/bin/sisu_webrick index 52d95e41..df7895e5 100644 --- a/bin/sisu_webrick +++ b/bin/sisu_webrick @@ -1,6 +1,6 @@ #!/usr/bin/env ruby # encoding: utf-8 -#SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information +#SiSU: copyright (C) 1997 - 2012 Ralph Amissah; License GPL, see appended program information begin def ruby_version_ok?(base_version) @v ||=RUBY_VERSION.scan(/\d+/) @@ -87,7 +87,7 @@ __END__ * Author: Ralph Amissah * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011 Ralph Amissah All Rights Reserved. + 2007, 2008, 2009, 2010, 2011, 2012 Ralph Amissah All Rights Reserved. * License: GPL 3 or later: diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index d48aaad9..f5e61f28 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -21,6 +21,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.11.orig.tar.xz sisu_3.1.11-1.dsc sisu_3.1.11-1.debian.tar.gz + * date, year 2012, update + * modify.rb, prep script for year update, & changing module & class names %% 3.1.10.orig.tar.xz (2011-12-31:52/6) diff --git a/lib/sisu/v3/air.rb b/lib/sisu/v3/air.rb index 2e678f45..f5bf3286 100644 --- a/lib/sisu/v3/air.rb +++ b/lib/sisu/v3/air.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/author_format.rb b/lib/sisu/v3/author_format.rb index 847ea888..481674d0 100644 --- a/lib/sisu/v3/author_format.rb +++ b/lib/sisu/v3/author_format.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/cgi.rb b/lib/sisu/v3/cgi.rb index bdecb6ed..779ee35a 100644 --- a/lib/sisu/v3/cgi.rb +++ b/lib/sisu/v3/cgi.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/cgi_pgsql.rb b/lib/sisu/v3/cgi_pgsql.rb index 41be70d4..6fb35714 100644 --- a/lib/sisu/v3/cgi_pgsql.rb +++ b/lib/sisu/v3/cgi_pgsql.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/cgi_sql_common.rb b/lib/sisu/v3/cgi_sql_common.rb index c377e002..9f4dd457 100644 --- a/lib/sisu/v3/cgi_sql_common.rb +++ b/lib/sisu/v3/cgi_sql_common.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -79,7 +79,7 @@ module SiSU_CGI_sql * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -561,7 +561,7 @@ module SiSU_CGI_sql
#{v[:project]} © Ralph Amissah - 1993, current 2011. + 1993, current 2012. All Rights Reserved.
@@ -597,7 +597,7 @@ module SiSU_CGI_sql
Standard SiSU meta-markup syntax, and the
Standard SiSU object citation numbering and system, (object/text positioning system)
- © Ralph Amissah 1997, current 2011. + © Ralph Amissah 1997, current 2012. All Rights Reserved.

diff --git a/lib/sisu/v3/cgi_sqlite.rb b/lib/sisu/v3/cgi_sqlite.rb index 64124cc8..a046fe31 100644 --- a/lib/sisu/v3/cgi_sqlite.rb +++ b/lib/sisu/v3/cgi_sqlite.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/character_encoding.rb b/lib/sisu/v3/character_encoding.rb index f62d1dc3..0b565fb9 100644 --- a/lib/sisu/v3/character_encoding.rb +++ b/lib/sisu/v3/character_encoding.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/composite.rb b/lib/sisu/v3/composite.rb index 6dfcf0b2..95be6d1e 100644 --- a/lib/sisu/v3/composite.rb +++ b/lib/sisu/v3/composite.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/concordance.rb b/lib/sisu/v3/concordance.rb index c02824d2..a94531b6 100644 --- a/lib/sisu/v3/concordance.rb +++ b/lib/sisu/v3/concordance.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/conf.rb b/lib/sisu/v3/conf.rb index 3bae2179..05bc8608 100644 --- a/lib/sisu/v3/conf.rb +++ b/lib/sisu/v3/conf.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/constants.rb b/lib/sisu/v3/constants.rb index 1202e47c..d39c56ea 100644 --- a/lib/sisu/v3/constants.rb +++ b/lib/sisu/v3/constants.rb @@ -8,7 +8,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/css.rb b/lib/sisu/v3/css.rb index e86c3076..348c89e7 100644 --- a/lib/sisu/v3/css.rb +++ b/lib/sisu/v3/css.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index 5c059677..50cf94f9 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_character_check.rb b/lib/sisu/v3/dal_character_check.rb index c2109b9a..70cddf91 100644 --- a/lib/sisu/v3/dal_character_check.rb +++ b/lib/sisu/v3/dal_character_check.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_doc_objects.rb b/lib/sisu/v3/dal_doc_objects.rb index 8a330f13..4e8b5c0f 100644 --- a/lib/sisu/v3/dal_doc_objects.rb +++ b/lib/sisu/v3/dal_doc_objects.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb index 91110b44..c7d3087c 100644 --- a/lib/sisu/v3/dal_doc_str.rb +++ b/lib/sisu/v3/dal_doc_str.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_endnotes.rb b/lib/sisu/v3/dal_endnotes.rb index 58ac8d0c..53b6e8d3 100644 --- a/lib/sisu/v3/dal_endnotes.rb +++ b/lib/sisu/v3/dal_endnotes.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_expand_insertions.rb b/lib/sisu/v3/dal_expand_insertions.rb index cfd8fe54..e48acd47 100644 --- a/lib/sisu/v3/dal_expand_insertions.rb +++ b/lib/sisu/v3/dal_expand_insertions.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_hash_digest.rb b/lib/sisu/v3/dal_hash_digest.rb index fe432974..2c983919 100644 --- a/lib/sisu/v3/dal_hash_digest.rb +++ b/lib/sisu/v3/dal_hash_digest.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_idx.rb b/lib/sisu/v3/dal_idx.rb index ad1b5efb..5845437e 100644 --- a/lib/sisu/v3/dal_idx.rb +++ b/lib/sisu/v3/dal_idx.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_images.rb b/lib/sisu/v3/dal_images.rb index b05c7ec7..34157f74 100644 --- a/lib/sisu/v3/dal_images.rb +++ b/lib/sisu/v3/dal_images.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_metadata.rb b/lib/sisu/v3/dal_metadata.rb index 2e68c944..8647a075 100644 --- a/lib/sisu/v3/dal_metadata.rb +++ b/lib/sisu/v3/dal_metadata.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_numbering.rb b/lib/sisu/v3/dal_numbering.rb index 52cb4c7f..4b12793f 100644 --- a/lib/sisu/v3/dal_numbering.rb +++ b/lib/sisu/v3/dal_numbering.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_substitutions_and_insertions.rb b/lib/sisu/v3/dal_substitutions_and_insertions.rb index cf3309ec..5844071f 100644 --- a/lib/sisu/v3/dal_substitutions_and_insertions.rb +++ b/lib/sisu/v3/dal_substitutions_and_insertions.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dal_syntax.rb b/lib/sisu/v3/dal_syntax.rb index b887904e..2d2a8430 100644 --- a/lib/sisu/v3/dal_syntax.rb +++ b/lib/sisu/v3/dal_syntax.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_columns.rb b/lib/sisu/v3/db_columns.rb index 99118f92..10b9635f 100644 --- a/lib/sisu/v3/db_columns.rb +++ b/lib/sisu/v3/db_columns.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_create.rb b/lib/sisu/v3/db_create.rb index 5f8b2465..71d0ce09 100644 --- a/lib/sisu/v3/db_create.rb +++ b/lib/sisu/v3/db_create.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_dbi.rb b/lib/sisu/v3/db_dbi.rb index f4d5c891..c290c9e3 100644 --- a/lib/sisu/v3/db_dbi.rb +++ b/lib/sisu/v3/db_dbi.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_drop.rb b/lib/sisu/v3/db_drop.rb index cbe604e8..1baecb73 100644 --- a/lib/sisu/v3/db_drop.rb +++ b/lib/sisu/v3/db_drop.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_import.rb b/lib/sisu/v3/db_import.rb index 856817e1..a78a0656 100644 --- a/lib/sisu/v3/db_import.rb +++ b/lib/sisu/v3/db_import.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_indexes.rb b/lib/sisu/v3/db_indexes.rb index 64a51474..5e387e27 100644 --- a/lib/sisu/v3/db_indexes.rb +++ b/lib/sisu/v3/db_indexes.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_load_tuple.rb b/lib/sisu/v3/db_load_tuple.rb index f7f39c08..812e8e5a 100644 --- a/lib/sisu/v3/db_load_tuple.rb +++ b/lib/sisu/v3/db_load_tuple.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_remove.rb b/lib/sisu/v3/db_remove.rb index a390b2cc..8147cda1 100644 --- a/lib/sisu/v3/db_remove.rb +++ b/lib/sisu/v3/db_remove.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_select.rb b/lib/sisu/v3/db_select.rb index 75a0a718..bce2b21c 100644 --- a/lib/sisu/v3/db_select.rb +++ b/lib/sisu/v3/db_select.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/db_sqltxt.rb b/lib/sisu/v3/db_sqltxt.rb index f4acb2c5..d1705c2b 100644 --- a/lib/sisu/v3/db_sqltxt.rb +++ b/lib/sisu/v3/db_sqltxt.rb @@ -4,12 +4,10 @@ * 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, 2011 Ralph Amissah All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -24,7 +22,7 @@ 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 + 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 @@ -33,7 +31,7 @@ If you have Internet connection, the latest version of the GPL should be available at these locations: - + diff --git a/lib/sisu/v3/db_tests.rb b/lib/sisu/v3/db_tests.rb index babcd683..0fe1370b 100644 --- a/lib/sisu/v3/db_tests.rb +++ b/lib/sisu/v3/db_tests.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/dbi.rb b/lib/sisu/v3/dbi.rb index 7d4a5445..008ac5d4 100644 --- a/lib/sisu/v3/dbi.rb +++ b/lib/sisu/v3/dbi.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/defaults.rb b/lib/sisu/v3/defaults.rb index cefab8a1..7278c5f9 100644 --- a/lib/sisu/v3/defaults.rb +++ b/lib/sisu/v3/defaults.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/digests.rb b/lib/sisu/v3/digests.rb index eac2e81d..4062b029 100644 --- a/lib/sisu/v3/digests.rb +++ b/lib/sisu/v3/digests.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/embedded.rb b/lib/sisu/v3/embedded.rb index 45e96c04..1dcc4fac 100644 --- a/lib/sisu/v3/embedded.rb +++ b/lib/sisu/v3/embedded.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index a5c3f3b4..e0a1d219 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/epub_concordance.rb b/lib/sisu/v3/epub_concordance.rb index 3a961285..66864775 100644 --- a/lib/sisu/v3/epub_concordance.rb +++ b/lib/sisu/v3/epub_concordance.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index 9d55d1d9..40fe8816 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -598,7 +598,6 @@ module SiSU_EPUB_Format text-indent: 0em; } - p.it0 { margin-left: 0em; margin-top: 6px; diff --git a/lib/sisu/v3/epub_segments.rb b/lib/sisu/v3/epub_segments.rb index 67d0884c..6ad278f4 100644 --- a/lib/sisu/v3/epub_segments.rb +++ b/lib/sisu/v3/epub_segments.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/epub_tune.rb b/lib/sisu/v3/epub_tune.rb index 5f50bb39..b348a7bf 100644 --- a/lib/sisu/v3/epub_tune.rb +++ b/lib/sisu/v3/epub_tune.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/errors.rb b/lib/sisu/v3/errors.rb index 57b961bd..70ab4666 100644 --- a/lib/sisu/v3/errors.rb +++ b/lib/sisu/v3/errors.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/git.rb b/lib/sisu/v3/git.rb index a0e70a97..148b35fc 100644 --- a/lib/sisu/v3/git.rb +++ b/lib/sisu/v3/git.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/harvest.rb b/lib/sisu/v3/harvest.rb index ce8880f0..b8b82524 100644 --- a/lib/sisu/v3/harvest.rb +++ b/lib/sisu/v3/harvest.rb @@ -9,7 +9,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/harvest_authors.rb b/lib/sisu/v3/harvest_authors.rb index 08716f2b..996b748c 100644 --- a/lib/sisu/v3/harvest_authors.rb +++ b/lib/sisu/v3/harvest_authors.rb @@ -8,7 +8,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/harvest_topics.rb b/lib/sisu/v3/harvest_topics.rb index c489092f..de03b615 100644 --- a/lib/sisu/v3/harvest_topics.rb +++ b/lib/sisu/v3/harvest_topics.rb @@ -9,7 +9,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/help.rb b/lib/sisu/v3/help.rb index 27822e20..9dc26aec 100644 --- a/lib/sisu/v3/help.rb +++ b/lib/sisu/v3/help.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -160,7 +160,7 @@ module SiSU_Help end def summary print <. + + If you have Internet connection, the latest version of the GPL should be + available at these locations: + + + + + + + + * Hompages: + + + + * Download: + + + * Ralph Amissah + + + +=end +module SiSU_Modify + class Operations + def initialize(cf,files) + @cf,@files=cf,files + @description="This is a script that contains canned text conversions for reuse" + pwd=Dir.pwd + @mod_inst='modify_instructions.rb' + @modify_instructions_script="#{pwd}/#{@mod_inst}" + if FileTest.file?(@modify_instructions_script) ==true + puts <<-WOK + autoload script: "#{@modify_instructions_script}" + used by "ruby #{__FILE__} --convert" if + "Extracted.new.modify.modules_and_classes" is used + (see "matches_and_replaces") + EDIT this file manually + [to rebuild run: "ruby #{__FILE__} --build-gsub"] + + WOK + else + puts <<-WOK + autoload script does not exist: "#{@modify_instructions_script}" + needed for "ruby #{__FILE__} --convert" if + "Extracted.new.modify.modules_and_classes" is used + (see "matches_and_replaces") + try run: "ruby #{__FILE__} --build-gsub" + + WOK + end + autoload :Extracted, "./#{@mod_inst}" + end + def matches_and_replaces #edit manually + [ + #Extracted.new.modify.modules_and_classes, + #Extracted.new.modify.modules, + #Extracted.new.modify.classes, + modify.dates, + #modify.modules, + #modify.classes, + #modify.misc, + ] + end + def message(text) + response='' + while response !~/yes/ + print %{ + #{text} + To continue type "yes" [to exit type "no" or "quit"]: } + response=File.new('/dev/tty').gets.strip + exit if response =~/^(?:quit|no)$/ + end + end + def help + print < 0 + @files.each do |i| + @new,@matched,@empty1,@empty2=true,false,false,false + file=File.open(i,'r') + cont=file.readlines + file.close + @file=File.new(i,'w') + cont.each do |t| + matches_and_replaces.each do |match_and_replace| + match_and_replace.each do |m,r| + if t =~m + p m.to_s + ' -> ' + r + puts "in: #{t}" + t.gsub!(m,r) if m and r + puts "out: #{t}" + end + end + end + if t=~/^\s*$/; @empty1=true + else @empty1=false + end + @file.puts t unless (@empty1==true and @empty2==true) + if t=~/^\s*$/; @empty2=true + else @empty2=false + end + end + @file.close + end + end + end + def report_modules_and_classes + @f=nil + @structure={} + @arr={mod: [], cl: []} + @files.each do |f| + @new,@matched,@empty1,@empty2=true,false,false,false + file=File.open(f,'r') + cont=file.readlines + file.close + cont.each do |t| + if f != @f + @f=f + @mod=nil + #puts "---\n#{@f}" + @structure[@f]={} + end + if t =~/^\s*module\s+\S+/ + @mod=t.match(/^\s*module\s+(\S+)/)[1] + #puts ' ' + @mod + @arr[:mod] << @mod + @structure[@f].store(@mod,[]) + #@structure[@f] = {@mod => []} + end + if t =~/^\s*class\s+\S+/ + cl=t.match(/^\s*class\s+(\S+)/)[1] + #puts ' ' + cl + @arr[:cl] << cl + @structure[@f][@mod] << cl + end + end + end + @structure.sort.each do |fl,modules| + puts "---\n" + fl + modules.sort.each do |mod,classes| + puts ' ' + mod + classes.sort.each do |cl| + puts ' ' + cl + end + end + end + puts '---' + puts 'number of modules: ' + @arr[:mod].length.to_s + ', unique: ' + @arr[:mod].uniq.length.to_s + puts 'number of classes: ' + @arr[:cl].length.to_s + ', unique: ' + @arr[:cl].uniq.length.to_s + end + def build_search_and_replace_method_for_modules_and_classes + @f=nil + @structure={} + @arr={mod: [], cl: []} + @files.each do |f| + @new,@matched,@empty1,@empty2=true,false,false,false + file=File.open(f,'r') + cont=file.readlines + file.close + cont.each do |t| + if f != @f + @f=f + @mod=nil + #puts "---\n#{@f}" + @structure[@f]={} + end + if t =~/^\s*module\s+\S+/ + @mod=t.match(/^\s*module\s+(\S+)/)[1] + #puts ' ' + @mod + @arr[:mod] << @mod + @structure[@f].store(@mod,[]) + #@structure[@f] = {@mod => []} + end + if t =~/^\s*class\s+\S+/ + cl=t.match(/^\s*class\s+(\S+)/)[1] + #puts ' ' + cl + @arr[:cl] << cl + @structure[@f][@mod] << cl + end + end + end + puts 'number of modules: ' + @arr[:mod].length.to_s + ', unique: ' + @arr[:mod].uniq.length.to_s + puts 'number of classes: ' + @arr[:cl].length.to_s + ', unique: ' + @arr[:cl].uniq.length.to_s + method_modules_and_classes=[] + method_modules_and_classes <<<<-WOK +#module SiSU_MC + class Extracted + def modify + WOK + #% modules_and_classes + method_modules_and_classes <<<<-WOK + def modules_and_classes + [ + WOK + @structure.sort.each do |fl,modules| + method_modules_and_classes << ' '*8 + "##% -- " + fl + modules.sort.each do |mod,classes| + method_modules_and_classes << ' '*8 + '# ' + "[/#{mod}/," + ' '*(67 - mod.length) + "'#{mod}']," + classes.uniq.sort.each do |cl| + method_modules_and_classes << ' '*8 + '# ' + "[/#{cl}/," + ' '*(65 - cl.length) + "'#{cl}']," + end + end + end + method_modules_and_classes <<<<-WOK + ] + end + WOK + #% modules + method_modules_and_classes <<<<-WOK + def modules + [ + WOK + method_modules_and_classes << ' '*8 + '# ' + 'number of modules: ' + @arr[:mod].length.to_s + + ', unique: ' + @arr[:mod].uniq.length.to_s + @arr[:mod].uniq.sort.each do |mod| + method_modules_and_classes << ' '*8 + '# ' + "[/#{mod}/," + ' '*(67 - mod.length) + "'#{mod}']," + end + method_modules_and_classes <<<<-WOK + ] + end + WOK + #% classes + method_modules_and_classes <<<<-WOK + def classes + [ + WOK + method_modules_and_classes << ' '*8 + '# ' + 'number of classes: ' + @arr[:cl].length.to_s + + ', unique: ' + @arr[:cl].uniq.length.to_s + @arr[:cl].uniq.sort.each do |cl| + method_modules_and_classes << ' '*8 + '# ' + "[/#{cl}/," + ' '*(67 - cl.length) + "'#{cl}']," + end + method_modules_and_classes <<<<-WOK + ] + end + WOK + method_modules_and_classes <<<<-WOK + self + end + end +#end + WOK + #method_modules_and_classes.each{|x| puts x} + if FileTest.file?(@modify_instructions_script) ==true + message("WARNING << #{@mod_inst} >> exists (and may have been edited). The existing << #{@mod_inst} >> will be overwritten if you proceed.") + end + instructs=File.new(@modify_instructions_script,'w') + method_modules_and_classes.each do |x| + puts x + instructs.puts x + end + instructs.close + end + def action + if @files and @files.length > 0 + p @files + mr=nil + #%% changes to make m match, r replace --------------------------> + if @cf =~/--help/; help + else + case @cf + when /--convert/; convert + when /--report/; report_modules_and_classes + when /--build-gsub/; build_search_and_replace_method_for_modules_and_classes + else help + end + #act + end + else puts "this routine makes permanent changes to the contents of the files matched, as instructed within [no matches]" + end + end + end +end +#% files to match for this conversion set -------------------------> +f=$* #; p $* +cf=f[0].to_s +f.shift +match_and_replace=Array.new +unless f.length > 0 + f=if cf == '--report' \ + or cf == '--build-gsub' + Dir.glob("[a-zA-Z]*.rb") #restrict to ruby files + else + Dir.glob("[a-zA-Z]*") + end + f=f.sort.delete_if { |x| x == __FILE__ or x == 'modify_instructions.rb' } +end +SiSU_Modify::Operations.new(cf,f).action +__END__ +#f=Dir.glob("{bin,conf,data,lib}/**/*.rb") #sisu development +#f=Dir.glob("[^_]/**/*") #all files subdirectories beneath pwd except those starting with _ diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index 7d4fa309..4cf46d99 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/odf_format.rb b/lib/sisu/v3/odf_format.rb index 5ffe458e..bf44613b 100644 --- a/lib/sisu/v3/odf_format.rb +++ b/lib/sisu/v3/odf_format.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/options.rb b/lib/sisu/v3/options.rb index b9d54123..c594aac4 100644 --- a/lib/sisu/v3/options.rb +++ b/lib/sisu/v3/options.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb index 045fd767..91f77410 100644 --- a/lib/sisu/v3/param.rb +++ b/lib/sisu/v3/param.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/param_identify_markup.rb b/lib/sisu/v3/param_identify_markup.rb index 3dcda84c..e0245098 100644 --- a/lib/sisu/v3/param_identify_markup.rb +++ b/lib/sisu/v3/param_identify_markup.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/particulars.rb b/lib/sisu/v3/particulars.rb index 1c03d304..a0006dc6 100644 --- a/lib/sisu/v3/particulars.rb +++ b/lib/sisu/v3/particulars.rb @@ -8,7 +8,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/plaintext.rb b/lib/sisu/v3/plaintext.rb index 9a426acb..533e35df 100644 --- a/lib/sisu/v3/plaintext.rb +++ b/lib/sisu/v3/plaintext.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/plaintext_format.rb b/lib/sisu/v3/plaintext_format.rb index 61e43db1..5e64c03a 100644 --- a/lib/sisu/v3/plaintext_format.rb +++ b/lib/sisu/v3/plaintext_format.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/po4a.rb b/lib/sisu/v3/po4a.rb index 64db20c3..0a5886ff 100644 --- a/lib/sisu/v3/po4a.rb +++ b/lib/sisu/v3/po4a.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/po4a_set.rb b/lib/sisu/v3/po4a_set.rb index 88369e81..1e0f90c4 100644 --- a/lib/sisu/v3/po4a_set.rb +++ b/lib/sisu/v3/po4a_set.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/prog_text_translation.rb b/lib/sisu/v3/prog_text_translation.rb index 61fed18f..015077d2 100644 --- a/lib/sisu/v3/prog_text_translation.rb +++ b/lib/sisu/v3/prog_text_translation.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/qrcode.rb b/lib/sisu/v3/qrcode.rb index 1b741a48..2dd621e7 100644 --- a/lib/sisu/v3/qrcode.rb +++ b/lib/sisu/v3/qrcode.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/relaxng.rb b/lib/sisu/v3/relaxng.rb index b26fd6f5..92f06c82 100644 --- a/lib/sisu/v3/relaxng.rb +++ b/lib/sisu/v3/relaxng.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -70,13 +70,13 @@ module SiSU_relaxng * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011 Ralph Amissah All Rights Reserved. + * Copyright: (C) 1997 - 2012 Ralph Amissah All Rights Reserved. * License: GPL 3 or later: SiSU, a framework for document structuring, publishing and search - Copyright: (C) 1997 - 2011 Ralph Amissah + Copyright: (C) 1997 - 2012 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 diff --git a/lib/sisu/v3/remote.rb b/lib/sisu/v3/remote.rb index 2e055707..8da87e42 100644 --- a/lib/sisu/v3/remote.rb +++ b/lib/sisu/v3/remote.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/response.rb b/lib/sisu/v3/response.rb index e398d22d..5df13755 100644 --- a/lib/sisu/v3/response.rb +++ b/lib/sisu/v3/response.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/rexml.rb b/lib/sisu/v3/rexml.rb index fd15865f..01f9a1fd 100644 --- a/lib/sisu/v3/rexml.rb +++ b/lib/sisu/v3/rexml.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/screen_text_color.rb b/lib/sisu/v3/screen_text_color.rb index 3ad5b09d..8fc356ac 100644 --- a/lib/sisu/v3/screen_text_color.rb +++ b/lib/sisu/v3/screen_text_color.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/share_src.rb b/lib/sisu/v3/share_src.rb index 5595c88e..82fffca0 100644 --- a/lib/sisu/v3/share_src.rb +++ b/lib/sisu/v3/share_src.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/share_src_kdissert.rb b/lib/sisu/v3/share_src_kdissert.rb index 45f68b9f..3cd7bb1e 100644 --- a/lib/sisu/v3/share_src_kdissert.rb +++ b/lib/sisu/v3/share_src_kdissert.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/shared_html.rb b/lib/sisu/v3/shared_html.rb index 4d8816c8..ec0f1c8f 100644 --- a/lib/sisu/v3/shared_html.rb +++ b/lib/sisu/v3/shared_html.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/shared_html_lite.rb b/lib/sisu/v3/shared_html_lite.rb index 33052cd2..85b1b40e 100644 --- a/lib/sisu/v3/shared_html_lite.rb +++ b/lib/sisu/v3/shared_html_lite.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/shared_markup_alt.rb b/lib/sisu/v3/shared_markup_alt.rb index 5bd49342..12cb8393 100644 --- a/lib/sisu/v3/shared_markup_alt.rb +++ b/lib/sisu/v3/shared_markup_alt.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/shared_metadata.rb b/lib/sisu/v3/shared_metadata.rb index c40bf68d..06d382c3 100644 --- a/lib/sisu/v3/shared_metadata.rb +++ b/lib/sisu/v3/shared_metadata.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/shared_sem.rb b/lib/sisu/v3/shared_sem.rb index ca14a9e4..c61ccd3e 100644 --- a/lib/sisu/v3/shared_sem.rb +++ b/lib/sisu/v3/shared_sem.rb @@ -8,7 +8,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/shared_txt.rb b/lib/sisu/v3/shared_txt.rb index c81e1c37..fbb8e1ac 100644 --- a/lib/sisu/v3/shared_txt.rb +++ b/lib/sisu/v3/shared_txt.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/shared_xhtml.rb b/lib/sisu/v3/shared_xhtml.rb index f357e9af..16cb9b14 100644 --- a/lib/sisu/v3/shared_xhtml.rb +++ b/lib/sisu/v3/shared_xhtml.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/shared_xml.rb b/lib/sisu/v3/shared_xml.rb index f4fa395c..40ee2550 100644 --- a/lib/sisu/v3/shared_xml.rb +++ b/lib/sisu/v3/shared_xml.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/sisupod_make.rb b/lib/sisu/v3/sisupod_make.rb index e4423641..7a3b4727 100644 --- a/lib/sisu/v3/sisupod_make.rb +++ b/lib/sisu/v3/sisupod_make.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/sitemaps.rb b/lib/sisu/v3/sitemaps.rb index b92ec05d..7f81b6be 100644 --- a/lib/sisu/v3/sitemaps.rb +++ b/lib/sisu/v3/sitemaps.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/spell.rb b/lib/sisu/v3/spell.rb index 4b8b892a..20e443c4 100644 --- a/lib/sisu/v3/spell.rb +++ b/lib/sisu/v3/spell.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/sst_convert_markup.rb b/lib/sisu/v3/sst_convert_markup.rb index fe520d32..10eabcb5 100644 --- a/lib/sisu/v3/sst_convert_markup.rb +++ b/lib/sisu/v3/sst_convert_markup.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/sst_do_inline_footnotes.rb b/lib/sisu/v3/sst_do_inline_footnotes.rb index 14d60ea0..c5af68de 100644 --- a/lib/sisu/v3/sst_do_inline_footnotes.rb +++ b/lib/sisu/v3/sst_do_inline_footnotes.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -56,7 +56,6 @@ ** Description: preprocessing, convert bi-footnotemarker-footnote to inline footnotes, invoked using: sisu --to-footnotes filename.sst - =end module SiSU_Convert_footnotes require_relative 'defaults' # defaults.rb diff --git a/lib/sisu/v3/sst_from_xml.rb b/lib/sisu/v3/sst_from_xml.rb index a948357a..ff29cc77 100644 --- a/lib/sisu/v3/sst_from_xml.rb +++ b/lib/sisu/v3/sst_from_xml.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/sst_identify_markup.rb b/lib/sisu/v3/sst_identify_markup.rb index 6f6cf865..2089a9a8 100644 --- a/lib/sisu/v3/sst_identify_markup.rb +++ b/lib/sisu/v3/sst_identify_markup.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/sst_to_s_xml_sax.rb b/lib/sisu/v3/sst_to_s_xml_sax.rb index c9cdd241..9a16a437 100644 --- a/lib/sisu/v3/sst_to_s_xml_sax.rb +++ b/lib/sisu/v3/sst_to_s_xml_sax.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index 436e1d7f..16dabd36 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -88,7 +88,7 @@ module SiSU_Env @t.month end def year_static - '2011' + '2012' end end class Info_system diff --git a/lib/sisu/v3/termsheet.rb b/lib/sisu/v3/termsheet.rb index 455772c4..aca9e00e 100644 --- a/lib/sisu/v3/termsheet.rb +++ b/lib/sisu/v3/termsheet.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/texinfo.rb b/lib/sisu/v3/texinfo.rb index 2004b435..90810120 100644 --- a/lib/sisu/v3/texinfo.rb +++ b/lib/sisu/v3/texinfo.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/texinfo_format.rb b/lib/sisu/v3/texinfo_format.rb index 959cbf64..df9d2800 100644 --- a/lib/sisu/v3/texinfo_format.rb +++ b/lib/sisu/v3/texinfo_format.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/texpdf.rb b/lib/sisu/v3/texpdf.rb index 2b9e1087..47005d16 100644 --- a/lib/sisu/v3/texpdf.rb +++ b/lib/sisu/v3/texpdf.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb index 2e69e3e3..43008c3d 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/texpdf_format.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/update.rb b/lib/sisu/v3/update.rb index 473d3045..e46743ec 100644 --- a/lib/sisu/v3/update.rb +++ b/lib/sisu/v3/update.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/urls.rb b/lib/sisu/v3/urls.rb index d0193da4..b188187a 100644 --- a/lib/sisu/v3/urls.rb +++ b/lib/sisu/v3/urls.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/webrick.rb b/lib/sisu/v3/webrick.rb index 9d827c17..88fb67ef 100644 --- a/lib/sisu/v3/webrick.rb +++ b/lib/sisu/v3/webrick.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/wikispeak.rb b/lib/sisu/v3/wikispeak.rb index 5b34372a..a524981b 100644 --- a/lib/sisu/v3/wikispeak.rb +++ b/lib/sisu/v3/wikispeak.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/xhtml.rb b/lib/sisu/v3/xhtml.rb index a9d860e1..7f910e47 100644 --- a/lib/sisu/v3/xhtml.rb +++ b/lib/sisu/v3/xhtml.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/xhtml_table.rb b/lib/sisu/v3/xhtml_table.rb index 8aa0f753..189e5a1d 100644 --- a/lib/sisu/v3/xhtml_table.rb +++ b/lib/sisu/v3/xhtml_table.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/xml.rb b/lib/sisu/v3/xml.rb index 2328d767..9ed3e871 100644 --- a/lib/sisu/v3/xml.rb +++ b/lib/sisu/v3/xml.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/xml_dom.rb b/lib/sisu/v3/xml_dom.rb index 913de9a0..53c60bf8 100644 --- a/lib/sisu/v3/xml_dom.rb +++ b/lib/sisu/v3/xml_dom.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/xml_fictionbook.rb b/lib/sisu/v3/xml_fictionbook.rb index 277d4adc..1425dc74 100644 --- a/lib/sisu/v3/xml_fictionbook.rb +++ b/lib/sisu/v3/xml_fictionbook.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/xml_format.rb b/lib/sisu/v3/xml_format.rb index 58b3f880..39e5d7b8 100644 --- a/lib/sisu/v3/xml_format.rb +++ b/lib/sisu/v3/xml_format.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/xml_md_oai_pmh_dc.rb b/lib/sisu/v3/xml_md_oai_pmh_dc.rb index 392be4fd..4837b8e1 100644 --- a/lib/sisu/v3/xml_md_oai_pmh_dc.rb +++ b/lib/sisu/v3/xml_md_oai_pmh_dc.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/xml_scaffold.rb b/lib/sisu/v3/xml_scaffold.rb index fdd3e5b3..5b0056c7 100644 --- a/lib/sisu/v3/xml_scaffold.rb +++ b/lib/sisu/v3/xml_scaffold.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/xml_tables.rb b/lib/sisu/v3/xml_tables.rb index c762a282..1f154bda 100644 --- a/lib/sisu/v3/xml_tables.rb +++ b/lib/sisu/v3/xml_tables.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: diff --git a/lib/sisu/v3/zap.rb b/lib/sisu/v3/zap.rb index 1cb176d0..3e967e32 100644 --- a/lib/sisu/v3/zap.rb +++ b/lib/sisu/v3/zap.rb @@ -7,7 +7,7 @@ * Author: Ralph Amissah - * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved. + * Copyright: (C) 1997 - 2012, Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: -- cgit v1.2.3 From 75e3bf86382edf99275a25895b362647158e25c1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 10 Jan 2012 22:37:26 -0500 Subject: v3dv, add dev branch (use to make some changes to module & class names & test) * (intended as) short term branch, merge back into v3 once tested * sisu --dev (to invoke) --- bin/sisu | 2 +- bin/sisu2 | 2 +- bin/sisu3 | 2 +- bin/sisu_termsheet | 2 +- bin/sisu_webrick | 2 +- conf/sisu/v3dv/sisurc.yml | 146 + data/doc/sisu/CHANGELOG_v3 | 4 + data/sisu/v3dv/conf/cgi-bin/sisu_search_pgsql.cgi | 904 ++++ data/sisu/v3dv/conf/cgi-bin/sisu_search_sqlite.cgi | 901 ++++ data/sisu/v3dv/conf/completion/README | 7 + data/sisu/v3dv/conf/completion/_sisu | 64 + data/sisu/v3dv/conf/convert/kdissert_to_sisu | 161 + data/sisu/v3dv/conf/convert/modify.rb | 376 ++ data/sisu/v3dv/conf/convert/sisu_convert | 519 ++ data/sisu/v3dv/conf/convert/wvHtml.xml | 388 ++ data/sisu/v3dv/conf/convert/wvSiSU.xml | 360 ++ data/sisu/v3dv/conf/editor-syntax-etc/README | 90 + .../conf/editor-syntax-etc/diakonos/diakonos.conf | 1159 +++++ data/sisu/v3dv/conf/editor-syntax-etc/emacs/README | 5 + .../v3dv/conf/editor-syntax-etc/emacs/sisu-mode.el | 368 ++ .../v3dv/conf/editor-syntax-etc/gedit/sisu.lang | 128 + .../sisu/v3dv/conf/editor-syntax-etc/kate/sisu.xml | 178 + data/sisu/v3dv/conf/editor-syntax-etc/nano/nanorc | 221 + .../conf/editor-syntax-etc/nedit/sisu_nedit.pats | 79 + .../v3dv/conf/editor-syntax-etc/vim/colors/8.vim | 65 + .../vim/colors/frugal-cterm-ruby.vim | 65 + .../vim/colors/frugal-cterm-sisu.vim | 65 + .../conf/editor-syntax-etc/vim/colors/frugal.vim | 65 + .../conf/editor-syntax-etc/vim/colors/slate.vim | 75 + .../vim/colors/sparse-cterm-ruby.vim | 65 + .../vim/colors/sparse-cterm-sisu.vim | 65 + .../v3dv/conf/editor-syntax-etc/vim/filetype.vim | 8 + .../conf/editor-syntax-etc/vim/ftplugin/sisu.vim | 182 + .../conf/editor-syntax-etc/vim/syntax/sisu.vim | 262 + .../editor-syntax-etc/vim/syntax/sisu_next.vim | 277 + .../conf/editor-syntax-etc/vim/templates/ssi.tpl | 40 + .../conf/editor-syntax-etc/vim/templates/ssm.tpl | 40 + .../conf/editor-syntax-etc/vim/templates/sst.tpl | 40 + .../v3dv/conf/editor-syntax-etc/vim/vim-sisu.yaml | 7 + data/sisu/v3dv/conf/lighttpd/lighttpd.cfg.sisu | 115 + data/sisu/v3dv/conf/lighttpd/lighttpd.cfg.sisu_www | 115 + data/sisu/v3dv/conf/ruby/irbrc | 19 + data/sisu/v3dv/v/version.yml | 5 + lib/sisu/v3/modify.rb | 376 -- lib/sisu/v3dv/air.rb | 82 + lib/sisu/v3dv/author_format.rb | 113 + lib/sisu/v3dv/cgi.rb | 83 + lib/sisu/v3dv/cgi_pgsql.rb | 230 + lib/sisu/v3dv/cgi_sql_common.rb | 1075 ++++ lib/sisu/v3dv/cgi_sqlite.rb | 217 + lib/sisu/v3dv/character_encoding.rb | 379 ++ lib/sisu/v3dv/composite.rb | 275 + lib/sisu/v3dv/concordance.rb | 356 ++ lib/sisu/v3dv/conf.rb | 247 + lib/sisu/v3dv/constants.rb | 285 ++ lib/sisu/v3dv/css.rb | 3332 ++++++++++++ lib/sisu/v3dv/dal.rb | 506 ++ lib/sisu/v3dv/dal_character_check.rb | 103 + lib/sisu/v3dv/dal_doc_objects.rb | 446 ++ lib/sisu/v3dv/dal_doc_str.rb | 1252 +++++ lib/sisu/v3dv/dal_endnotes.rb | 125 + lib/sisu/v3dv/dal_expand_insertions.rb | 379 ++ lib/sisu/v3dv/dal_hash_digest.rb | 155 + lib/sisu/v3dv/dal_idx.rb | 357 ++ lib/sisu/v3dv/dal_images.rb | 156 + lib/sisu/v3dv/dal_metadata.rb | 79 + lib/sisu/v3dv/dal_numbering.rb | 465 ++ lib/sisu/v3dv/dal_substitutions_and_insertions.rb | 154 + lib/sisu/v3dv/dal_syntax.rb | 538 ++ lib/sisu/v3dv/db_columns.rb | 2108 ++++++++ lib/sisu/v3dv/db_create.rb | 614 +++ lib/sisu/v3dv/db_dbi.rb | 93 + lib/sisu/v3dv/db_drop.rb | 187 + lib/sisu/v3dv/db_import.rb | 666 +++ lib/sisu/v3dv/db_indexes.rb | 114 + lib/sisu/v3dv/db_load_tuple.rb | 333 ++ lib/sisu/v3dv/db_remove.rb | 119 + lib/sisu/v3dv/db_select.rb | 215 + lib/sisu/v3dv/db_sqltxt.rb | 132 + lib/sisu/v3dv/db_tests.rb | 117 + lib/sisu/v3dv/dbi.rb | 143 + lib/sisu/v3dv/defaults.rb | 2267 +++++++++ lib/sisu/v3dv/digests.rb | 388 ++ lib/sisu/v3dv/embedded.rb | 142 + lib/sisu/v3dv/epub.rb | 706 +++ lib/sisu/v3dv/epub_concordance.rb | 312 ++ lib/sisu/v3dv/epub_format.rb | 2608 ++++++++++ lib/sisu/v3dv/epub_segments.rb | 551 ++ lib/sisu/v3dv/epub_tune.rb | 413 ++ lib/sisu/v3dv/errors.rb | 81 + lib/sisu/v3dv/git.rb | 281 ++ lib/sisu/v3dv/harvest.rb | 108 + lib/sisu/v3dv/harvest_authors.rb | 378 ++ lib/sisu/v3dv/harvest_topics.rb | 650 +++ lib/sisu/v3dv/help.rb | 1923 +++++++ lib/sisu/v3dv/html.rb | 663 +++ lib/sisu/v3dv/html_format.rb | 1480 ++++++ lib/sisu/v3dv/html_minitoc.rb | 198 + lib/sisu/v3dv/html_promo.rb | 434 ++ lib/sisu/v3dv/html_scroll.rb | 209 + lib/sisu/v3dv/html_segments.rb | 558 +++ lib/sisu/v3dv/html_table.rb | 65 + lib/sisu/v3dv/html_tune.rb | 383 ++ lib/sisu/v3dv/hub.rb | 674 +++ lib/sisu/v3dv/i18n.rb | 698 +++ lib/sisu/v3dv/manifest.rb | 863 ++++ lib/sisu/v3dv/manpage.rb | 430 ++ lib/sisu/v3dv/manpage_format.rb | 108 + lib/sisu/v3dv/modify.rb | 376 ++ lib/sisu/v3dv/odf.rb | 779 +++ lib/sisu/v3dv/odf_format.rb | 607 +++ lib/sisu/v3dv/options.rb | 649 +++ lib/sisu/v3dv/param.rb | 1536 ++++++ lib/sisu/v3dv/param_identify_markup.rb | 168 + lib/sisu/v3dv/particulars.rb | 210 + lib/sisu/v3dv/plaintext.rb | 430 ++ lib/sisu/v3dv/plaintext_format.rb | 113 + lib/sisu/v3dv/po4a.rb | 982 ++++ lib/sisu/v3dv/po4a_set.rb | 300 ++ lib/sisu/v3dv/prog_text_translation.rb | 1704 +++++++ lib/sisu/v3dv/qrcode.rb | 738 +++ lib/sisu/v3dv/relaxng.rb | 1161 +++++ lib/sisu/v3dv/remote.rb | 212 + lib/sisu/v3dv/response.rb | 75 + lib/sisu/v3dv/rexml.rb | 121 + lib/sisu/v3dv/screen_text_color.rb | 487 ++ lib/sisu/v3dv/share_src.rb | 95 + lib/sisu/v3dv/share_src_kdissert.rb | 88 + lib/sisu/v3dv/shared_html.rb | 65 + lib/sisu/v3dv/shared_html_lite.rb | 321 ++ lib/sisu/v3dv/shared_markup_alt.rb | 318 ++ lib/sisu/v3dv/shared_metadata.rb | 1361 +++++ lib/sisu/v3dv/shared_sem.rb | 156 + lib/sisu/v3dv/shared_txt.rb | 232 + lib/sisu/v3dv/shared_xhtml.rb | 65 + lib/sisu/v3dv/shared_xml.rb | 713 +++ lib/sisu/v3dv/sisupod_make.rb | 369 ++ lib/sisu/v3dv/sitemaps.rb | 215 + lib/sisu/v3dv/spell.rb | 101 + lib/sisu/v3dv/sst_convert_markup.rb | 312 ++ lib/sisu/v3dv/sst_do_inline_footnotes.rb | 472 ++ lib/sisu/v3dv/sst_from_xml.rb | 169 + lib/sisu/v3dv/sst_identify_markup.rb | 474 ++ lib/sisu/v3dv/sst_to_s_xml_sax.rb | 453 ++ lib/sisu/v3dv/sysenv.rb | 5291 ++++++++++++++++++++ lib/sisu/v3dv/termsheet.rb | 166 + lib/sisu/v3dv/texinfo.rb | 398 ++ lib/sisu/v3dv/texinfo_format.rb | 587 +++ lib/sisu/v3dv/texpdf.rb | 960 ++++ lib/sisu/v3dv/texpdf_format.rb | 1620 ++++++ lib/sisu/v3dv/update.rb | 130 + lib/sisu/v3dv/urls.rb | 427 ++ lib/sisu/v3dv/webrick.rb | 174 + lib/sisu/v3dv/wikispeak.rb | 373 ++ lib/sisu/v3dv/xhtml.rb | 431 ++ lib/sisu/v3dv/xhtml_table.rb | 99 + lib/sisu/v3dv/xml.rb | 467 ++ lib/sisu/v3dv/xml_dom.rb | 542 ++ lib/sisu/v3dv/xml_fictionbook.rb | 300 ++ lib/sisu/v3dv/xml_format.rb | 1644 ++++++ lib/sisu/v3dv/xml_md_oai_pmh_dc.rb | 230 + lib/sisu/v3dv/xml_scaffold.rb | 199 + lib/sisu/v3dv/xml_tables.rb | 203 + lib/sisu/v3dv/zap.rb | 83 + 164 files changed, 72390 insertions(+), 381 deletions(-) create mode 100644 conf/sisu/v3dv/sisurc.yml create mode 100644 data/sisu/v3dv/conf/cgi-bin/sisu_search_pgsql.cgi create mode 100644 data/sisu/v3dv/conf/cgi-bin/sisu_search_sqlite.cgi create mode 100644 data/sisu/v3dv/conf/completion/README create mode 100644 data/sisu/v3dv/conf/completion/_sisu create mode 100644 data/sisu/v3dv/conf/convert/kdissert_to_sisu create mode 100644 data/sisu/v3dv/conf/convert/modify.rb create mode 100644 data/sisu/v3dv/conf/convert/sisu_convert create mode 100644 data/sisu/v3dv/conf/convert/wvHtml.xml create mode 100644 data/sisu/v3dv/conf/convert/wvSiSU.xml create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/README create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/diakonos/diakonos.conf create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/emacs/README create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/emacs/sisu-mode.el create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/gedit/sisu.lang create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/kate/sisu.xml create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/nano/nanorc create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/nedit/sisu_nedit.pats create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/8.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal-cterm-ruby.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal-cterm-sisu.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/frugal.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/slate.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/sparse-cterm-ruby.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/colors/sparse-cterm-sisu.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/filetype.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/ftplugin/sisu.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/syntax/sisu.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/syntax/sisu_next.vim create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/templates/ssi.tpl create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/templates/ssm.tpl create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/templates/sst.tpl create mode 100644 data/sisu/v3dv/conf/editor-syntax-etc/vim/vim-sisu.yaml create mode 100644 data/sisu/v3dv/conf/lighttpd/lighttpd.cfg.sisu create mode 100644 data/sisu/v3dv/conf/lighttpd/lighttpd.cfg.sisu_www create mode 100644 data/sisu/v3dv/conf/ruby/irbrc create mode 100644 data/sisu/v3dv/v/version.yml delete mode 100644 lib/sisu/v3/modify.rb create mode 100644 lib/sisu/v3dv/air.rb create mode 100644 lib/sisu/v3dv/author_format.rb create mode 100644 lib/sisu/v3dv/cgi.rb create mode 100644 lib/sisu/v3dv/cgi_pgsql.rb create mode 100644 lib/sisu/v3dv/cgi_sql_common.rb create mode 100644 lib/sisu/v3dv/cgi_sqlite.rb create mode 100644 lib/sisu/v3dv/character_encoding.rb create mode 100644 lib/sisu/v3dv/composite.rb create mode 100644 lib/sisu/v3dv/concordance.rb create mode 100644 lib/sisu/v3dv/conf.rb create mode 100644 lib/sisu/v3dv/constants.rb create mode 100644 lib/sisu/v3dv/css.rb create mode 100644 lib/sisu/v3dv/dal.rb create mode 100644 lib/sisu/v3dv/dal_character_check.rb create mode 100644 lib/sisu/v3dv/dal_doc_objects.rb create mode 100644 lib/sisu/v3dv/dal_doc_str.rb create mode 100644 lib/sisu/v3dv/dal_endnotes.rb create mode 100644 lib/sisu/v3dv/dal_expand_insertions.rb create mode 100644 lib/sisu/v3dv/dal_hash_digest.rb create mode 100644 lib/sisu/v3dv/dal_idx.rb create mode 100644 lib/sisu/v3dv/dal_images.rb create mode 100644 lib/sisu/v3dv/dal_metadata.rb create mode 100644 lib/sisu/v3dv/dal_numbering.rb create mode 100644 lib/sisu/v3dv/dal_substitutions_and_insertions.rb create mode 100644 lib/sisu/v3dv/dal_syntax.rb create mode 100644 lib/sisu/v3dv/db_columns.rb create mode 100644 lib/sisu/v3dv/db_create.rb create mode 100644 lib/sisu/v3dv/db_dbi.rb create mode 100644 lib/sisu/v3dv/db_drop.rb create mode 100644 lib/sisu/v3dv/db_import.rb create mode 100644 lib/sisu/v3dv/db_indexes.rb create mode 100644 lib/sisu/v3dv/db_load_tuple.rb create mode 100644 lib/sisu/v3dv/db_remove.rb create mode 100644 lib/sisu/v3dv/db_select.rb create mode 100644 lib/sisu/v3dv/db_sqltxt.rb create mode 100644 lib/sisu/v3dv/db_tests.rb create mode 100644 lib/sisu/v3dv/dbi.rb create mode 100644 lib/sisu/v3dv/defaults.rb create mode 100644 lib/sisu/v3dv/digests.rb create mode 100644 lib/sisu/v3dv/embedded.rb create mode 100644 lib/sisu/v3dv/epub.rb create mode 100644 lib/sisu/v3dv/epub_concordance.rb create mode 100644 lib/sisu/v3dv/epub_format.rb create mode 100644 lib/sisu/v3dv/epub_segments.rb create mode 100644 lib/sisu/v3dv/epub_tune.rb create mode 100644 lib/sisu/v3dv/errors.rb create mode 100644 lib/sisu/v3dv/git.rb create mode 100644 lib/sisu/v3dv/harvest.rb create mode 100644 lib/sisu/v3dv/harvest_authors.rb create mode 100644 lib/sisu/v3dv/harvest_topics.rb create mode 100644 lib/sisu/v3dv/help.rb create mode 100644 lib/sisu/v3dv/html.rb create mode 100644 lib/sisu/v3dv/html_format.rb create mode 100644 lib/sisu/v3dv/html_minitoc.rb create mode 100644 lib/sisu/v3dv/html_promo.rb create mode 100644 lib/sisu/v3dv/html_scroll.rb create mode 100644 lib/sisu/v3dv/html_segments.rb create mode 100644 lib/sisu/v3dv/html_table.rb create mode 100644 lib/sisu/v3dv/html_tune.rb create mode 100644 lib/sisu/v3dv/hub.rb create mode 100644 lib/sisu/v3dv/i18n.rb create mode 100644 lib/sisu/v3dv/manifest.rb create mode 100644 lib/sisu/v3dv/manpage.rb create mode 100644 lib/sisu/v3dv/manpage_format.rb create mode 100644 lib/sisu/v3dv/modify.rb create mode 100644 lib/sisu/v3dv/odf.rb create mode 100644 lib/sisu/v3dv/odf_format.rb create mode 100644 lib/sisu/v3dv/options.rb create mode 100644 lib/sisu/v3dv/param.rb create mode 100644 lib/sisu/v3dv/param_identify_markup.rb create mode 100644 lib/sisu/v3dv/particulars.rb create mode 100644 lib/sisu/v3dv/plaintext.rb create mode 100644 lib/sisu/v3dv/plaintext_format.rb create mode 100644 lib/sisu/v3dv/po4a.rb create mode 100644 lib/sisu/v3dv/po4a_set.rb create mode 100644 lib/sisu/v3dv/prog_text_translation.rb create mode 100644 lib/sisu/v3dv/qrcode.rb create mode 100644 lib/sisu/v3dv/relaxng.rb create mode 100644 lib/sisu/v3dv/remote.rb create mode 100644 lib/sisu/v3dv/response.rb create mode 100644 lib/sisu/v3dv/rexml.rb create mode 100644 lib/sisu/v3dv/screen_text_color.rb create mode 100644 lib/sisu/v3dv/share_src.rb create mode 100644 lib/sisu/v3dv/share_src_kdissert.rb create mode 100644 lib/sisu/v3dv/shared_html.rb create mode 100644 lib/sisu/v3dv/shared_html_lite.rb create mode 100644 lib/sisu/v3dv/shared_markup_alt.rb create mode 100644 lib/sisu/v3dv/shared_metadata.rb create mode 100644 lib/sisu/v3dv/shared_sem.rb create mode 100644 lib/sisu/v3dv/shared_txt.rb create mode 100644 lib/sisu/v3dv/shared_xhtml.rb create mode 100644 lib/sisu/v3dv/shared_xml.rb create mode 100644 lib/sisu/v3dv/sisupod_make.rb create mode 100644 lib/sisu/v3dv/sitemaps.rb create mode 100644 lib/sisu/v3dv/spell.rb create mode 100644 lib/sisu/v3dv/sst_convert_markup.rb create mode 100644 lib/sisu/v3dv/sst_do_inline_footnotes.rb create mode 100644 lib/sisu/v3dv/sst_from_xml.rb create mode 100644 lib/sisu/v3dv/sst_identify_markup.rb create mode 100644 lib/sisu/v3dv/sst_to_s_xml_sax.rb create mode 100644 lib/sisu/v3dv/sysenv.rb create mode 100644 lib/sisu/v3dv/termsheet.rb create mode 100644 lib/sisu/v3dv/texinfo.rb create mode 100644 lib/sisu/v3dv/texinfo_format.rb create mode 100644 lib/sisu/v3dv/texpdf.rb create mode 100644 lib/sisu/v3dv/texpdf_format.rb create mode 100644 lib/sisu/v3dv/update.rb create mode 100644 lib/sisu/v3dv/urls.rb create mode 100644 lib/sisu/v3dv/webrick.rb create mode 100644 lib/sisu/v3dv/wikispeak.rb create mode 100644 lib/sisu/v3dv/xhtml.rb create mode 100644 lib/sisu/v3dv/xhtml_table.rb create mode 100644 lib/sisu/v3dv/xml.rb create mode 100644 lib/sisu/v3dv/xml_dom.rb create mode 100644 lib/sisu/v3dv/xml_fictionbook.rb create mode 100644 lib/sisu/v3dv/xml_format.rb create mode 100644 lib/sisu/v3dv/xml_md_oai_pmh_dc.rb create mode 100644 lib/sisu/v3dv/xml_scaffold.rb create mode 100644 lib/sisu/v3dv/xml_tables.rb create mode 100644 lib/sisu/v3dv/zap.rb diff --git a/bin/sisu b/bin/sisu index 4c949760..a7440f9f 100644 --- a/bin/sisu +++ b/bin/sisu @@ -53,7 +53,7 @@ WOK 'v3' when /--dev/ check_sisu_dev_ruby_version? - 'v3' + 'v3dv' else check_sisu_stable_ruby_version? 'v3' diff --git a/bin/sisu2 b/bin/sisu2 index 1b64d2a9..95c3c818 100644 --- a/bin/sisu2 +++ b/bin/sisu2 @@ -53,7 +53,7 @@ WOK 'v3' when /--dev/ check_sisu_dev_ruby_version? - 'v3' + 'v3dv' else check_sisu_legacy_ruby_version? 'v2' diff --git a/bin/sisu3 b/bin/sisu3 index 4c949760..a7440f9f 100644 --- a/bin/sisu3 +++ b/bin/sisu3 @@ -53,7 +53,7 @@ WOK 'v3' when /--dev/ check_sisu_dev_ruby_version? - 'v3' + 'v3dv' else check_sisu_stable_ruby_version? 'v3' diff --git a/bin/sisu_termsheet b/bin/sisu_termsheet index e896dd93..11e042ef 100644 --- a/bin/sisu_termsheet +++ b/bin/sisu_termsheet @@ -52,7 +52,7 @@ WOK 'v3' when /--dev/ check_sisu_dev_ruby_version? - 'v3' + 'v3dv' else check_sisu_stable_ruby_version? 'v3' diff --git a/bin/sisu_webrick b/bin/sisu_webrick index df7895e5..65b6a061 100644 --- a/bin/sisu_webrick +++ b/bin/sisu_webrick @@ -52,7 +52,7 @@ WOK 'v3' when /--dev/ check_sisu_dev_ruby_version? - 'v3' + 'v3dv' else check_sisu_stable_ruby_version? 'v3' diff --git a/conf/sisu/v3dv/sisurc.yml b/conf/sisu/v3dv/sisurc.yml new file mode 100644 index 00000000..0d95d4c6 --- /dev/null +++ b/conf/sisu/v3dv/sisurc.yml @@ -0,0 +1,146 @@ +# Name: SiSU - Simple information Structuring Universe +# Author: Ralph@Amissah.com +# Description: Site wide envionment defaults set here +# system environment info / resource configuration file, for sisu +# License: GPL v3 or later +# site environment configuration file +# this file should be configured and live in +# /etc/sisu #per environment settings, overridden by: +# ~/.sisu #per user settings, overridden by: +# ./_sisu #per local markup directory settings +#% #image source directory, main path and subdirectories +#image: +# path: 'sisu_working' +# 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.your.url' #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/lib/cgi-bin' +# feed: 'feed' +# sqlite: 'sisu/sqlite' +# webrick_url: true +#show_output_on: 'filesystem' #for -v and -u url information, alternatives: 'filesystem','webserver','remote_webserver','local:8111','localhost','localhost:8080','webrick','path' +#show_output_on: 'local:8111' +#webserv_cgi: +# host: localhost +# base_path: ~ +# port: '8081' +# user: ~ + +show_output_on: 'filesystem_url' +#texinfo display output +#texinfo: +# stub: 'texinfo' + +##% processing directories, main path and subdirectories (appended to $HOME), using defaults set in sysenv +#processing: +# path: '~' +# dir: '.sisu_processing~' +# metaverse: 'metaverse' +# tune: 'tune' +# latex: 'tex' +# texinfo: 'texinfo' +# concord_max: 400000 + +#% 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: '-NhewpotbxXyYv' # -m run by default; includes verbose + i: '-Nhewpoty' # -m run by default + ii: '-NhewpotbxX' # -m run by default + iii: '-NhewpotbxXY' # -m run by default + iv: '-NhewpotbxXiIY' # -m run by default + v: '-NhewpotbxXYDv --update' # -m run by default; includes verbose + +#% papersize, (LaTeX/pdf) available values: A4, US_letter, book_b5, book_a5, US_legal +default: + papersize: 'A4,letter' + #language: 'en' + #texpdf_font: 'Liberation Sans' # 'Liberation Sans' 'Liberation Serif' + #texpdf_font_mono: 'Liberation Mono' #'Inconsolata' + #text_wrap: 78 + #emphasis: 'bold' #make *{emphasis}* 'bold', 'italics' or 'underscore', default if not configured is 'bold' + #digest: 'sha' #sha is sha256, default is md5 + #multilingual: false + #language_file: 2 +#% markup, make *{emphasis}* 'bold' or 'italics', default if not configured is 'bold' + +#% settings used by ssh scp +#remote: +# - +# user: '[usrname]' +# host: '[remote.hostname]' +# path: '.' #no trailing slash eg 'sisu/www' +# - +# user: '[usrname]' +# host: '[remote.hostname]' +# path: '.' #no trailing slash eg 'sisu/www' + +#% webrick information +#webrick: +# port: '8081' + +#% sql database info, postgresql and sqlite +#db: +# share_source: false # boolean, default is false +# postgresql: +# port: # '[port (default is 5432)]' +# host: # '[if not localhost, provide host tcp/ip address or domain name]'' +# user: # '[(if different from user) provide username]' +# password: # '[password if required]' +# sqlite: +# path: ~ # './sisu_sqlite.db' +# port: "**" + +#html: +# quick_ref: true #default false +# seg_title_banner: true #default false +#odt: +# ocn: true +#plaintext: +# ocn: true + +#% output_dir_structure_by: language (language_and_filetype); filetype; or filename (original v1 & v2) +#output_dir_structure_by: filename +#output_dir_structure_by: filetype +output_dir_structure_by: language + +permission_set: + zap: false + css_modify: false +# remote_base_site: true + +program_set: + rmagick: false +# wc: true +# editor: true +# postgresql: true +# sqlite: true +# tidy: true +# rexml: true +# pdflatex: true + +#program_select: +# editor: 'vim' +# pdf_viewer: 'evince' +# web_browser: 'iceweasel' +# console_web_browser: 'links2' #'elinks' #'w3m' #'lynx' #'links' +# odf_viewer: 'lowriter' #'oowriter' #'abiword' +# xml_viewer: 'xml-viewer' +# epub_viewer: 'ebook-viewer' #'calibre' #'fbreader' #'okular' +# info_viewer: 'pinfo -f' +# man: 'man' #'groff -man -Tascii' # 'nroff -man' + +#search: +# sisu: +# flag: true +## action: http://localhost:8081/cgi-bin/sisu_pgsql.cgi +# action: http://search.sisudoc.org +# db: sisu +# title: sample search form + +#promo: sisu_search_libre, sisu_icon, sisu, open_society, fsf, ruby diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index f5e61f28..467b0028 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -23,6 +23,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.11.orig.tar.xz * date, year 2012, update + * v3dv, add dev branch, make some changes to module & class names & test + * short term branch, merge back into v3 once tested + * sisu --dev (to invoke) + * modify.rb, prep script for year update, & changing module & class names %% 3.1.10.orig.tar.xz (2011-12-31:52/6) diff --git a/data/sisu/v3dv/conf/cgi-bin/sisu_search_pgsql.cgi b/data/sisu/v3dv/conf/cgi-bin/sisu_search_pgsql.cgi new file mode 100644 index 00000000..c196c756 --- /dev/null +++ b/data/sisu/v3dv/conf/cgi-bin/sisu_search_pgsql.cgi @@ -0,0 +1,904 @@ +#!/usr/bin/env ruby +=begin + * Name: SiSU information Structuring Universe + * Author: Ralph Amissah + * http://www.jus.uio.no/sisu + * http://www.jus.uio.no/sisu/SiSU/download + + * Description: generates naive cgi search form for search of sisu database (pgsql) + * Name: SiSU generated sample cgi search form + + * Description: generated sample cgi search form for SiSU + (SiSU is a framework for document structuring, publishing and search) + + * Author: Ralph Amissah + + * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 Ralph Amissah All Rights Reserved. + + * License: GPL 3 or later: + + SiSU, a framework for document structuring, publishing and search + + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 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 . + + If you have Internet connection, the latest version of the GPL should be + available at these locations: + + + + + * SiSU uses: + * Standard SiSU markup syntax, + * Standard SiSU meta-markup syntax, and the + * Standard SiSU object citation numbering and system + + * Hompages: + + + + * Download: + + + * Ralph Amissah + + + +=end + require 'cgi' + require 'fcgi' + require 'dbi' + @version='sisu_search_pgsql' + @image_src="http://localhost/sisu/_sisu/image" + @hosturl_db="http://localhost" + @hosturl_files="http://www.jus.uio.no" + @port="5432" + user='' + @@limit,@@offset=1000,0 + @base="#@hosturl_db/cgi-bin/#@version.cgi" + @@canned_search_url=@base + @color_heading='#DDFFAA' + @color_match='#ffff48' + class Form + def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can='') + search_note='' if checked_searched !~/\S/ + the_can='' if checked_url !~/\S/ + search_field='' if checked_echo !~/\S/ + @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_stats,@checked_searched,@checked_url,@checked_case,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_selected,@checked_default,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can + @tip=if checked_tip =~/\S/ + 'text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' + else '' + end + end + def submission_form + search_form=<<-WOK + + + + + SiSU search form (sample): SiSU information Structuring Universe + + + + + + + + + + +
SiSU --> + + +
+
+ + +
+ + + #@tip + #@search_note + #@the_can +
+ + + + + to search: select which database to search (drop-down menu below); enter your search query (in the form above); and click on the search button (below) +
+ + + index + text / grep + case sensitive +
+ echo query + result stats + search url + searched + available fields + sql statement +
+ checks: + default + selected + all + none +
+ + +
+ WOK + end + end + class Search_request #% search_for + attr_accessor :text1,:keywords,:title,:author,:subject,:description,:publisher,:contributor,:date,:type,:format,:identifier,:source,:language,:relation,:coverage,:rights,:comment,:abstract,:owner,:date_created,:date_issued,:date_modified,:date_available,:date_valid,:filename + def initialize(search_field='',q='') + @search_field,@q=search_field,q + @text1=@keywords=@title=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@comment=@abstract=@owner=@date_created=@date_issued=@date_modified=@date_available=@date_valid=@filename='' + if @search_field=~/\S/ + @text1=text_to_match('text:') + @keywords=text_to_match('key(?:words?)?:') + @title=text_to_match('title:') # DublinCore 1 - title + @author=text_to_match('(?:author|creator)s?:') # DublinCore 2 - creator/author + @subject=text_to_match('subj(?:ect)?:') # DublinCore 3 - subject + @description=text_to_match('description:') # DublinCore 4 - description + @publisher=text_to_match('pub(?:lisher)?:') # DublinCore 5 - publisher + @contributor=text_to_match('contributor:') # DublinCore 6 - contributor + @date=text_to_match('date:') # DublinCore 7 - date dd-mm-yy + @type=text_to_match('type:') # DublinCore 8 - type + @format=text_to_match('format:') # DublinCore 9 - format + @identifier=text_to_match('identifier:') # DublinCore 10 - identifier + @source=text_to_match('source:') # DublinCore 11 - source + @language=text_to_match('language:') # DublinCore 12 - language + @relation=text_to_match('relation:') # DublinCore 13 - relation + @coverage=text_to_match('coverage:') # DublinCore 14 - coverage + @rights=text_to_match('rights:') # DublinCore 15 - rights + @comment=text_to_match('comment:') + @abstract=text_to_match('abs(?:tract)?:') + @owner=text_to_match('owner:') + @date_created=text_to_match('date_created:') + @date_issued=text_to_match('date_issued:') + @date_modified=text_to_match('date_modified:') + @date_available=text_to_match('date_available:') + @date_valid=text_to_match('date_valid:') + @filename=text_to_match('filename:') + @text1=text_to_match unless @keywords or @author or @title or @text1 or @comment or @abstract or @rights or @subject or @publisher or @date or @filename + else + @text1=q['s1'] if q['s1']=~/\S/ + @keywords=q['key'] if q['key']=~/\S/ + @title=q['ti'] if q['ti']=~/\S/ + @author=q['au'] if q['au']=~/\S/ + @subject=q['sj'] if q['sj']=~/\S/ + @description=q['dsc'] if q['dsc']=~/\S/ + @publisher=q['pb'] if q['pb']=~/\S/ + @contributor=q['cntr'] if q['cntr']=~/\S/ + @date=q['dt'] if q['dt']=~/\S/ + @type=q['ty'] if q['ty']=~/\S/ + @identifier=q['id'] if q['id']=~/\S/ + @source=q['src'] if q['src']=~/\S/ + @language=q['lang'] if q['lang']=~/\S/ + @relation=q['rel'] if q['rel']=~/\S/ + @coverage=q['cov'] if q['cov']=~/\S/ + @rights=q['cr'] if q['cr']=~/\S/ + @comment=q['co'] if q['co']=~/\S/ + @abstract=q['ab'] if q['ab']=~/\S/ + @date_created=q['dtc'] if q['dtc']=~/\S/ + @date_issued=q['dti'] if q['dti']=~/\S/ + @date_modified=q['dtm'] if q['dtm']=~/\S/ + @date_available=q['dta'] if q['dta']=~/\S/ + @date_valid=q['dtv'] if q['dtv']=~/\S/ + @filename=q['fns'] if q['fns']=~/\S/ + @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 + @@offset=q['off'] if q['off']=~/\d+/ # 0 + end + end + def text_to_match(identifier='') + m={ + :string => /#{identifier}\s*(.+?)/, + :string => /#{identifier}\s*(.+?)(?:;|\n|\r|$)/, + :word => /#{identifier}[\s(]*(\S+)/ + } + search_string=if @search_field =~m[:word] + search_string=if @search_field =~m[:braces]; m[:braces].match(@search_field)[1] + elsif @search_field =~m[:string]; m[:string].match(@search_field)[1] + else + str=m[:word].match(@search_field)[1] + str.gsub!(/[()]/,'') + str + end + search_string.strip! + search_string.gsub!(/\s+/,'+') + search_string + #else + # "__" + end + end + end + class Dbi_search_string + def initialize(l,t,q,cse=false) + @l,@t,@q,@c=l,t,q,cse + end + def string + search={ :search => [],:flag => false } + if @t =~/\S+/ or @q =~/\S+/ + if @t =~/\S+/; unescaped_search=CGI.unescape(@t) + elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q) + end + search_construct=[] + if @c + unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~\( '") + unescaped_search.gsub!(/(.+)/,"#@l~\( '\\1' \)") + else + unescaped_search.gsub!(/\s*(AND|OR)\s*/,"' \) \\1 #@l~*\( '") + unescaped_search.gsub!(/(.+)/,"#@l~*\( '\\1' \)") + end + search_construct << unescaped_search + search_construct=search_construct.join(' ') + search[:search] << search_construct + search[:flag]=true + search + end + search + end + end + class Dbi_search_statement + attr_reader :text_search_flag,:sql_select_body_format,:sql_select_endnotes_format,:sql_offset,:sql_limit + def initialize(conn,search_for,q,c) + @conn=conn + @text_search_flag=false + @sql_statement={ :body=>'',:endnotes=>'',:range=>'' } + #@offset||=@@offset + #@offset+=@@limit + search={ :text => [],:endnotes => [] } + cse=if c =~/\S/; true + else false + end + st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1'],cse).string + se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1'],cse).string + @text_search_flag=st[:flag] + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << se[:search] + end + st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.title',search_for.title,q['ti'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.creator',search_for.author,q['au'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.date',search_for.date,q['dt'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.type',search_for.type,q['ty'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.source',search_for.source,q['src'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.language',search_for.language,q['lang'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 + @@offset=q['off'] if q['off']=~/\d+/ # 0 + @search_text,@search_endnotes=[],[] + #% + search[:text].each{|x| @search_text << "#{x} AND " } + @search_text=@search_text.to_s.gsub!(/AND\s+$/,'') + @search_text.gsub!(/(documents\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)') + search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } + @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'') + @search_endnotes.gsub!(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)') + end + def sql_offset + @@offset + end + def sql_limit + @@limit + end + def sql_canned_search + @offset_next=sql_offset.to_i + sql_limit.to_i + @offset_previous=sql_offset.to_i - sql_limit.to_i + def current + @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + sql_offset.to_s + end + def next + @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_next.to_s + end + def previous + @offset_previous >= 0 ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : '' + end + def start + @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + 0.to_s + end + self + end + def sql_canned_search_url(ok) + if ok + can=sql_canned_search + page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i + case page.to_s + when /^1$/ + %{

+ pg. #{page.to_s} +   > +
} + when /^2$/ + %{

+ <   + pg. #{page.to_s} +   > +
} + else + %{

+ |<   + <   + pg. #{page.to_s} +   > +
} + end + else '' + end + end + def sql_select_body + limit ||=@@limit + offset ||=@@offset + @sql_statement[:body]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE (#@search_text) AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn} + @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} + select=@sql_statement[:body] + ' ' + @sql_statement[:range] + select + end + def sql_select_endnotes + limit ||=@@limit + offset ||=@@offset + @sql_statement[:endnotes]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE (#@search_endnotes) AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr} + @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} + select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range] + select + end + def sql_select_body_format + %{#{sql_select_body}} + end + def sql_select_endnotes_format + %{#{sql_select_endnotes}} + end + def contents + @conn.select_all(sql_select_body) + end + def endnotes + @conn.select_all(sql_select_endnotes) + end + end + def tail + <<-'WOK' +


+ + + + + +
+

+ + SiSU + +

+
+ +

+ Generated by + + SiSU 0.55.3 2007-07-10 (2007w28/2) +
+ + SiSU © Ralph Amissah + 1993, current 2007. + All Rights Reserved. +
+ + SiSU + is software for document structuring, publishing and search, +
+ + www.jus.uio.no/sisu + + and + + www.sisudoc.org + +
+ w3 since October 3 1993 + + ralph@amissah.com + +

+
+

+ SiSU using: +
Standard SiSU markup syntax, +
Standard SiSU meta-markup syntax, and the +
Standard SiSU object citation numbering and system, (object/text positioning system) +
+ © Ralph Amissah 1997, current 2007. + All Rights Reserved. +

+
+

+ + GPLv3 + +

+
+

+ SiSU is released under + GPL v3 + or later, + + http://www.gnu.org/licenses/gpl.html + +

+
+

+ SiSU, developed using + + Ruby + + on + + Debian/Gnu/Linux + + software infrastructure, + with the usual GPL (or OSS) suspects. +
+ Better - "performance, reliability, scalability, security & total cost of ownership" + [not to mention flexibility & choice] +
+ Get With the Future + + Way Better! + +

+
+ + + WOK + end + @tail=tail + @counter_txt_doc,@counter_txt_ocn,@counter_endn_doc,@counter_endn_ocn=0,0,0,0 + @counters_txt,@counters_endn,@sql_select_body,@sql_select_endnotes='','','','' + FCGI.each_cgi do |cgi| + begin # all code goes in begin section + @search={ :text => [],:endnotes => [] } + q=CGI.new + @db=if cgi['db'] =~/\S+/; + @stub=/SiSU_(\S+)/.match(cgi['db'])[1] + cgi['db'] + else + @stub='sisu' + 'SiSU_sisu' + end + checked_url,checked_stats,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,selected_db='','','','','','','','','' + if cgi['view']=~/text/; checked_index,checked_text='','checked' + else checked_index,checked_text='checked','' + end + checked_echo='checked' if cgi['echo'] =~/\S/ + checked_stats='checked' if cgi['stats'] =~/\S/ + checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1 + checked_searched='checked' if cgi['searched'] =~/\S/ + checked_tip='checked' if cgi['tip'] =~/\S/ + checked_case='checked' if cgi['casesense'] =~/\S/ + checked_sql='checked' if cgi['sql'] =~/\S/ + if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1 + checked_all='checked' + checked_echo=checked_stats=checked_url=checked_searched=checked_tip=checked_sql='checked' + checked_none='' + elsif cgi['checks'] =~/check_none/ + checked_none='checked' + checked_all=checked_url=checked_stats=checked_searched=checked_tip=checked_echo=checked_sql='' + elsif cgi['checks'] =~/check_selected/ + checked_selected='checked' + elsif cgi['checks'] =~/check_default/ + checked_default='checked' + checked_echo=checked_stats=checked_url='checked' + checked_searched=checked_tip=checked_case=checked_sql='' + else + checked_selected='checked' + checked_echo=checked_stats=checked_url='checked' + checked_searched=checked_tip=checked_case=checked_sql='' + end + selected_db=case cgi['db'] + when /SiSU_pace/; '' + when /SiSU_sisu/; '' + end + dbi="dbi:Pg:database=#{@db};port=#{@port}" + @conn=DBI.connect(dbi,user) + search_field=cgi['find'] if cgi['find'] # =~/\S+/ + @search_for=Search_request.new(search_field,q) #.analyze #% search_for + #% searches + #Canned_search.new(@base,@search_for.text1,cgi) + if @search_for.text1=~/\S+/ or @search_for.author=~/\S+/ #and search_field =~/\S/ + s1='s1=' + CGI.escape(@search_for.text1) if @search_for.text1=~/\S/ + key='key=' + CGI.escape(@search_for.keywords) if @search_for.keywords=~/\S/ + ti='&ti=' + CGI.escape(@search_for.title) if @search_for.title=~/\S/ + au='&au=' + CGI.escape(@search_for.author) if @search_for.author=~/\S/ + sj='&sj=' + CGI.escape(@search_for.subject) if @search_for.subject=~/\S/ + dsc='&dsc=' + CGI.escape(@search_for.description) if @search_for.description=~/\S/ + pb='&pb=' + CGI.escape(@search_for.publisher) if @search_for.publisher=~/\S/ + cntr='&cntr=' + CGI.escape(@search_for.contributor) if @search_for.contributor=~/\S/ + dt='&dt=' + CGI.escape(@search_for.date) if @search_for.date=~/\S/ + ty='&ty=' + CGI.escape(@search_for.type) if @search_for.type=~/\S/ + id='&id=' + CGI.escape(@search_for.identifier) if @search_for.identifier=~/\S/ + src='&src=' + CGI.escape(@search_for.source) if @search_for.source=~/\S/ + lang='&lang=' + CGI.escape(@search_for.language) if @search_for.language=~/\S/ + rel='&rel=' + CGI.escape(@search_for.relation) if @search_for.relation=~/\S/ + cov='&cov=' + CGI.escape(@search_for.coverage) if @search_for.coverage=~/\S/ + cr='&cr=' + CGI.escape(@search_for.rights) if @search_for.rights=~/\S/ + co='&co=' + CGI.escape(@search_for.comment) if @search_for.comment=~/\S/ + ab='&ab=' + CGI.escape(@search_for.abstract) if @search_for.abstract=~/\S/ + dtc='&dtc=' + CGI.escape(@search_for.date_created) if @search_for.date_created=~/\S/ + dti='&dti=' + CGI.escape(@search_for.date_issued) if @search_for.date_issued=~/\S/ + dtm='&dtm=' + CGI.escape(@search_for.date_modified) if @search_for.date_modified=~/\S/ + dta='&dta=' + CGI.escape(@search_for.date_available) if @search_for.date_available=~/\S/ + dtv='&dtv=' + CGI.escape(@search_for.date_valid) if @search_for.date_valid=~/\S/ + fns='&fns=' + CGI.escape(@search_for.filename) if @search_for.filename=~/\S/ + @@canned_search_url=if checked_all =~/checked/ + "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1" + else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}" + end + @canned_base_url="#@base?#{s1}&db=#{cgi['db']}" + if checked_case=~/\S/ + @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1 + @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1 + else + @search[:text][1]=%{documents.clean~*'#{@search_for.text1}'} #s1 + @search[:endnotes][1]=%{endnotes.clean~*'#{@search_for.text1}'} #s1 + end + canned_note='search url:' + else + @@canned_search_url="#@base?s1=United+Nations&db=documents&view=index" + canned_note='search url example:' + end + if search_field =~/\S+/ + analyze_format=search_field.gsub(/\s*\n/,'; ') + elsif checked_all =~/checked/ or checked_url =~/checked/ + canned_search=@@canned_search_url.scan(/(?:s1|au|ti|fns)=[^&]+/) + af=canned_search.join('; ') + af.gsub!(/s1=/,'text: ') + af.gsub!(/au=/,'author: ') + af.gsub!(/ti=/,'title: ') + af.gsub!(/fns=/,'filename: ') + af.gsub!(/%2B/,' ') + analyze_format=af + st=af.split(/\s*;\s*/) + search_field=st.join("\n") + end + green=%{} + canned_search_url_txt=CGI.escapeHTML(@@canned_search_url) + the_can=%{#{canned_note} #{canned_search_url_txt}
} + p_text=p_keywords=p_title=p_author=p_subject=p_description=p_publisher=p_contributor=p_date=p_type=p_format=p_identifier=p_source=p_language=p_relation=p_coverage=p_rights=p_comment=p_abstract=p_subject=p_filename='' + p_text=%{text: #{green}#{@search_for.text1}

} if @search_for.text1 =~/\S+/ + p_keywords=%{keywords: #{green}#{@search_for.keywords}
} if @search_for.keywords =~/\S+/ + p_title=%{title: #{green}#{@search_for.title}
} if @search_for.title =~/\S+/ + p_author=%{author: #{green}#{@search_for.author}
} if @search_for.author =~/\S+/ + p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ + p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ + p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ + p_contributor=%{contributor: #{green}#{@search_for.contributor}
} if @search_for.contributor =~/\S+/ + p_date=%{date: #{green}#{@search_for.date}
} if @search_for.date =~/\S+/ + p_type=%{type: #{green}#{@search_for.type}
} if @search_for.type =~/\S+/ + p_format=%{format: #{green}#{@search_for.format}
} if @search_for.format =~/\S+/ + p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ + p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ + p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ + p_relation=%{relation: #{green}#{@search_for.relation}
} if @search_for.relation =~/\S+/ + p_coverage=%{coverage: #{green}#{@search_for.coverage}
} if @search_for.coverage =~/\S+/ + p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ + p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ + p_abstract=%{abstract: #{green}#{@search_for.abstract}
} if @search_for.abstract =~/\S+/ + p_filename=%{filename: #{green}#{@search_for.filename}
} if @search_for.filename =~/\S+/ + search_note=<<-WOK + + database: #{green}#@db; selected view: #{green}#{cgi['view']} + search string: "#{green}#{analyze_format}"
+ #{p_text} #{p_keywords} #{p_title} #{p_author} #{p_subject} #{p_description} #{p_publisher} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename} + + WOK + #eg = %{canned search e.g.:
#{url}
find: #{analyze}
database: #{database}} + #dbi_canning + @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form + unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ + print "Content-type: text/html\n\n" + puts (@header+@tail) + else #% searches + s1=if @search_for.text1 =~/\S/ + @search_for.text1 + else 'Unavailable' + end + if checked_case=~/\S/ + @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'} + else + @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'} + end + #dbi_request + dbi_statement=Dbi_search_statement.new(@conn,@search_for,q,checked_case) + @text_search_flag=false + @text_search_flag=dbi_statement.text_search_flag + s_contents=dbi_statement.contents + s_endnotes=dbi_statement.endnotes + @body_main,@endnotes=[],[] + @search_regx=nil + oldtid=0 + if @text_search_flag + if checked_sql =~/\S/ + sql_select_body=dbi_statement.sql_select_body_format + sql_select_endnotes=dbi_statement.sql_select_endnotes_format + else sql_select_body,sql_select_endnotes='','' + end + @body_main << '



Main Text:
' << sql_select_body + @endnotes << '



Endnotes:
' << sql_select_endnotes + else + end + #text_objects_body + s_contents.each do |c| #% text body + location=c['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] + file_suffix=c['filename'][/.+?\.(_?sst|ssm)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location.gsub!(/(\S+?)~\S\S\S?/,'\1') + l=".#{l}" + else '' + end + #metadata_found_body + if c['tid'].to_i != oldtid.to_i + ti=if c['subtitle'] =~/\S+/; "#{c['title']} - #{c['subtitle']}" + else c['title'] + end + can_txt_srch=if cgi['view']=~/index/; %{red bullet } + else %{red bullet } + end + title=%{toc html #{ti} by #{c['creator']} #{can_txt_srch}toc html pdf portrait pdf landscape odf manifest
} if file_suffix=~/s/ #hmm watch file_suffix + if @text_search_flag; title='

'+title + else title='
'+title + end + @counter_txt_doc+=1 + oldtid=c['tid'].to_i + else title='' + end + if @text_search_flag + if cgi['view']=~/text/ #% txt body + text=if c['suffix'] !~/1/ #seg + if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/ #% only this branch is working !! + unescaped_search=if @search_for.text1 =~/\S+/; CGI.unescape(@search_for.text1) + elsif q['s1'] =~/\S+/; CGI.unescape(q['s1']) + else nil + end + @search_regx=if unescaped_search #check + search_regex=[] + build=unescaped_search.scan(/\S+/).each do |g| + if g.to_s =~/(AND|OR)/ + search_regex << '|' + else search_regex << %{#{g.to_s}} + end + end + search_regex=search_regex.join(' ') + search_regex=search_regex.gsub(/\s*\|\s*/,'|') + Regexp.new(search_regex, Regexp::IGNORECASE) + else nil + end + else nil + end + matched_para=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) + matched=c['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{\\1}) + else c['body'] + end + %{

ocn #{c['ocn']}:

#{matched_para}} + elsif c['suffix'] =~/1/ #doc + %{#{title}

ocn #{c['ocn']}:#{c['body']}} + end + @counter_txt_ocn+=1 + output=if c['seg'] =~/\S+/; title+text + else text + end + elsif cgi['view']=~/index/ #% idx body + if c['suffix'] !~/1/ #seg + index=%{#{c['ocn']}, } if @text_search_flag + elsif c['suffix'] =~/1/ #doc + index=%{#{c['ocn']}, } + end + if c['seg'] =~/\S+/ + if @text_search_flag + @counter_txt_ocn+=1 + output=title+index + end + else + @counter_txt_ocn+=1 + output=unless c['suffix'] =~/1/; title+index + else %{#{title}#{c['ocn'].sort}, } + end + end + end + else output=title + end + @counters_txt=if @counter_txt_doc > 0 + if checked_stats =~/\S/ + @@lt_t=if @counter_txt_ocn == dbi_statement.sql_limit.to_i + over='over' + true + else + over='' + false + end + %{


Found in the main body of #@counter_txt_doc documents, and at #{over} #@counter_txt_ocn locations within.
} + else '' + end + else '' + end + @body_main << output #+ details + end + #text_objects_endnote + oldtid = 0 + s_endnotes.each do |e| #% endnotes + location=e['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] + file_suffix=e['filename'][/.+?\.(_?sst|ssm)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location.gsub!(/(\S+?)~\S\S\S?/,'\1') + l=".#{l}" + else '' + end + #metadata_found_endnotes + if @text_search_flag + if e['metadata_tid'].to_i != oldtid.to_i + ti=if e['subtitle'] =~/\S+/; "#{e['title']} - #{e['subtitle']}" + else e['title'] + end + can_txt_srch=if cgi['view']=~/index/; %{red bullet } + else %{red bullet } + end + title=%{

toc html #{ti} by #{e['creator']} #{can_txt_srch}toc html pdf portraitpdf landscape odf manifest
} if file_suffix=~/s/ + @counter_endn_doc+=1 + oldtid=e['metadata_tid'].to_i + else title = '' + end + if cgi['view']=~/text/ #% txt endnotes + @counter_endn_ocn+=1 + matched_endnote=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) + matched=e['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{\\1}) + else e['body'] + end + output=%{#{title}
note #{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} + elsif cgi['view']=~/index/ #% idx endnotes + @counter_endn_ocn+=1 + output=%{#{title}#{e['nr']}#{e['ocn']}], } + end + @counters_endn=if @counter_endn_doc > 0 + if checked_stats =~/\S/ + @@lt_e=if @counter_endn_ocn == dbi_statement.sql_limit.to_i + over='over' + true + else + over='' + false + end + %{Found in the endnotes of #@counter_endn_doc documents, and at #{over} #@counter_endn_ocn locations within.
} + else '' + end + end + @endnotes << output #+ details + else @endnotes=[] #does not take out yet + end + end + offset=dbi_statement.sql_offset.to_s + limit=dbi_statement.sql_limit.to_s + @@lt_t ||=false; @@lt_e ||=false + canned=if (@@lt_t or @@lt_e) + dbi_statement.sql_canned_search_url(true).to_s + else + dbi_statement.sql_canned_search_url(false).to_s + end + limit=dbi_statement.sql_limit.to_s + cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + canned + @tail} #% print cgi_output_header+counters+body+endnotes + end + rescue Exception => e + s='
' + CGI::escapeHTML(e.backtrace.reverse.join("\n"))
+          s << CGI::escapeHTML(e.message) + '
' + cgi.out{s} + next + ensure # eg. disconnect from server + @conn.disconnect if @conn + end + end diff --git a/data/sisu/v3dv/conf/cgi-bin/sisu_search_sqlite.cgi b/data/sisu/v3dv/conf/cgi-bin/sisu_search_sqlite.cgi new file mode 100644 index 00000000..34bb3748 --- /dev/null +++ b/data/sisu/v3dv/conf/cgi-bin/sisu_search_sqlite.cgi @@ -0,0 +1,901 @@ +#!/usr/bin/env ruby +=begin + * Name: SiSU information Structuring Universe + * Author: Ralph Amissah + * http://www.jus.uio.no/sisu + * http://www.jus.uio.no/sisu/SiSU/download + + * Description: generates naive cgi search form for search of sisu database (sqlite) + * Name: SiSU generated sample cgi search form + + * Description: generated sample cgi search form for SiSU + (SiSU is a framework for document structuring, publishing and search) + + * Author: Ralph Amissah + + * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 Ralph Amissah All Rights Reserved. + + * License: GPL 3 or later: + + SiSU, a framework for document structuring, publishing and search + + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 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 . + + If you have Internet connection, the latest version of the GPL should be + available at these locations: + + + + + * SiSU uses: + * Standard SiSU markup syntax, + * Standard SiSU meta-markup syntax, and the + * Standard SiSU object citation numbering and system + + * Hompages: + + + + * Download: + + + * Ralph Amissah + + + +=end + require 'cgi' + require 'fcgi' + require 'dbi' + @version='sisu_search_sqlite' + @image_src="http://localhost/sisu/_sisu/image" + @hosturl_db="http://localhost" + @hosturl_files="http://www.jus.uio.no" + @@limit,@@offset=1000,0 + @base="#@hosturl_db/cgi-bin/#@version.cgi" + @@canned_search_url=@base + @color_heading='#DDFFAA' + @color_match='#ffff48' + class Form + def initialize(base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can='') + search_note='' if checked_searched !~/\S/ + the_can='' if checked_url !~/\S/ + search_field='' if checked_echo !~/\S/ + @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_stats,@checked_searched,@checked_url,@checked_case,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_selected,@checked_default,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can + @tip=if checked_tip =~/\S/ + 'text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' + else '' + end + end + def submission_form + search_form=<<-WOK + + + + + SiSU search form (sample): SiSU information Structuring Universe + + + + + + + + + + +
SiSU --> + + +
+
+ + +
+ + + #@tip + #@search_note + #@the_can +
+ + + + + to search: select which database to search (drop-down menu below); enter your search query (in the form above); and click on the search button (below) +
+ + + index + text / grep +
+ echo query + result stats + search url + searched + available fields + sql statement +
+ checks: + default + selected + all + none +
+ + +
+ WOK + end + end + class Search_request #% search_for + attr_accessor :text1,:keywords,:title,:author,:subject,:description,:publisher,:contributor,:date,:type,:format,:identifier,:source,:language,:relation,:coverage,:rights,:comment,:abstract,:owner,:date_created,:date_issued,:date_modified,:date_available,:date_valid,:filename + def initialize(search_field='',q='') + @search_field,@q=search_field,q + @text1=@keywords=@title=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@comment=@abstract=@owner=@date_created=@date_issued=@date_modified=@date_available=@date_valid=@filename='' + if @search_field=~/\S/ + @text1=text_to_match('text:') + @keywords=text_to_match('key(?:words?)?:') + @title=text_to_match('title:') # DublinCore 1 - title + @author=text_to_match('(?:author|creator)s?:') # DublinCore 2 - creator/author + @subject=text_to_match('subj(?:ect)?:') # DublinCore 3 - subject + @description=text_to_match('description:') # DublinCore 4 - description + @publisher=text_to_match('pub(?:lisher)?:') # DublinCore 5 - publisher + @contributor=text_to_match('contributor:') # DublinCore 6 - contributor + @date=text_to_match('date:') # DublinCore 7 - date dd-mm-yy + @type=text_to_match('type:') # DublinCore 8 - type + @format=text_to_match('format:') # DublinCore 9 - format + @identifier=text_to_match('identifier:') # DublinCore 10 - identifier + @source=text_to_match('source:') # DublinCore 11 - source + @language=text_to_match('language:') # DublinCore 12 - language + @relation=text_to_match('relation:') # DublinCore 13 - relation + @coverage=text_to_match('coverage:') # DublinCore 14 - coverage + @rights=text_to_match('rights:') # DublinCore 15 - rights + @comment=text_to_match('comment:') + @abstract=text_to_match('abs(?:tract)?:') + @owner=text_to_match('owner:') + @date_created=text_to_match('date_created:') + @date_issued=text_to_match('date_issued:') + @date_modified=text_to_match('date_modified:') + @date_available=text_to_match('date_available:') + @date_valid=text_to_match('date_valid:') + @filename=text_to_match('filename:') + @text1=text_to_match unless @keywords or @author or @title or @text1 or @comment or @abstract or @rights or @subject or @publisher or @date or @filename + else + @text1=q['s1'] if q['s1']=~/\S/ + @keywords=q['key'] if q['key']=~/\S/ + @title=q['ti'] if q['ti']=~/\S/ + @author=q['au'] if q['au']=~/\S/ + @subject=q['sj'] if q['sj']=~/\S/ + @description=q['dsc'] if q['dsc']=~/\S/ + @publisher=q['pb'] if q['pb']=~/\S/ + @contributor=q['cntr'] if q['cntr']=~/\S/ + @date=q['dt'] if q['dt']=~/\S/ + @type=q['ty'] if q['ty']=~/\S/ + @identifier=q['id'] if q['id']=~/\S/ + @source=q['src'] if q['src']=~/\S/ + @language=q['lang'] if q['lang']=~/\S/ + @relation=q['rel'] if q['rel']=~/\S/ + @coverage=q['cov'] if q['cov']=~/\S/ + @rights=q['cr'] if q['cr']=~/\S/ + @comment=q['co'] if q['co']=~/\S/ + @abstract=q['ab'] if q['ab']=~/\S/ + @date_created=q['dtc'] if q['dtc']=~/\S/ + @date_issued=q['dti'] if q['dti']=~/\S/ + @date_modified=q['dtm'] if q['dtm']=~/\S/ + @date_available=q['dta'] if q['dta']=~/\S/ + @date_valid=q['dtv'] if q['dtv']=~/\S/ + @filename=q['fns'] if q['fns']=~/\S/ + @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 + @@offset=q['off'] if q['off']=~/\d+/ # 0 + end + end + def text_to_match(identifier='') + m={ + :string => /#{identifier}\s*(.+?)/, + :string => /#{identifier}\s*(.+?)(?:;|\n|\r|$)/, + :word => /#{identifier}[\s(]*(\S+)/ + } + search_string=if @search_field =~m[:word] + search_string=if @search_field =~m[:braces]; m[:braces].match(@search_field)[1] + elsif @search_field =~m[:string]; m[:string].match(@search_field)[1] + else + str=m[:word].match(@search_field)[1] + str.gsub!(/[()]/,'') + str + end + search_string.strip! + search_string.gsub!(/\s+/,'+') + search_string + #else + # "__" + end + end + end + class Dbi_search_string + def initialize(l,t,q,cse=false) + @l,@t,@q=l,t,q + end + def string + search={ :search => [],:flag => false } + if @t =~/\S+/ or @q =~/\S+/ + if @t =~/\S+/; unescaped_search=CGI.unescape(@t) + elsif @q =~/\S+/; unescaped_search=CGI.unescape(@q) + end + search_construct=[] + unescaped_search.gsub!(/\s*(AND|OR)\s*/,"%' \) \\1 #@l LIKE \( '%") + unescaped_search.gsub!(/(.+)/,"#@l LIKE \( '%\\1%' \)") + search_construct << unescaped_search + search_construct=search_construct.join(' ') + search[:search] << search_construct + search[:flag]=true + search + end + search + end + end + class Dbi_search_statement + attr_reader :text_search_flag,:sql_select_body_format,:sql_select_endnotes_format,:sql_offset,:sql_limit + def initialize(conn,search_for,q,c) + @conn=conn + @text_search_flag=false + @sql_statement={ :body=>'',:endnotes=>'',:range=>'' } + #@offset||=@@offset + #@offset+=@@limit + search={ :text => [],:endnotes => [] } + cse=if c =~/\S/; true + else false + end + st=Dbi_search_string.new('documents.clean',search_for.text1,q['s1'],cse).string + se=Dbi_search_string.new('endnotes.clean',search_for.text1,q['s1'],cse).string + @text_search_flag=st[:flag] + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << se[:search] + end + st=Dbi_search_string.new('metadata.keywords',search_for.keywords,q['key'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.title',search_for.title,q['ti'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.creator',search_for.author,q['au'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.subject',search_for.subject,q['sj'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.description',search_for.description,q['dsc'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.publisher',search_for.publisher,q['pb'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.contributor',search_for.contributor,q['cntr'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.date',search_for.date,q['dt'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.type',search_for.type,q['ty'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.identifier',search_for.identifier,q['id'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.source',search_for.source,q['src'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.language',search_for.language,q['lang'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.relation',search_for.relation,q['rel'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.coverage',search_for.coverage,q['cov'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.rights',search_for.rights,q['cr'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.comment',search_for.comment,q['co'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.abstract',search_for.abstract,q['ab'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + st=Dbi_search_string.new('metadata.filename',search_for.filename,q['fns'],cse).string + if st[:flag] + search[:text] << st[:search] + search[:endnotes] << st[:search] + end + @@limit=q['ltd'] if q['ltd']=~/\d+/ # 1000 + @@offset=q['off'] if q['off']=~/\d+/ # 0 + @search_text,@search_endnotes=[],[] + #% + search[:text].each{|x| @search_text << "#{x} AND " } + @search_text=@search_text.to_s.gsub!(/AND\s+$/,'') + @search_text.gsub!(/(documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') + search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } + @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'') + @search_text.gsub!(/(endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') + end + def sql_offset + @@offset + end + def sql_limit + @@limit + end + def sql_canned_search + @offset_next=sql_offset.to_i + sql_limit.to_i + @offset_previous=sql_offset.to_i - sql_limit.to_i + def current + @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + sql_offset.to_s + end + def next + @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_next.to_s + end + def previous + @offset_previous >= 0 ? (@@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + @offset_previous.to_s) : '' + end + def start + @@canned_search_url.to_s + '<d=' + sql_limit.to_s + '&off=' + 0.to_s + end + self + end + def sql_canned_search_url(ok) + if ok + can=sql_canned_search + page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i + case page.to_s + when /^1$/ + %{

+ pg. #{page.to_s} +   > +
} + when /^2$/ + %{

+ <   + pg. #{page.to_s} +   > +
} + else + %{

+ |<   + <   + pg. #{page.to_s} +   > +
} + end + else '' + end + end + def sql_select_body + limit ||=@@limit + offset ||=@@offset + @sql_statement[:body]=%{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, metadata.suffix, documents.body, documents.seg, documents.ocn, metadata.tid FROM documents, metadata WHERE #{@search_text} AND documents.metadata_tid = metadata.tid ORDER BY metadata.title, metadata.filename, documents.ocn} + @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} + select=@sql_statement[:body] + ' ' + @sql_statement[:range] + select + end + def sql_select_endnotes + limit ||=@@limit + offset ||=@@offset + @sql_statement[:endnotes]= %{SELECT metadata.title, metadata.subtitle, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE #{@search_endnotes} AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, metadata.filename, endnotes.nr} + @sql_statement[:range]=%{LIMIT #{limit} OFFSET #{offset} ;} + select=@sql_statement[:endnotes] + ' ' + @sql_statement[:range] + select + end + def sql_select_body_format + %{#{sql_select_body}} + end + def sql_select_endnotes_format + %{#{sql_select_endnotes}} + end + def contents + @conn.select_all(sql_select_body) + end + def endnotes + @conn.select_all(sql_select_endnotes) + end + end + def tail + <<-'WOK' +


+ + + + + +
+

+ + SiSU + +

+
+ +

+ Generated by + + SiSU 0.55.3 2007-07-10 (2007w28/2) +
+ + SiSU © Ralph Amissah + 1993, current 2007. + All Rights Reserved. +
+ + SiSU + is software for document structuring, publishing and search, +
+ + www.jus.uio.no/sisu + + and + + www.sisudoc.org + +
+ w3 since October 3 1993 + + ralph@amissah.com + +

+
+

+ SiSU using: +
Standard SiSU markup syntax, +
Standard SiSU meta-markup syntax, and the +
Standard SiSU object citation numbering and system, (object/text positioning system) +
+ © Ralph Amissah 1997, current 2007. + All Rights Reserved. +

+
+

+ + GPLv3 + +

+
+

+ SiSU is released under + GPL v3 + or later, + + http://www.gnu.org/licenses/gpl.html + +

+
+

+ SiSU, developed using + + Ruby + + on + + Debian/Gnu/Linux + + software infrastructure, + with the usual GPL (or OSS) suspects. +
+ Better - "performance, reliability, scalability, security & total cost of ownership" + [not to mention flexibility & choice] +
+ Get With the Future + + Way Better! + +

+
+ + + WOK + end + @tail=tail + @counter_txt_doc,@counter_txt_ocn,@counter_endn_doc,@counter_endn_ocn=0,0,0,0 + @counters_txt,@counters_endn,@sql_select_body,@sql_select_endnotes='','','','' + FCGI.each_cgi do |cgi| + begin # all code goes in begin section + @search={ :text => [],:endnotes => [] } + q=CGI.new + @db=if cgi['db'] =~/\S+/; + @stub=/SiSU_(\S+)/.match(cgi['db'])[1] + cgi['db'] + else + @stub='sisu' + 'SiSU_sisu' + end + checked_url,checked_stats,checked_searched,checked_tip,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,selected_db='','','','','','','','','' + if cgi['view']=~/text/; checked_index,checked_text='','checked' + else checked_index,checked_text='checked','' + end + checked_echo='checked' if cgi['echo'] =~/\S/ + checked_stats='checked' if cgi['stats'] =~/\S/ + checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1 + checked_searched='checked' if cgi['searched'] =~/\S/ + checked_tip='checked' if cgi['tip'] =~/\S/ + checked_case='checked' if cgi['casesense'] =~/\S/ + checked_sql='checked' if cgi['sql'] =~/\S/ + if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1 + checked_all='checked' + checked_echo=checked_stats=checked_url=checked_searched=checked_tip=checked_sql='checked' + checked_none='' + elsif cgi['checks'] =~/check_none/ + checked_none='checked' + checked_all=checked_url=checked_stats=checked_searched=checked_tip=checked_echo=checked_sql='' + elsif cgi['checks'] =~/check_selected/ + checked_selected='checked' + elsif cgi['checks'] =~/check_default/ + checked_default='checked' + checked_echo=checked_stats=checked_url='checked' + checked_searched=checked_tip=checked_case=checked_sql='' + else + checked_selected='checked' + checked_echo=checked_stats=checked_url='checked' + checked_searched=checked_tip=checked_case=checked_sql='' + end + selected_db=case cgi['db'] + when /SiSU_pace/; '' + when /SiSU_sisu/; '' + end + db_name='sisu_sqlite.db' + db_sqlite=case cgi['db'] + when /SiSU_pace/; "/home/ralph/sisu_www/pace/sisu_sqlite.db" + when /SiSU_sisu/; "/home/ralph/sisu_www/sisu/sisu_sqlite.db" + end + @dbi="DBI:SQLite:#{db_sqlite}" #sqlite3 ? + @conn=DBI.connect(@dbi) + search_field=cgi['find'] if cgi['find'] # =~/\S+/ + @search_for=Search_request.new(search_field,q) #.analyze #% search_for + #% searches + #Canned_search.new(@base,@search_for.text1,cgi) + if @search_for.text1=~/\S+/ or @search_for.author=~/\S+/ #and search_field =~/\S/ + s1='s1=' + CGI.escape(@search_for.text1) if @search_for.text1=~/\S/ + key='key=' + CGI.escape(@search_for.keywords) if @search_for.keywords=~/\S/ + ti='&ti=' + CGI.escape(@search_for.title) if @search_for.title=~/\S/ + au='&au=' + CGI.escape(@search_for.author) if @search_for.author=~/\S/ + sj='&sj=' + CGI.escape(@search_for.subject) if @search_for.subject=~/\S/ + dsc='&dsc=' + CGI.escape(@search_for.description) if @search_for.description=~/\S/ + pb='&pb=' + CGI.escape(@search_for.publisher) if @search_for.publisher=~/\S/ + cntr='&cntr=' + CGI.escape(@search_for.contributor) if @search_for.contributor=~/\S/ + dt='&dt=' + CGI.escape(@search_for.date) if @search_for.date=~/\S/ + ty='&ty=' + CGI.escape(@search_for.type) if @search_for.type=~/\S/ + id='&id=' + CGI.escape(@search_for.identifier) if @search_for.identifier=~/\S/ + src='&src=' + CGI.escape(@search_for.source) if @search_for.source=~/\S/ + lang='&lang=' + CGI.escape(@search_for.language) if @search_for.language=~/\S/ + rel='&rel=' + CGI.escape(@search_for.relation) if @search_for.relation=~/\S/ + cov='&cov=' + CGI.escape(@search_for.coverage) if @search_for.coverage=~/\S/ + cr='&cr=' + CGI.escape(@search_for.rights) if @search_for.rights=~/\S/ + co='&co=' + CGI.escape(@search_for.comment) if @search_for.comment=~/\S/ + ab='&ab=' + CGI.escape(@search_for.abstract) if @search_for.abstract=~/\S/ + dtc='&dtc=' + CGI.escape(@search_for.date_created) if @search_for.date_created=~/\S/ + dti='&dti=' + CGI.escape(@search_for.date_issued) if @search_for.date_issued=~/\S/ + dtm='&dtm=' + CGI.escape(@search_for.date_modified) if @search_for.date_modified=~/\S/ + dta='&dta=' + CGI.escape(@search_for.date_available) if @search_for.date_available=~/\S/ + dtv='&dtv=' + CGI.escape(@search_for.date_valid) if @search_for.date_valid=~/\S/ + fns='&fns=' + CGI.escape(@search_for.filename) if @search_for.filename=~/\S/ + @@canned_search_url=if checked_all =~/checked/ + "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}&a=1" + else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}#{fns}&db=#{cgi['db']}&view=#{cgi['view']}" + end + @canned_base_url="#@base?#{s1}&db=#{cgi['db']}" + if checked_case=~/\S/ + @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1 + @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1 + else + @search[:text][1]=%{documents.clean~*'#{@search_for.text1}'} #s1 + @search[:endnotes][1]=%{endnotes.clean~*'#{@search_for.text1}'} #s1 + end + canned_note='search url:' + else + @@canned_search_url="#@base?s1=United+Nations&db=documents&view=index" + canned_note='search url example:' + end + if search_field =~/\S+/ + analyze_format=search_field.gsub(/\s*\n/,'; ') + elsif checked_all =~/checked/ or checked_url =~/checked/ + canned_search=@@canned_search_url.scan(/(?:s1|au|ti|fns)=[^&]+/) + af=canned_search.join('; ') + af.gsub!(/s1=/,'text: ') + af.gsub!(/au=/,'author: ') + af.gsub!(/ti=/,'title: ') + af.gsub!(/fns=/,'filename: ') + af.gsub!(/%2B/,' ') + analyze_format=af + st=af.split(/\s*;\s*/) + search_field=st.join("\n") + end + green=%{} + canned_search_url_txt=CGI.escapeHTML(@@canned_search_url) + the_can=%{#{canned_note} #{canned_search_url_txt}
} + p_text=p_keywords=p_title=p_author=p_subject=p_description=p_publisher=p_contributor=p_date=p_type=p_format=p_identifier=p_source=p_language=p_relation=p_coverage=p_rights=p_comment=p_abstract=p_subject=p_filename='' + p_text=%{text: #{green}#{@search_for.text1}

} if @search_for.text1 =~/\S+/ + p_keywords=%{keywords: #{green}#{@search_for.keywords}

} if @search_for.keywords =~/\S+/ + p_title=%{title: #{green}#{@search_for.title}
} if @search_for.title =~/\S+/ + p_author=%{author: #{green}#{@search_for.author}
} if @search_for.author =~/\S+/ + p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ + p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ + p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ + p_contributor=%{contributor: #{green}#{@search_for.contributor}
} if @search_for.contributor =~/\S+/ + p_date=%{date: #{green}#{@search_for.date}
} if @search_for.date =~/\S+/ + p_type=%{type: #{green}#{@search_for.type}
} if @search_for.type =~/\S+/ + p_format=%{format: #{green}#{@search_for.format}
} if @search_for.format =~/\S+/ + p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ + p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ + p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ + p_relation=%{relation: #{green}#{@search_for.relation}
} if @search_for.relation =~/\S+/ + p_coverage=%{coverage: #{green}#{@search_for.coverage}
} if @search_for.coverage =~/\S+/ + p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ + p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ + p_abstract=%{abstract: #{green}#{@search_for.abstract}
} if @search_for.abstract =~/\S+/ + p_filename=%{filename: #{green}#{@search_for.filename}
} if @search_for.filename =~/\S+/ + search_note=<<-WOK + + database: #{green}#@db; selected view: #{green}#{cgi['view']} + search string: "#{green}#{analyze_format}"
+ #{p_text} #{p_keywords} #{p_title} #{p_author} #{p_subject} #{p_description} #{p_publisher} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename} + + WOK + #eg = %{canned search e.g.:
#{url}
find: #{analyze}
database: #{database}} + #dbi_canning + @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form + unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ + print "Content-type: text/html\n\n" + puts (@header+@tail) + else #% searches + s1=if @search_for.text1 =~/\S/ + @search_for.text1 + else 'Unavailable' + end + if checked_case=~/\S/ + @search[:text]<<%{documents.clean~'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~'#{CGI.unescape(s1)}'} + else + @search[:text]<<%{documents.clean~*'#{CGI.unescape(s1)}'} + @search[:endnotes]<<%{endnotes.clean~*'#{CGI.unescape(s1)}'} + end + #dbi_request + dbi_statement=Dbi_search_statement.new(@conn,@search_for,q,checked_case) + @text_search_flag=false + @text_search_flag=dbi_statement.text_search_flag + s_contents=dbi_statement.contents + s_endnotes=dbi_statement.endnotes + @body_main,@endnotes=[],[] + @search_regx=nil + oldtid=0 + if @text_search_flag + if checked_sql =~/\S/ + sql_select_body=dbi_statement.sql_select_body_format + sql_select_endnotes=dbi_statement.sql_select_endnotes_format + else sql_select_body,sql_select_endnotes='','' + end + @body_main << '



Main Text:
' << sql_select_body + @endnotes << '



Endnotes:
' << sql_select_endnotes + else + end + #text_objects_body + s_contents.each do |c| #% text body + location=c['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] + file_suffix=c['filename'][/.+?\.(_?sst|ssm)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location.gsub!(/(\S+?)~\S\S\S?/,'\1') + l=".#{l}" + else '' + end + #metadata_found_body + if c['tid'].to_i != oldtid.to_i + ti=if c['subtitle'] =~/\S+/; "#{c['title']} - #{c['subtitle']}" + else c['title'] + end + can_txt_srch=if cgi['view']=~/index/; %{red bullet } + else %{red bullet } + end + title=%{toc html #{ti} by #{c['creator']} #{can_txt_srch}toc html pdf portrait pdf landscape odf manifest
} if file_suffix=~/s/ #hmm watch file_suffix + if @text_search_flag; title='

'+title + else title='
'+title + end + @counter_txt_doc+=1 + oldtid=c['tid'].to_i + else title='' + end + if @text_search_flag + if cgi['view']=~/text/ #% txt body + text=if c['suffix'] !~/1/ #seg + if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/ #% only this branch is working !! + unescaped_search=if @search_for.text1 =~/\S+/; CGI.unescape(@search_for.text1) + elsif q['s1'] =~/\S+/; CGI.unescape(q['s1']) + else nil + end + @search_regx=if unescaped_search #check + search_regex=[] + build=unescaped_search.scan(/\S+/).each do |g| + if g.to_s =~/(AND|OR)/ + search_regex << '|' + else search_regex << %{#{g.to_s}} + end + end + search_regex=search_regex.join(' ') + search_regex=search_regex.gsub(/\s*\|\s*/,'|') + Regexp.new(search_regex, Regexp::IGNORECASE) + else nil + end + else nil + end + matched_para=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) + matched=c['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{\\1}) + else c['body'] + end + %{

ocn #{c['ocn']}:

#{matched_para}} + elsif c['suffix'] =~/1/ #doc + %{#{title}

ocn #{c['ocn']}:#{c['body']}} + end + @counter_txt_ocn+=1 + output=if c['seg'] =~/\S+/; title+text + else text + end + elsif cgi['view']=~/index/ #% idx body + if c['suffix'] !~/1/ #seg + index=%{#{c['ocn']}, } if @text_search_flag + elsif c['suffix'] =~/1/ #doc + index=%{#{c['ocn']}, } + end + if c['seg'] =~/\S+/ + if @text_search_flag + @counter_txt_ocn+=1 + output=title+index + end + else + @counter_txt_ocn+=1 + output=unless c['suffix'] =~/1/; title+index + else %{#{title}#{c['ocn'].sort}, } + end + end + end + else output=title + end + @counters_txt=if @counter_txt_doc > 0 + if checked_stats =~/\S/ + @@lt_t=if @counter_txt_ocn == dbi_statement.sql_limit.to_i + over='over' + true + else + over='' + false + end + %{


Found in the main body of #@counter_txt_doc documents, and at #{over} #@counter_txt_ocn locations within.
} + else '' + end + else '' + end + @body_main << output #+ details + end + #text_objects_endnote + oldtid = 0 + s_endnotes.each do |e| #% endnotes + location=e['filename'][/(.+?)\.(?:_?sst|ssm)$/,1] + file_suffix=e['filename'][/.+?\.(_?sst|ssm)$/,1] + lang=if location =~ /\S+?~(\S\S\S?)$/ + l=location[/\S+?~(\S\S\S?)$/,1] + location.gsub!(/(\S+?)~\S\S\S?/,'\1') + l=".#{l}" + else '' + end + #metadata_found_endnotes + if @text_search_flag + if e['metadata_tid'].to_i != oldtid.to_i + ti=if e['subtitle'] =~/\S+/; "#{e['title']} - #{e['subtitle']}" + else e['title'] + end + can_txt_srch=if cgi['view']=~/index/; %{red bullet } + else %{red bullet } + end + title=%{

toc html #{ti} by #{e['creator']} #{can_txt_srch}toc html pdf portraitpdf landscape odf manifest
} if file_suffix=~/s/ + @counter_endn_doc+=1 + oldtid=e['metadata_tid'].to_i + else title = '' + end + if cgi['view']=~/text/ #% txt endnotes + @counter_endn_ocn+=1 + matched_endnote=if (@search_regx.to_s.class==String && @search_regx.to_s=~/\S\S+/) + matched=e['body'].gsub(/(<\s]+#{@search_regx}[^>]+?>|#@search_regx)/mi,%{\\1}) + else e['body'] + end + output=%{#{title}
note #{e['nr']} referred to from ocn #{e['ocn']}: #{matched_endnote}} + elsif cgi['view']=~/index/ #% idx endnotes + @counter_endn_ocn+=1 + output=%{#{title}#{e['nr']}#{e['ocn']}], } + end + @counters_endn=if @counter_endn_doc > 0 + if checked_stats =~/\S/ + @@lt_e=if @counter_endn_ocn == dbi_statement.sql_limit.to_i + over='over' + true + else + over='' + false + end + %{Found in the endnotes of #@counter_endn_doc documents, and at #{over} #@counter_endn_ocn locations within.
} + else '' + end + end + @endnotes << output #+ details + else @endnotes=[] #does not take out yet + end + end + offset=dbi_statement.sql_offset.to_s + limit=dbi_statement.sql_limit.to_s + @@lt_t ||=false; @@lt_e ||=false + canned=if (@@lt_t or @@lt_e) + dbi_statement.sql_canned_search_url(true).to_s + else + dbi_statement.sql_canned_search_url(false).to_s + end + limit=dbi_statement.sql_limit.to_s + cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + canned + @tail} #% print cgi_output_header+counters+body+endnotes + end + rescue Exception => e + s='
' + CGI::escapeHTML(e.backtrace.reverse.join("\n"))
+          s << CGI::escapeHTML(e.message) + '
' + cgi.out{s} + next + ensure # eg. disconnect from server + @conn.disconnect if @conn + end + end diff --git a/data/sisu/v3dv/conf/completion/README b/data/sisu/v3dv/conf/completion/README new file mode 100644 index 00000000..d723a140 --- /dev/null +++ b/data/sisu/v3dv/conf/completion/README @@ -0,0 +1,7 @@ +_sisu (naive zsh completion for SiSU) + on Debian file is located at /usr/share/sisu/conf/completion + installation: works if copied somewhere within your $fpath + do it yourself on Debian copy to ~/.zfunc or + /usr/local/share/zsh/site-functions and run compinit + + note zsh is not installed by default on a Debian system diff --git a/data/sisu/v3dv/conf/completion/_sisu b/data/sisu/v3dv/conf/completion/_sisu new file mode 100644 index 00000000..076795cb --- /dev/null +++ b/data/sisu/v3dv/conf/completion/_sisu @@ -0,0 +1,64 @@ +#compdef sisu +# Copyright (C) 2006 Ralph Amissah +# sisu, version 0.46.1 +# same license as Zsh or SiSU +local curcontext="$curcontext" state line ret=1 +typeset -A opt_args +_arguments -s -C -M 'r:|[_-]=* r:|=*' \ + '(--convert --to -C)-U[prints to screen url output map of available output possibilities]' \ + '(--convert --to -C)-u[url mapping of output files for requested processing flags]' \ + '(--convert --to -C)-V[more verbose than -v]' \ + '(--convert --to -C)-v[verbose]' \ + '--no-ocn[-\[hHp\]switches off object citation numbering]' \ + '--no-annotate[-\[mhHpoxXabN\] strips output text of additional editors endnotes]' \ + '(--convert --to -C)-A[plaintext with dos line-feeds, footnotes follow paragraphs in which they occur]' \ + '(--convert --to -C)-a[plaintext with Unix line-feeds, footnotes follow paragraphs in which they occur]' \ + '(--convert --to -C)-b[XHTML output]' \ + '(- *)-C[initialise site]' \ + '(--convert --to -C)-c[toggle screen color on or off depending on set default]' \ + '(--convert --to -C)-E[plaintext with dos line-feeds, endnotes following main text]' \ + '(--convert --to -C)-e[plaintext with Unix line-feeds, endnotes following main text]' \ + '(--convert --to -C)-F[generate sample cgi web search form \[--webserv=webrick for sisu webrick url\]]' \ + '(--convert --to -C -h)-H[HTML output, without link suffixes]' \ + '(--convert --to -C -H)-h[HTML output]' \ + '(--convert --to -C)-I[texinfo output, not maintained]' \ + '(--convert --to -C)-L[print license info]' \ + '(--convert --to -C)-M[maintenance mode, retain intermediate processing files]' \ + '(--convert --to -C)-m[create intermediate markup file, metaverse, assumed for most output instuctions]' \ + '(--convert --to -C)-N[document content certificate, output document digests]' \ + '(--convert --to -C)-n[skip intermediate markup, skip -m]' \ + '(--convert --to -C)-o[Open Document text format output]' \ + '(--convert --to -C)-p[LaTeX pdf output]' \ + '(--convert --to -C)-q[quiet mode]' \ + '(--convert --to -C)-R[post output to remote host using rsync, requires pre-configuration]' \ + '(--convert --to -C)-r[post output to remote host using scp, requires pre-configuration]' \ + '(--convert --to -C)-S[produces and shares tarred gzipped markup source document with associated images etc.]' \ + '(--convert --to -C)-s[shares markup source]' \ + '(--convert --to -C)-t[termsheet, preprocessing]' \ + '(- *)-W[starts ruby webrick server]' \ + '(--convert --to -C)-w[concordance file]' \ + '(--convert --to -C)-X[XML dom style]' \ + '(--convert --to -C)-x[XML sax style]' \ + '(--convert --to -C)-y[output summary page, manifest of existing generated output]' \ + '(--convert --to -C)-Z[Zap delete/destroy output]' \ + '--import[-\[Dd\] imports document to database]' \ + '--update[-\[Dd\] updates document in database]' \ + '--remove[-\[Dd\] removes document from database]' \ + '--dropall[-\[Dd\] drops database, tables, indexes, all!]' \ + '--create[-\[Dd\] creates new database - tables, indexes, etc.]' \ + '--recreate[-\[Dd\] drops database, killing data and creates new empty database - tables, indexes, etc.]' \ + '(--convert --to -C)-D[postgresql database instruction]' \ + '(--convert --to -C)-d[sqlite database instruction]' \ + '(- *)--help[display help information]' \ + '(--convert --to -C -2 -3 -4 -5)-1[shortcut, initial default -mNHwpy]' \ + '(--convert --to -C -1 -3 -4 -5)-2[shortcut, initial default -mNHwpaoy]' \ + '(--convert --to -C -1 -2 -4 -5)-3[shortcut, initial default -mNHwpaobxXy]' \ + '(--convert --to -C -1 -2 -3 -5)-4[shortcut, initial default -mNHwpaobxXDy --import]' \ + '(--convert --to -C -1 -2 -3 -4)-5[shortcut, initial default -mNHwpaobxXDy --update]' \ + '--to=node[XML node based input representation, experimental]' \ + '--to=sax[XML sax based input representation, experimental]' \ + '--to=dom[XML dom based input representation, experimental]' \ + '--convert=footnotes[embedded footnotes]' \ + '--to=current[current markup]' \ + '--to=xml2sst[from sisu xml to sst]' \ + '*:SiSU files:_files -g "*.(sst|ssm)(.)"' diff --git a/data/sisu/v3dv/conf/convert/kdissert_to_sisu b/data/sisu/v3dv/conf/convert/kdissert_to_sisu new file mode 100644 index 00000000..35921c3e --- /dev/null +++ b/data/sisu/v3dv/conf/convert/kdissert_to_sisu @@ -0,0 +1,161 @@ +#!/usr/bin/env ruby +=begin + * Name: modify.rb + * Author: Ralph Amissah + * http://www.jus.uio.no/sisu + * http://www.jus.uio.no/sisu/SiSU/download + * Description: Conversion script from kdissert .kdi to sisu markup .sst + * Copyright (C) 2004, 2006 Ralph Amissah + * Packaged with: SiSU information Structuring Universe - + Structured information, Serialized Units + * SiSU Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Ralph Amissah + + * License: GPL 3 or later + + Summary of GPL 3 + + 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + If you have Internet connection, the latest version of the GPL should be + available at these locations: + http://www.fsf.org/licenses/gpl.html + http://www.gnu.org/copyleft/gpl.html + http://www.jus.uio.no/sisu/gpl3.fsf + + © Ralph Amissah 1997, current 2006. + All Rights Reserved. + + * Ralph Amissah: ralph@amissah.com + ralph.amissah@gmail.com +=end +require 'rexml/document' +include REXML +argv=$* +@sisu,@sisu_base=Array.new,Array.new +unless argv.empty? + argv.each do |kdi| + if kdi =~/\.kdi$/ + system("cp #{kdi} #{kdi}.tar.gz && tar xzvf #{kdi}.tar.gz && rm #{kdi}.tar.gz") + file=File.new("maindoc.xml") + #system("cp #{kdi} /tmp/. && cd /tmp && tar xzvf /tmp/#{kdi} && cd -") + #file=File.new("/tmp/maindoc.xml") + @output=File.new("#{kdi}.sst",'w') + doc=Document.new(file) + root=doc.root + @el=Array.new + root.each do |x| + end + root.each_with_index do |content,idx| + if root.elements["item[#{idx}]/summary"] + id,ma,ch=nil,nil,Array.new + if root.elements["item[#{idx}]/id"] + id=root.elements["item[#{idx}]/id"].text.to_i + end + if root.elements["item[#{idx}]/parent"] + ma=root.elements["item[#{idx}]/parent"].text.to_s + end + if root.elements["item[#{idx}]/child"] #problem only get one child, even where several + root.get_elements("item[#{idx}]/child").each do |x| + ch << x.text + end + end + if root.elements["item[#{idx}]/summary"] + sum=root.elements["item[#{idx}]/summary"].text.to_s.strip + end + if root.elements["item[#{idx}]/text"] + txt=root.elements["item[#{idx}]/text"].text.to_s.strip + end + @el[id]=Hash.new + @el[id][:id]=id + @el[id][:ma]=ma + @el[id][:ch]=ch + @el[id][:sum]=sum + @el[id][:txt]=txt + if ma == '-1' + @el[id][:lev]=':A' + @top=id + end + end + end + @doc=Array.new + @title=@el[@top][:sum] + p @el[@top][:sum] + @doc << ':A~ ' + @el[@top][:sum] + @el[@top][:ch].each do |x| + @el[x.to_i][:lev]='1' + @doc << '1~ ' + @el[x.to_i][:sum] + @doc << @el[x.to_i][:txt] + @el[x.to_i][:ch].each do |y| + @el[y.to_i][:lev]='2' + @doc << '2~ ' + @el[y.to_i][:sum] + @doc << @el[y.to_i][:txt] + @el[y.to_i][:ch].each do |z| + @el[z.to_i][:lev]='3' + @doc << '3~ ' + @el[z.to_i][:sum] + @doc << @el[z.to_i][:txt] + @el[z.to_i][:ch].each do |za| #unsupported... consder + @el[za.to_i][:lev]='4' + @doc << '!_ ' + @el[za.to_i][:sum] + @doc << @el[za.to_i][:txt] + end + end + end + end + #@el.each_with_index do |x,i| + # if x: puts "#{i}: lev: #{x[:lev]}, id: #{x[:id]}, ma: #{x[:ma]}, ch: #{x[:ch].join(',')}" + # end + #end +# regexs strip most kdissert markup, and provide minimal info for sisu markup --> + @doc.each do |c,idx| + c.gsub!(/<\/summary>/,'') + c.gsub!(/.+?\n|<\/body>|<\/html>|

/m,'') + c.gsub!(/<\/p>/,"\n") + c.gsub!(/(.+?)<\/span>/," *{ \\1 }* ") + c.gsub!(/(.+?)<\/span>/," _{ \\1 }_ ") + c.gsub!(/(.+?)<\/span>/," /{ \\1 }/ ") + c.gsub!(/