From abe7e7688d045982a28cfb22b8f6269269dd6cf5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 5 Oct 2021 12:55:42 -0400 Subject: sqlite related internal naming --- src/doc_reform/io_out/cgi_sqlite_search_form.d | 4 ++-- src/doc_reform/io_out/hub.d | 4 ++-- src/doc_reform/io_out/sqlite.d | 16 ++++++++-------- src/doc_reform/meta/conf_make_meta_yaml.d | 14 ++++++++------ src/doc_reform/meta/metadoc.d | 8 ++++---- src/doc_reform/spine.d | 10 ++-------- 6 files changed, 26 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/doc_reform/io_out/cgi_sqlite_search_form.d b/src/doc_reform/io_out/cgi_sqlite_search_form.d index 585ea50..092e882 100644 --- a/src/doc_reform/io_out/cgi_sqlite_search_form.d +++ b/src/doc_reform/io_out/cgi_sqlite_search_form.d @@ -55,9 +55,9 @@ template CGIsearchSQLite() { std.file, std.format; import doc_reform.io_out; - string _sqlite_db_fn = (opt_action.sqlite_filename.empty) + string _sqlite_db_fn = (opt_action.sqliteDB_filename.empty) ? make_and_meta_struct.conf.w_srv_db_sqlite_filename - : opt_action.sqlite_filename; + : opt_action.sqliteDB_filename; string _cgi_search_script = (opt_action.cgi_sqlite_search_filename.empty) ? make_and_meta_struct.conf.w_srv_cgi_search_script : opt_action.cgi_sqlite_search_filename; diff --git a/src/doc_reform/io_out/hub.d b/src/doc_reform/io_out/hub.d index a644b66..fc6dd98 100644 --- a/src/doc_reform/io_out/hub.d +++ b/src/doc_reform/io_out/hub.d @@ -189,9 +189,9 @@ template outputHubOp() { } if ((opt_action.cgi_search_form_codegen)) { if ((opt_action.verbose)) { - string _sqlite_db_fn = (opt_action.sqlite_filename.empty) + string _sqlite_db_fn = (opt_action.sqliteDB_filename.empty) ? config.conf.w_srv_db_sqlite_filename - : opt_action.sqlite_filename; + : opt_action.sqliteDB_filename; string _cgi_search_script = (opt_action.cgi_sqlite_search_filename.empty) ? config.conf.w_srv_cgi_search_script : opt_action.cgi_sqlite_search_filename; diff --git a/src/doc_reform/io_out/sqlite.d b/src/doc_reform/io_out/sqlite.d index b66aa13..cb7b065 100644 --- a/src/doc_reform/io_out/sqlite.d +++ b/src/doc_reform/io_out/sqlite.d @@ -1548,13 +1548,13 @@ template SQLiteTablesCreate() { } if (opt_action.sqlite_db_create) { string _db_statement; - string db_filename = (opt_action.sqlite_filename.length > 0) - ? opt_action.sqlite_filename + string db_filename = (opt_action.sqliteDB_filename.length > 0) + ? opt_action.sqliteDB_filename : (config.conf.w_srv_db_sqlite_filename.length > 0) ? config.conf.w_srv_db_sqlite_filename : ""; - string db_path = (opt_action.output_dir_set.length > 0) - ? opt_action.output_dir_set + string db_path = (opt_action.sqliteDB_path.length > 0) + ? opt_action.sqliteDB_path : (config.conf.w_srv_db_sqlite_path.length > 0) ? config.conf.w_srv_db_sqlite_path : ""; @@ -1581,13 +1581,13 @@ template SQLiteDbDrop() { void SQLiteDbDrop(O,C)(O opt_action, C config) { writeln("db drop"); if ((opt_action.sqlite_db_drop)) { - string db_filename = (opt_action.sqlite_filename.length > 0) - ? opt_action.sqlite_filename + string db_filename = (opt_action.sqliteDB_filename.length > 0) + ? opt_action.sqliteDB_filename : (config.conf.w_srv_db_sqlite_filename.length > 0) ? config.conf.w_srv_db_sqlite_filename : ""; - string db_path = (opt_action.sqlite_db_path.length > 0) // - ? opt_action.sqlite_db_path + string db_path = (opt_action.sqliteDB_path.length > 0) // + ? opt_action.sqliteDB_path : (config.conf.w_srv_db_sqlite_path.length > 0) ? config.conf.w_srv_db_sqlite_path : ""; diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d index 6afec40..6d4a2b1 100644 --- a/src/doc_reform/meta/conf_make_meta_yaml.d +++ b/src/doc_reform/meta/conf_make_meta_yaml.d @@ -395,13 +395,15 @@ template contentYAMLtoSpineStruct() { : _struct_composite.conf.w_srv_host ~ _struct_composite.conf.w_srv_cgi_bin_subpath; } - if (_opt_action.cgi_sqlite_search_filename.length > 0) { - _struct_composite.conf.w_srv_cgi_action = _struct_composite.conf.w_srv_cgi_bin_url ~ "/" ~ _opt_action.cgi_sqlite_search_filename; + if (_opt_action.cgi_url_action.length > 0) { + _struct_composite.conf.w_srv_cgi_action = _opt_action.cgi_url_action; } else if ("cgi_action" in _yaml["webserv"] && _yaml["webserv"]["cgi_action"].type.string && _yaml["webserv"]["cgi_action"].tag.match(rgx.yaml_tag_is_str) ) { _struct_composite.conf.w_srv_cgi_action = _yaml["webserv"]["cgi_action"].get!string; + } else if (_opt_action.cgi_sqlite_search_filename.length > 0) { // WORKON + _struct_composite.conf.w_srv_cgi_action = _struct_composite.conf.w_srv_cgi_bin_url ~ "/" ~ _opt_action.cgi_sqlite_search_filename; } else { // action is composite, build } // if ("cgi_file_links" in _yaml["webserv"] @@ -410,8 +412,8 @@ template contentYAMLtoSpineStruct() { // ) { // _struct_composite.conf.w_srv_cgi_file_links = _yaml["webserv"]["cgi_file_links"].get!string; // } - if (_opt_action.sqlite_filename.length > 0) { - _struct_composite.conf.w_srv_db_sqlite_filename = _opt_action.sqlite_filename; + if (_opt_action.sqliteDB_filename.length > 0) { + _struct_composite.conf.w_srv_db_sqlite_filename = _opt_action.sqliteDB_filename; } else if ("db_sqlite_filename" in _yaml["webserv"] && _yaml["webserv"]["db_sqlite_filename"].type.string && _yaml["webserv"]["db_sqlite_filename"].tag.match(rgx.yaml_tag_is_str) @@ -419,8 +421,8 @@ template contentYAMLtoSpineStruct() { _struct_composite.conf.w_srv_db_sqlite_filename = _yaml["webserv"]["db_sqlite_filename"].get!string; } else { // set default ? } - if (_opt_action.sqlite_path.length > 0) { - _struct_composite.conf.w_srv_db_sqlite_path = _opt_action.sqlite_path; + if (_opt_action.sqliteDB_path.length > 0) { + _struct_composite.conf.w_srv_db_sqlite_path = _opt_action.sqliteDB_path; } else if ("db_sqlite_path" in _yaml["webserv"] && _yaml["webserv"]["db_sqlite_path"].type.string && _yaml["webserv"]["db_sqlite_path"].tag.match(rgx.yaml_tag_is_str) diff --git a/src/doc_reform/meta/metadoc.d b/src/doc_reform/meta/metadoc.d index 6f4a2a4..fdec126 100644 --- a/src/doc_reform/meta/metadoc.d +++ b/src/doc_reform/meta/metadoc.d @@ -185,8 +185,8 @@ template spineAbstraction() { @safe string filename() { string _fn = ""; string _pth = ""; - if (_opt_action.sqlite_filename.length > 0) { - _fn = _opt_action.sqlite_filename; + if (_opt_action.sqliteDB_filename.length > 0) { + _fn = _opt_action.sqliteDB_filename; } else if (_make_and_meta_struct.conf.w_srv_db_sqlite_filename.length > 0) { _fn = _make_and_meta_struct.conf.w_srv_db_sqlite_filename; } @@ -194,8 +194,8 @@ template spineAbstraction() { } @safe string path() { string _pth = ""; - if (_opt_action.sqlite_path.length > 0) { - _pth = _opt_action.sqlite_path; + if (_opt_action.sqliteDB_path.length > 0) { + _pth = _opt_action.sqliteDB_path; } else if (_make_and_meta_struct.conf.w_srv_db_sqlite_path.length > 0) { _pth = _make_and_meta_struct.conf.w_srv_db_sqlite_path; } diff --git a/src/doc_reform/spine.d b/src/doc_reform/spine.d index 502ad15..006ea1b 100755 --- a/src/doc_reform/spine.d +++ b/src/doc_reform/spine.d @@ -385,12 +385,6 @@ string program_name = "spine"; @trusted bool source_or_pod() { return (opts["pod"] || opts["source"]) ? true : false; } - @trusted string sqlite_db_path() { - return settings["sqlite-db-path"]; - } - @trusted string sqlite_db_filename() { - return settings["sqlite-db-filename"]; - } @trusted bool sqlite_discrete() { return opts["sqlite-discrete"]; } @@ -463,10 +457,10 @@ string program_name = "spine"; @trusted string output_dir_set() { return settings["output"]; } - @trusted string sqlite_filename() { + @trusted string sqliteDB_filename() { return settings["sqlite-db-filename"]; } - @trusted string sqlite_path() { + @trusted string sqliteDB_path() { return settings["sqlite-db-path"]; } @trusted string cgi_bin_root() { -- cgit v1.2.3