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) --- lib/sisu/v3dv/cgi.rb | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 lib/sisu/v3dv/cgi.rb (limited to 'lib/sisu/v3dv/cgi.rb') diff --git a/lib/sisu/v3dv/cgi.rb b/lib/sisu/v3dv/cgi.rb new file mode 100644 index 00000000..779ee35a --- /dev/null +++ b/lib/sisu/v3dv/cgi.rb @@ -0,0 +1,83 @@ +# encoding: utf-8 +=begin + + * Name: SiSU + + * Description: a framework for document structuring, publishing and search + + * Author: Ralph Amissah + + * 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) 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 + + + + ** Description: generates naive cgi search form for search of sisu database + (pgsql sqlite) + +=end +module SiSU_CGI #% database building documents + require_relative 'sysenv' # sysenv.rb + require_relative 'cgi_pgsql' # cgi_pgsql.rb + require_relative 'cgi_sqlite' # cgi_sqlite.rb + class SiSU_search + def initialize(opt) + @opt=opt + @webserv=@opt.files[0].to_s.strip + end + def search_info + a=%{ + For help on sisu search, type: + sisu --help search + } + SiSU_Screen::Ansi.new(@opt.cmd,a).print_grey + end + def read + SiSU_CGI_sqlite::SiSU_search_sqlite.new(@opt,@webserv).sqlite + SiSU_CGI_pgsql::SiSU_search_pgsql.new(@opt,@webserv).pgsql + search_info unless @opt.cmd =~/q/ + end + end +end +__END__ -- cgit v1.2.3 From 51ba2d70af41137ddc3323d79e01b28fbcb40082 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 10 Jan 2012 22:44:24 -0500 Subject: v3dv: module names, use more CamelCase --- lib/sisu/v3dv/cgi.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sisu/v3dv/cgi.rb') diff --git a/lib/sisu/v3dv/cgi.rb b/lib/sisu/v3dv/cgi.rb index 779ee35a..b1600749 100644 --- a/lib/sisu/v3dv/cgi.rb +++ b/lib/sisu/v3dv/cgi.rb @@ -74,8 +74,8 @@ module SiSU_CGI SiSU_Screen::Ansi.new(@opt.cmd,a).print_grey end def read - SiSU_CGI_sqlite::SiSU_search_sqlite.new(@opt,@webserv).sqlite - SiSU_CGI_pgsql::SiSU_search_pgsql.new(@opt,@webserv).pgsql + SiSU_CGI_SQLite::SiSU_search_sqlite.new(@opt,@webserv).sqlite + SiSU_CGI_PgSQL::SiSU_search_pgsql.new(@opt,@webserv).pgsql search_info unless @opt.cmd =~/q/ end end -- cgit v1.2.3 From 732dca2b21d2261349e639c37e6ed1431e65250c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 10 Jan 2012 22:47:40 -0500 Subject: v3dv: class names, remove "SiSU_" (reserve for module names for consistency) --- lib/sisu/v3dv/cgi.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v3dv/cgi.rb') diff --git a/lib/sisu/v3dv/cgi.rb b/lib/sisu/v3dv/cgi.rb index b1600749..b2a9c0b3 100644 --- a/lib/sisu/v3dv/cgi.rb +++ b/lib/sisu/v3dv/cgi.rb @@ -61,7 +61,7 @@ module SiSU_CGI require_relative 'sysenv' # sysenv.rb require_relative 'cgi_pgsql' # cgi_pgsql.rb require_relative 'cgi_sqlite' # cgi_sqlite.rb - class SiSU_search + class SearchSQL def initialize(opt) @opt=opt @webserv=@opt.files[0].to_s.strip @@ -74,8 +74,8 @@ module SiSU_CGI SiSU_Screen::Ansi.new(@opt.cmd,a).print_grey end def read - SiSU_CGI_SQLite::SiSU_search_sqlite.new(@opt,@webserv).sqlite - SiSU_CGI_PgSQL::SiSU_search_pgsql.new(@opt,@webserv).pgsql + SiSU_CGI_SQLite::SearchSQLite.new(@opt,@webserv).sqlite + SiSU_CGI_PgSQL::SearchPgSQL.new(@opt,@webserv).pgsql search_info unless @opt.cmd =~/q/ end end -- cgit v1.2.3