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) --- data/doc/sisu/CHANGELOG_v3 | 3 +++ lib/sisu/v3dv/cgi.rb | 6 +++--- lib/sisu/v3dv/cgi_pgsql.rb | 4 ++-- lib/sisu/v3dv/cgi_sql_common.rb | 2 +- lib/sisu/v3dv/cgi_sqlite.rb | 4 ++-- lib/sisu/v3dv/concordance.rb | 4 ++-- lib/sisu/v3dv/conf.rb | 14 +++++++------- lib/sisu/v3dv/dbi.rb | 2 +- lib/sisu/v3dv/digests.rb | 4 ++-- lib/sisu/v3dv/embedded.rb | 2 +- lib/sisu/v3dv/epub.rb | 4 ++-- lib/sisu/v3dv/epub_format.rb | 2 +- lib/sisu/v3dv/epub_tune.rb | 2 +- lib/sisu/v3dv/git.rb | 2 +- lib/sisu/v3dv/html.rb | 4 ++-- lib/sisu/v3dv/html_format.rb | 12 ++++++------ lib/sisu/v3dv/html_segments.rb | 4 ++-- lib/sisu/v3dv/hub.rb | 6 +++--- lib/sisu/v3dv/manifest.rb | 4 ++-- lib/sisu/v3dv/manpage.rb | 4 ++-- lib/sisu/v3dv/modify.rb | 4 ++-- lib/sisu/v3dv/odf.rb | 2 +- lib/sisu/v3dv/param.rb | 2 +- lib/sisu/v3dv/particulars.rb | 2 +- lib/sisu/v3dv/plaintext.rb | 2 +- lib/sisu/v3dv/po4a.rb | 2 +- lib/sisu/v3dv/qrcode.rb | 6 +++--- lib/sisu/v3dv/share_src.rb | 2 +- lib/sisu/v3dv/sitemaps.rb | 6 +++--- lib/sisu/v3dv/sst_to_s_xml_sax.rb | 4 ++-- lib/sisu/v3dv/sysenv.rb | 14 +++++++------- lib/sisu/v3dv/texinfo.rb | 2 +- lib/sisu/v3dv/texpdf.rb | 4 ++-- lib/sisu/v3dv/wikispeak.rb | 4 ++-- lib/sisu/v3dv/xhtml.rb | 6 +++--- lib/sisu/v3dv/xml.rb | 6 +++--- lib/sisu/v3dv/xml_dom.rb | 6 +++--- lib/sisu/v3dv/xml_fictionbook.rb | 2 +- lib/sisu/v3dv/xml_md_oai_pmh_dc.rb | 4 ++-- 39 files changed, 86 insertions(+), 83 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 7f318189..e132f417 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -27,6 +27,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.11.orig.tar.xz * short term branch, merge back into v3 once tested * sisu --dev (to invoke) * module names, use more CamelCase + * class names, + * use more CamelCase + * remove "SiSU_" (reserve for module names for consistency) * modify.rb, prep script for year update, & changing module & class names 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 diff --git a/lib/sisu/v3dv/cgi_pgsql.rb b/lib/sisu/v3dv/cgi_pgsql.rb index cc75f30f..41c95536 100644 --- a/lib/sisu/v3dv/cgi_pgsql.rb +++ b/lib/sisu/v3dv/cgi_pgsql.rb @@ -60,13 +60,13 @@ module SiSU_CGI_PgSQL require_relative 'sysenv' # sysenv.rb require_relative 'cgi_sql_common' # cgi_sql_common.rb include SiSU_CGI_SQL - class SiSU_search_pgsql < SiSU_CGI_common + class SearchPgSQL < CGI_Common def initialize(opt,webserv) @opt,@webserv=opt,webserv @env=SiSU_Env::Info_env.new('',opt) @sys=SiSU_Env::System_call.new @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" - @common=SiSU_CGI_SQL::SiSU_CGI_common.new(@webserv,@opt,@image_src,@env) + @common=SiSU_CGI_SQL::CGI_Common.new(@webserv,@opt,@image_src,@env) @db=SiSU_Env::Info_db.new @cgi_file_name="#{Db[:name_prefix_db]}by_#{opt.dir_structure_by}_pgsql.cgi" end diff --git a/lib/sisu/v3dv/cgi_sql_common.rb b/lib/sisu/v3dv/cgi_sql_common.rb index e1e99888..15adf2f5 100644 --- a/lib/sisu/v3dv/cgi_sql_common.rb +++ b/lib/sisu/v3dv/cgi_sql_common.rb @@ -57,7 +57,7 @@ =end module SiSU_CGI_SQL - class SiSU_CGI_common + class CGI_Common def initialize(webserv,opt,image_src,dir) @webserv,@opt,@image_src,@env=webserv,opt,image_src,dir @cmd=opt.cmd diff --git a/lib/sisu/v3dv/cgi_sqlite.rb b/lib/sisu/v3dv/cgi_sqlite.rb index 77d5c21a..0286736b 100644 --- a/lib/sisu/v3dv/cgi_sqlite.rb +++ b/lib/sisu/v3dv/cgi_sqlite.rb @@ -60,12 +60,12 @@ module SiSU_CGI_SQLite require_relative 'sysenv' # sysenv.rb require_relative 'cgi_sql_common' # cgi_sql_common.rb include SiSU_CGI_SQL - class SiSU_search_sqlite < SiSU_CGI_common + class SearchSQLite < CGI_Common def initialize(opt,webserv) @opt,@webserv=opt,webserv @env=SiSU_Env::Info_env.new('',opt) @image_src="#{@env.url.webserv_cgi}/_sisu/image_sys" - @common=SiSU_CGI_SQL::SiSU_CGI_common.new(@webserv,@opt,@image_src,@env) + @common=SiSU_CGI_SQL::CGI_Common.new(@webserv,@opt,@image_src,@env) @cgi_file_name="#{Db[:name_prefix_db]}by_#{opt.dir_structure_by}_sqlite.cgi" end def sqlite diff --git a/lib/sisu/v3dv/concordance.rb b/lib/sisu/v3dv/concordance.rb index 58138877..a1720de9 100644 --- a/lib/sisu/v3dv/concordance.rb +++ b/lib/sisu/v3dv/concordance.rb @@ -108,7 +108,7 @@ module SiSU_Concordance def initialize(particulars) @particulars,@md=particulars,particulars.md @data=SiSU_HTML::Source::Html_environment.new(particulars).tuned_file_instructions - @file=SiSU_Env::SiSU_file.new(@md) + @file=SiSU_Env::FileOp.new(@md) @vz=SiSU_Env::Get_init.instance.skin txt_path=%{#{@md.dir_out}} SiSU_Env::Info_skin.new(@md).select @@ -187,7 +187,7 @@ WOK begin @vz=SiSU_Env::Get_init.instance.skin @env,@md,@dal_array=particulars.env,particulars.md,particulars.dal_array - @file=SiSU_Env::SiSU_file.new(@md) + @file=SiSU_Env::FileOp.new(@md) @freq=Hash.new(0) @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern @rxp_lv1=/^#{Mx[:lv_o]}1:/ #fix @rxp_lv # Mx[:lv_o] diff --git a/lib/sisu/v3dv/conf.rb b/lib/sisu/v3dv/conf.rb index 8c7159be..194e5cbd 100644 --- a/lib/sisu/v3dv/conf.rb +++ b/lib/sisu/v3dv/conf.rb @@ -69,15 +69,15 @@ module SiSU_Initialize @opt=opt end def read - SiSU_Config.new(@opt).make_homepage - SiSU_Config.new(@opt).css - SiSU_Config.new(@opt).dtd - SiSU_Config.new(@opt).cp_local_images - SiSU_Config.new(@opt).cp_external_images - SiSU_Config.new(@opt).cp_webserver_images #if @opt.mod.inspect =~/--init(?:ialize)?=site/ + ConfigSite.new(@opt).make_homepage + ConfigSite.new(@opt).css + ConfigSite.new(@opt).dtd + ConfigSite.new(@opt).cp_local_images + ConfigSite.new(@opt).cp_external_images + ConfigSite.new(@opt).cp_webserver_images #if @opt.mod.inspect =~/--init(?:ialize)?=site/ end end - class SiSU_Config #config files such as css are not updated if they already exist unless forced using the --init=site modifier + class ConfigSite #config files such as css are not updated if they already exist unless forced using the --init=site modifier require_relative 'sysenv' # sysenv.rb def initialize(opt) @opt=opt diff --git a/lib/sisu/v3dv/dbi.rb b/lib/sisu/v3dv/dbi.rb index 2039c13d..4d8883fa 100644 --- a/lib/sisu/v3dv/dbi.rb +++ b/lib/sisu/v3dv/dbi.rb @@ -66,7 +66,7 @@ module SiSU_DBI include SiSU_DbDBI require_relative 'shared_html_lite' # shared_html_lite.rb include SiSU_FormatShared - class SiSU_SQL + class SQL def initialize(opt) SiSU_Env::Load.new('dbi',true).prog @opt=opt diff --git a/lib/sisu/v3dv/digests.rb b/lib/sisu/v3dv/digests.rb index 2f784963..1564884a 100644 --- a/lib/sisu/v3dv/digests.rb +++ b/lib/sisu/v3dv/digests.rb @@ -97,7 +97,7 @@ module SiSU_DigestView def initialize(particulars) #data='',md='') @particulars=particulars @data,@env,@md=@particulars.dal_array,@particulars.env,@particulars.md - SiSU_Env::SiSU_file.new(@md).mkdir + SiSU_Env::FileOp.new(@md).mkdir @@dg ||=@env.digest.type @@dl ||=@env.digest.length @dg,@dl=@@dg,@@dl @@ -134,7 +134,7 @@ module SiSU_DigestView @@sc_info << f << e end def output - file=SiSU_Env::SiSU_file.new(@md) + file=SiSU_Env::FileOp.new(@md) filename_digest=file.write_file.hash_digest filename_digest << @@description.join << @@ds[:digests].join << @@ds[:tree].join << @@ds[:summary].join << @@sc_info.join end diff --git a/lib/sisu/v3dv/embedded.rb b/lib/sisu/v3dv/embedded.rb index 1dcc4fac..f8cfc9a9 100644 --- a/lib/sisu/v3dv/embedded.rb +++ b/lib/sisu/v3dv/embedded.rb @@ -68,7 +68,7 @@ module SiSU_Embedded @env=SiSU_Env::Info_env.new(@md.fns) @rhost=SiSU_Env::Info_remote.new(@opt).remote_host_base @base_src_dir=@opt.f_pth[:pth].sub(/\/#{@opt.f_pth[:lng]}$/,'') - @f=SiSU_Env::SiSU_file.new(@md) + @f=SiSU_Env::FileOp.new(@md) end def read songsheet diff --git a/lib/sisu/v3dv/epub.rb b/lib/sisu/v3dv/epub.rb index 6d320b6b..5afba6b0 100644 --- a/lib/sisu/v3dv/epub.rb +++ b/lib/sisu/v3dv/epub.rb @@ -98,7 +98,7 @@ module SiSU_EPUB dir_epub=@env.processing_path.epub SiSU_Env::Info_skin.new(@md).select data=nil - SiSU_Env::SiSU_file.new(@md).mkdir.output.epub + SiSU_Env::FileOp.new(@md).mkdir.output.epub @tuned_file_array=SiSU_EPUB::Source::XHtml_environment.new(@particulars).tuned_file_instructions data=@tuned_file_array scr_endnotes=SiSU_EPUB::Source::Endnotes.new(@md,data).scroll @@ -138,7 +138,7 @@ module SiSU_EPUB end def directories title=File.basename(@md.fns,'.rb') - SiSU_Env::SiSU_file.new(@md).mkdir.output.epub + SiSU_Env::FileOp.new(@md).mkdir.output.epub end def tuned_file_instructions @tell=SiSU_Screen::Ansi.new(@md.opt.cmd) diff --git a/lib/sisu/v3dv/epub_format.rb b/lib/sisu/v3dv/epub_format.rb index 25e659af..30b6e0bc 100644 --- a/lib/sisu/v3dv/epub_format.rb +++ b/lib/sisu/v3dv/epub_format.rb @@ -1596,7 +1596,7 @@ WOK %{\n #{rights}} else '' end - f=SiSU_Env::SiSU_file.new(@md) + f=SiSU_Env::FileOp.new(@md) <\\1 \\2 }) end p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) if ocn - @file=SiSU_Env::SiSU_file.new(@md) if @md + @file=SiSU_Env::FileOp.new(@md) if @md txt_obj=if seg_link=~/sisu_manifest\.html/ man_link=if @file.output_dir_structure.by_language_code? \ or @file.output_dir_structure.by_filetype? @@ -611,7 +611,7 @@ WOK class Output def initialize(data='',md='') @data,@md=data,md - @file=SiSU_Env::SiSU_file.new(@md) + @file=SiSU_Env::FileOp.new(@md) end def scroll begin diff --git a/lib/sisu/v3dv/html_format.rb b/lib/sisu/v3dv/html_format.rb index 76df9d57..662e7c75 100644 --- a/lib/sisu/v3dv/html_format.rb +++ b/lib/sisu/v3dv/html_format.rb @@ -155,7 +155,7 @@ module SiSU_HTML_Format @md=md @cf_defaults=SiSU_Env::Info_processing_flag.new @env=SiSU_Env::Info_env.new(@md.fns) - @file=SiSU_Env::SiSU_file.new(@md) + @file=SiSU_Env::FileOp.new(@md) end def home %{ @@ -334,7 +334,7 @@ WOK

} end def manifest_link(text) -# @file=SiSU_Env::SiSU_file.new(@md) if @md +# @file=SiSU_Env::FileOp.new(@md) if @md %{ #{text} } @@ -417,7 +417,7 @@ WOK end end def links_guide_vertical_open -# @file=SiSU_Env::SiSU_file.new(@md) if @md +# @file=SiSU_Env::FileOp.new(@md) if @md url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{