aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/dbi_discrete.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-10-23 23:40:45 -0400
committerRalph Amissah <ralph@amissah.com>2013-10-23 23:40:45 -0400
commitedd89902036bde18c91031470e19c871a182cf6d (patch)
tree1269e7b1660aa64896fc21768002e837233c2c24 /lib/sisu/v5/dbi_discrete.rb
parentv4 v5: version & changelog (diff)
v5: options & downstream, more use of opt.act instead of opt.cmd
* opt.act.*.set==:on instead of opt.cmd =~/\S/
Diffstat (limited to 'lib/sisu/v5/dbi_discrete.rb')
-rw-r--r--lib/sisu/v5/dbi_discrete.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sisu/v5/dbi_discrete.rb b/lib/sisu/v5/dbi_discrete.rb
index fe921c85..957009b1 100644
--- a/lib/sisu/v5/dbi_discrete.rb
+++ b/lib/sisu/v5/dbi_discrete.rb
@@ -79,7 +79,7 @@ module SiSU_DBI_Discrete #% database building
if @opt.cmd =~/[d]/ \
or @opt.mod.inspect =~/--((?:sq)?lite)/
@sql_type='sqlite'
- maintenance_check(@opt,__FILE__,__LINE__) if @opt.cmd.inspect =~/M/
+ maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on
end
@output_path=@md.file.output_path.sqlite_discrete.dir
@filename=@md.file.base_filename.sqlite_discrete
@@ -121,7 +121,7 @@ module SiSU_DBI_Discrete #% database building
sdb_index=SiSU_DbDBI::Index.new(@opt,conn,@file,'sqlite')
sdb.output_dir?
begin
- SiSU_Screen::Ansi.new(@opt.cmd,'SQLite',"[#{@opt.f_pth[:lng_is]}] #{@opt.fno}").green_title_hi unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'SQLite',"[#{@opt.f_pth[:lng_is]}] #{@opt.fno}").green_title_hi unless @opt.act[:quiet][:set]==:on
sdb.create_db
sdb.create_table.metadata_and_text
sdb.create_table.doc_objects
@@ -133,8 +133,8 @@ module SiSU_DBI_Discrete #% database building
db_exist?(db,conn)
sdb_import=SiSU_DbDBI::Import.new(@opt,conn,@file_maint,'sqlite')
sdb_import.marshal_load
- tell=SiSU_Screen::Ansi.new(@opt.cmd,"sqlite3 #{db.sqlite.db} database?")
- tell.puts_grey if @opt.cmd =~/v/
+ tell=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"sqlite3 #{db.sqlite.db} database?")
+ tell.puts_grey if @opt.act[:verbose][:set]==:on
rescue
SiSU_Errors::Rescued.new($!,$@,'-d').location do
__LINE__.to_s + ':' + __FILE__
@@ -151,7 +151,7 @@ module SiSU_DBI_Discrete #% database building
end
def connect
begin
- SiSU_Screen::Ansi.new(@opt.cmd,"DBI (#{@sql_type}) #{@opt.mod}",@opt.fns).dbi_title unless @opt.cmd =~/q/
+ SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"DBI (#{@sql_type}) #{@opt.mod}",@opt.fns).dbi_title unless @opt.act[:quiet][:set]==:on
@db.sqlite_discrete.conn_sqlite3
rescue
SiSU_Errors::Rescued.new($!,$@,@cf,@opt.fns).location do
@@ -166,7 +166,7 @@ module SiSU_DBI_Discrete #% database building
file=if @opt.inspect =~/M/
if @opt.fns and not @opt.fns.empty?
@env=SiSU_Env::InfoEnv.new(@opt.fns) if @opt.fns
- puts "\n#{@env.processing_path.sqlite}/#{@opt.fns}.sql" if @sql_type =~/sqlite/ and @opt.cmd =~/M/
+ puts "\n#{@env.processing_path.sqlite}/#{@opt.fns}.sql" if @sql_type =~/sqlite/ and @opt.act[:maintenance][:set]==:on
@db=SiSU_Env::InfoDb.new
@job="sqlite3 #{@db.sqlite.db} < #{@env.processing_path.sqlite}/#{@opt.fns}.sql"
File.new("#{@env.processing_path.sqlite}/#{@opt.fns}.sql",'w+')