From c3a5315338f2676f01efdf2c62f9790dca32133b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 21 Aug 2013 22:58:06 -0400 Subject: v4 v5: fuchsia (sp.) --- lib/sisu/v4/cgi_pgsql.rb | 4 ++-- lib/sisu/v4/cgi_sqlite.rb | 4 ++-- lib/sisu/v4/composite.rb | 4 ++-- lib/sisu/v4/hub.rb | 8 ++++---- lib/sisu/v4/rexml.rb | 2 +- lib/sisu/v4/screen_text_color.rb | 30 +++++++++++++++--------------- lib/sisu/v4/sysenv.rb | 2 +- lib/sisu/v4/texpdf.rb | 4 ++-- lib/sisu/v5/cgi_pgsql.rb | 4 ++-- lib/sisu/v5/cgi_sqlite.rb | 4 ++-- lib/sisu/v5/composite.rb | 4 ++-- lib/sisu/v5/hub.rb | 8 ++++---- lib/sisu/v5/rexml.rb | 2 +- lib/sisu/v5/screen_text_color.rb | 30 +++++++++++++++--------------- lib/sisu/v5/sysenv.rb | 2 +- lib/sisu/v5/texpdf.rb | 4 ++-- 16 files changed, 58 insertions(+), 58 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v4/cgi_pgsql.rb b/lib/sisu/v4/cgi_pgsql.rb index 3698f769..f012fb51 100644 --- a/lib/sisu/v4/cgi_pgsql.rb +++ b/lib/sisu/v4/cgi_pgsql.rb @@ -133,9 +133,9 @@ module SiSU_CGI_PgSQL to modify use: #{@cX.brown}sisu --db-pg --webserv-output='#{@name_of[:host_url_docs]}'#{@cX.off} cgi search form link name: #{@cX.green}#{@name_of[:cgi_script]}#{@cX.off} to modify use: #{@cX.brown}sisu --db-pg --cgi-search-form-name='#{@name_of[:cgi_script]}'#{@cX.off} - #{@cX.fuschia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} + #{@cX.fuchsia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} - #{@cX.fuschia}BASED ON ALREADY EXISTING databases#{@cX.off} (default database name: #{@db.psql.db}) + #{@cX.fuchsia}BASED ON ALREADY EXISTING databases#{@cX.off} (default database name: #{@db.psql.db}) NOTE it is first necessary to createdb, use sisu to create the tables & populate the postgresql db diff --git a/lib/sisu/v4/cgi_sqlite.rb b/lib/sisu/v4/cgi_sqlite.rb index b3b67d42..da7aa97a 100644 --- a/lib/sisu/v4/cgi_sqlite.rb +++ b/lib/sisu/v4/cgi_sqlite.rb @@ -120,9 +120,9 @@ module SiSU_CGI_SQLite to modify use: #{@cX.brown}sisu --db-sqlite --webserv-output='#{@env.url.webserv_files_from_db(@opt)}'#{@cX.off} cgi search form link name: #{@cX.green}#{@env.url.cgi_sample_search_form_name(@opt)}#{@cX.off} to modify use: #{@cX.brown}sisu --db-sqlite --cgi-search-form-name='#{@env.url.cgi_sample_search_form_name(@opt)}'#{@cX.off} - #{@cX.fuschia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} + #{@cX.fuchsia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} - #{@cX.fuschia}NOTE it is first necessary to create the database and tables and populate it#{@cX.off} + #{@cX.fuchsia}NOTE it is first necessary to create the database and tables and populate it#{@cX.off} sisu --sqlite --dropall # removes existing postgresql db & tables sisu --sqlite --createall -v # creates postgresql db & tables diff --git a/lib/sisu/v4/composite.rb b/lib/sisu/v4/composite.rb index c2ba1fe1..0d0655b8 100644 --- a/lib/sisu/v4/composite.rb +++ b/lib/sisu/v4/composite.rb @@ -191,7 +191,7 @@ module SiSU_Assemble file[:prepared] else cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - STDERR.puts "\t #{cX.fuschia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuschia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end else tuned_file << para @@ -242,7 +242,7 @@ module SiSU_Assemble @ssm << loadfile else cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - STDERR.puts "\t #{cX.fuschia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuschia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end end diff --git a/lib/sisu/v4/hub.rb b/lib/sisu/v4/hub.rb index 72ed5a6b..cd3cdf91 100644 --- a/lib/sisu/v4/hub.rb +++ b/lib/sisu/v4/hub.rb @@ -221,10 +221,10 @@ module SiSU SiSU_Webserv::WebrickStart.new end def not_found - puts "\n#{@cX.fuschia}FILE NOT FOUND:#{@cX.off} << #{@opt.fns} >> - requested #{@opt.cmd} processing skipped\n" + puts "\n#{@cX.fuchsia}FILE NOT FOUND:#{@cX.off} << #{@opt.fns} >> - requested #{@opt.cmd} processing skipped\n" end def convert_name_message(fns,type,i,o,rune) - %{\nIn filename: "#{@cX.fuschia}#{fns}#{@cX.off}" << #{type} >> #{@cX.fuschia}is apre 0.36 markup filename.#{@cX.off} #{@cX.brown}Please rename your file.#{@cX.off}\n\tAs of sisu-0.37, SiSU markup files with #{@cX.brown}the extensions #{i} should be re-named #{o}#{@cX.off}\n\tif you have the program called 'rename' installed, the following rune should do the trick:\n\t\t#{rune}\n\talternatively try:\n\t\tsisu --convert --36to37 #{fns}\n\trequested #{@opt.cmd} processing skipped\n} + %{\nIn filename: "#{@cX.fuchsia}#{fns}#{@cX.off}" << #{type} >> #{@cX.fuchsia}is apre 0.36 markup filename.#{@cX.off} #{@cX.brown}Please rename your file.#{@cX.off}\n\tAs of sisu-0.37, SiSU markup files with #{@cX.brown}the extensions #{i} should be re-named #{o}#{@cX.off}\n\tif you have the program called 'rename' installed, the following rune should do the trick:\n\t\t#{rune}\n\talternatively try:\n\t\tsisu --convert --36to37 #{fns}\n\trequested #{@opt.cmd} processing skipped\n} end def not_recognised case @opt.fns @@ -238,9 +238,9 @@ module SiSU puts convert_name_message(@opt.fns,type,'.r1 .r2 and .r3','.sst',rune) puts %{\n\tNote also that you will need to change the names of the files called/required\n\twithin the document text to build the composite document\n\t\t.s1 .s2 .s3 should be .sst \n\t\t.si should be .ssi\n\trequested #{@opt.cmd} processing skipped\n} when /(\.ssi)$/ - puts "\n#{@cX.fuschia}component filetype:#{@cX.off} << #{@opt.fns} >> - is not a processed filetype, (it may be used as a component of a .ssm markup file)\n\trequested #{@opt.cmd} processing skipped\n" + puts "\n#{@cX.fuchsia}component filetype:#{@cX.off} << #{@opt.fns} >> - is not a processed filetype, (it may be used as a component of a .ssm markup file)\n\trequested #{@opt.cmd} processing skipped\n" else - puts "\n#{@cX.fuschia}FILETYPE NOT RECOGNISED:#{@cX.off} << #{@opt.fns} >> - is not a recognized filetype,\n\trequested #{@opt.cmd} processing skipped\n" + puts "\n#{@cX.fuchsia}FILETYPE NOT RECOGNISED:#{@cX.off} << #{@opt.fns} >> - is not a recognized filetype,\n\trequested #{@opt.cmd} processing skipped\n" end end end diff --git a/lib/sisu/v4/rexml.rb b/lib/sisu/v4/rexml.rb index 3e710be2..04d96d97 100644 --- a/lib/sisu/v4/rexml.rb +++ b/lib/sisu/v4/rexml.rb @@ -102,7 +102,7 @@ module SiSU_Rexml end end else - SiSU_Screen::Ansi.new(@md.opt.cmd,'fuschia',"File Not Found #{xmlfile}",'requested XML processing skipped').colorize unless @md.opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@md.opt.cmd,'fuchsia',"File Not Found #{xmlfile}",'requested XML processing skipped').colorize unless @md.opt.cmd =~/q/ exit end rescue diff --git a/lib/sisu/v4/screen_text_color.rb b/lib/sisu/v4/screen_text_color.rb index 86b41e6b..ea9ae24d 100644 --- a/lib/sisu/v4/screen_text_color.rb +++ b/lib/sisu/v4/screen_text_color.rb @@ -61,7 +61,7 @@ =end module SiSU_Screen class Color - attr_accessor :off,:marker,:bold,:underline,:invert,:darkgrey_hi,:grey_hi,:pink_hi,:fuschia_hi,:red_hi,:orange_hi,:yellow_hi,:brown_hi,:lightgreen_hi,:green_hi,:cyan_hi,:blue_hi,:navy_hi,:white,:white_bold,:grey,:pink,:fuschia,:ruby,:red,:orange,:yellow,:brown,:green,:darkgreen,:cyan,:blue,:navy,:black + attr_accessor :off,:marker,:bold,:underline,:invert,:darkgrey_hi,:grey_hi,:pink_hi,:fuchsia_hi,:red_hi,:orange_hi,:yellow_hi,:brown_hi,:lightgreen_hi,:green_hi,:cyan_hi,:blue_hi,:navy_hi,:white,:white_bold,:grey,:pink,:fuchsia,:ruby,:red,:orange,:yellow,:brown,:green,:darkgreen,:cyan,:blue,:navy,:black def initialize(&block) instance_eval &block end @@ -83,7 +83,7 @@ module SiSU_Screen end @cX=@@cX= unless @use_color Color.new do - self.off=self.white=self.white_bold=self.marker=self.bold=self.underline=self.invert=self.darkgrey_hi=self.grey_hi=self.pink_hi=self.fuschia_hi=self.red_hi=self.orange_hi=self.yellow_hi=self.brown_hi=self.lightgreen_hi=self.green_hi=self.cyan_hi=self.blue_hi=self.navy_hi=self.grey=self.pink=self.fuschia=self.ruby=self.red=self.orange=self.yellow=self.brown=self.green=self.darkgreen=self.cyan=self.blue=self.navy=self.black='' + self.off=self.white=self.white_bold=self.marker=self.bold=self.underline=self.invert=self.darkgrey_hi=self.grey_hi=self.pink_hi=self.fuchsia_hi=self.red_hi=self.orange_hi=self.yellow_hi=self.brown_hi=self.lightgreen_hi=self.green_hi=self.cyan_hi=self.blue_hi=self.navy_hi=self.grey=self.pink=self.fuchsia=self.ruby=self.red=self.orange=self.yellow=self.brown=self.green=self.darkgreen=self.cyan=self.blue=self.navy=self.black='' end else #default set to colors on Color.new do @@ -97,7 +97,7 @@ module SiSU_Screen self.darkgrey_hi = "\033[100m" self.grey_hi = "\033[47m" self.pink_hi = "\033[105m" - self.fuschia_hi = "\033[45m" + self.fuchsia_hi = "\033[45m" self.red_hi = "\033[41m" self.orange_hi = "\033[101m" self.yellow_hi = "\033[103m" @@ -109,7 +109,7 @@ module SiSU_Screen self.navy_hi = "\033[44m" self.grey = "\033[90m" self.pink = "\033[95m" - self.fuschia = "\033[35m" + self.fuchsia = "\033[35m" self.ruby = "\033[31m" self.red = "\033[91m" #check self.orange = "\033[91m" @@ -134,7 +134,7 @@ module SiSU_Screen when /darkgrey_hi/; @cX.darkgrey_hi when /grey_hi/; @cX.grey_hi when /pink_hi/; @cX.pink_hi - when /fuschia_hi/; @cX.fuschia_hi + when /fuchsia_hi/; @cX.fuchsia_hi when /red_hi/; @cX.red_hi when /orange_hi/; @cX.orange_hi when /yellow_hi/; @cX.yellow_hi @@ -147,7 +147,7 @@ module SiSU_Screen when /white/; @cX.white when /grey/; @cX.grey when /pink/; @cX.pink - when /fuschia/; @cX.fuschia + when /fuchsia/; @cX.fuchsia when /ruby/; @cX.ruby when /red/; @cX.red when /orange/; @cX.orange @@ -168,7 +168,7 @@ module SiSU_Screen when /darkgrey_hi/; puts "#{@cX.darkgrey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /grey_hi/; puts "#{@cX.grey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /pink_hi/; puts "#{@cX.pink_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /fuschia_hi/; puts "#{@cX.fuschia_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /fuchsia_hi/; puts "#{@cX.fuchsia_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /red_hi/; puts "#{@cX.red_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /orange_hi/; puts "#{@cX.orange_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /yellow_hi/; puts "#{@cX.yellow_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" @@ -182,7 +182,7 @@ module SiSU_Screen when /white/; puts "#{@cX.off}#{@txt[1]} #{@txt[2]}" when /grey/; puts "#{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" when /pink/; puts "#{@cX.pink}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /fuschia/; puts "#{@cX.fuschia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /fuchsia/; puts "#{@cX.fuchsia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" when /ruby/; puts "#{@cX.ruby}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" when /red/; puts "#{@cX.red}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" when /orange/; puts "#{@cX.orange}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" @@ -204,16 +204,16 @@ module SiSU_Screen def sisu end def rescue - STDERR.puts %{\t #{@cX.orange}Rescued#{@cX.off} #{@cX.grey}#{yield if block_given?}\n\t An#{@cX.off} #{@cX.fuschia}ERROR#{@cX.off} #{@cX.grey}occurred, message:#{@cX.off} #{@cX.fuschia}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.brown}#{@txt[2]}#{@cX.off}} + STDERR.puts %{\t #{@cX.orange}Rescued#{@cX.off} #{@cX.grey}#{yield if block_given?}\n\t An#{@cX.off} #{@cX.fuchsia}ERROR#{@cX.off} #{@cX.grey}occurred, message:#{@cX.off} #{@cX.fuchsia}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.brown}#{@txt[2]}#{@cX.off}} end def warn STDERR.puts "\t #{@cX.brown}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}" end def error - STDERR.puts "\t #{@cX.fuschia}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off}" + STDERR.puts "\t #{@cX.fuchsia}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off}" end def error2 - STDERR.puts "\t #{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.fuschia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + STDERR.puts "\t #{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.fuchsia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" end def version puts "#{@cX.blue_hi}#{@txt[0]} #{@txt[1]}#{@cX.off} #{@cX.grey} (#{@txt[3]} [#{@txt[2]}]) &#{@cX.off} #{@cX.ruby}Ruby#{@cX.off} #{@cX.grey}(#{@txt[4]})#{@cX.off}\n" @@ -421,7 +421,7 @@ __END__ self.darkgrey_hi = "\033[100m" self.grey_hi = "\033[47m" self.pink_hi = "\033[105m" - self.fuschia_hi = "\033[45m" + self.fuchsia_hi = "\033[45m" self.red_hi = "\033[41m" self.orange_hi = "\033[101m" self.yellow_hi = "\033[103m" @@ -433,7 +433,7 @@ __END__ self.navy_hi = "\033[44m" self.grey = "\033[90m" self.pink = "\033[95m" - self.fuschia = "\033[35m" + self.fuchsia = "\033[35m" self.ruby = "\033[31m" self.red = "\033[91m" #check self.orange = "\033[91m" @@ -457,7 +457,7 @@ __END__ self.darkgrey_hi = "\033[100m" self.grey_hi = "\033[47m" self.pink_hi = "\033[105m" - self.fuschia_hi = "\033[45m" + self.fuchsia_hi = "\033[45m" self.red_hi = "\033[41m" self.orange_hi = "\033[101m" self.yellow_hi = "\033[103m" @@ -469,7 +469,7 @@ __END__ self.navy_hi = "\033[44m" self.grey = "\033[90m" self.pink = "\033[95m" - self.fuschia = "\033[35m" + self.fuchsia = "\033[35m" self.ruby = "\033[31m" self.red = "\033[31m" #check self.orange = "\033[91m" diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb index 32e38ac6..bcc2adce 100644 --- a/lib/sisu/v4/sysenv.rb +++ b/lib/sisu/v4/sysenv.rb @@ -1097,7 +1097,7 @@ module SiSU_Env elsif output_dir_structure.by_filename? '' else - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuschia) + puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) puts 'set output type, by: language, filetype or filename' end @stub_set_manifest=stub + '/manifest' diff --git a/lib/sisu/v4/texpdf.rb b/lib/sisu/v4/texpdf.rb index c69067aa..d9aa2607 100644 --- a/lib/sisu/v4/texpdf.rb +++ b/lib/sisu/v4/texpdf.rb @@ -209,7 +209,7 @@ module SiSU_TeX FileUtils::cp(portrait_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_p}") FileUtils::rm(portrait_pdf) else - STDERR.puts "#{cX.fuschia}pdf file not generated#{cX.off} <#{cX.blue}#{portrait_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" + STDERR.puts "#{cX.fuchsia}pdf file not generated#{cX.off} <#{cX.blue}#{portrait_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" STDERR.puts "#{__FILE__}:#{__LINE__} NOT FOUND: #{portrait_pdf}" if @md.opt.cmd.inspect =~/M/ end end @@ -218,7 +218,7 @@ module SiSU_TeX FileUtils::cp(landscape_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_l}") FileUtils::rm(landscape_pdf) else - STDERR.puts "#{cX.fuschia}pdf file not generated#{cX.off} <#{cX.blue}#{landscape_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" + STDERR.puts "#{cX.fuchsia}pdf file not generated#{cX.off} <#{cX.blue}#{landscape_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" STDERR.puts "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.opt.cmd.inspect =~/M/ end end diff --git a/lib/sisu/v5/cgi_pgsql.rb b/lib/sisu/v5/cgi_pgsql.rb index d44e8993..10aa23fd 100644 --- a/lib/sisu/v5/cgi_pgsql.rb +++ b/lib/sisu/v5/cgi_pgsql.rb @@ -133,9 +133,9 @@ module SiSU_CGI_PgSQL to modify use: #{@cX.brown}sisu --db-pg --webserv-output='#{@name_of[:host_url_docs]}'#{@cX.off} cgi search form link name: #{@cX.green}#{@name_of[:cgi_script]}#{@cX.off} to modify use: #{@cX.brown}sisu --db-pg --cgi-search-form-name='#{@name_of[:cgi_script]}'#{@cX.off} - #{@cX.fuschia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} + #{@cX.fuchsia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} - #{@cX.fuschia}BASED ON ALREADY EXISTING databases#{@cX.off} (default database name: #{@db.psql.db}) + #{@cX.fuchsia}BASED ON ALREADY EXISTING databases#{@cX.off} (default database name: #{@db.psql.db}) NOTE it is first necessary to createdb, use sisu to create the tables & populate the postgresql db diff --git a/lib/sisu/v5/cgi_sqlite.rb b/lib/sisu/v5/cgi_sqlite.rb index 62e50c72..8b47814c 100644 --- a/lib/sisu/v5/cgi_sqlite.rb +++ b/lib/sisu/v5/cgi_sqlite.rb @@ -120,9 +120,9 @@ module SiSU_CGI_SQLite to modify use: #{@cX.brown}sisu --db-sqlite --webserv-output='#{@env.url.webserv_files_from_db(@opt)}'#{@cX.off} cgi search form link name: #{@cX.green}#{@env.url.cgi_sample_search_form_name(@opt)}#{@cX.off} to modify use: #{@cX.brown}sisu --db-sqlite --cgi-search-form-name='#{@env.url.cgi_sample_search_form_name(@opt)}'#{@cX.off} - #{@cX.fuschia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} + #{@cX.fuchsia}(settings priority: command line; sisurc.yml; else defaults)#{@cX.off} - #{@cX.fuschia}NOTE it is first necessary to create the database and tables and populate it#{@cX.off} + #{@cX.fuchsia}NOTE it is first necessary to create the database and tables and populate it#{@cX.off} sisu --sqlite --dropall # removes existing postgresql db & tables sisu --sqlite --createall -v # creates postgresql db & tables diff --git a/lib/sisu/v5/composite.rb b/lib/sisu/v5/composite.rb index 452d6576..bd78cc4b 100644 --- a/lib/sisu/v5/composite.rb +++ b/lib/sisu/v5/composite.rb @@ -191,7 +191,7 @@ module SiSU_Assemble file[:prepared] else cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - STDERR.puts "\t #{cX.fuschia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuschia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end else tuned_file << para @@ -242,7 +242,7 @@ module SiSU_Assemble @ssm << loadfile else cX=SiSU_Screen::Ansi.new(@opt.cmd).cX - STDERR.puts "\t #{cX.fuschia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuschia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end end diff --git a/lib/sisu/v5/hub.rb b/lib/sisu/v5/hub.rb index c84c84cd..7c1bb406 100644 --- a/lib/sisu/v5/hub.rb +++ b/lib/sisu/v5/hub.rb @@ -221,10 +221,10 @@ module SiSU SiSU_Webserv::WebrickStart.new end def not_found - puts "\n#{@cX.fuschia}FILE NOT FOUND:#{@cX.off} << #{@opt.fns} >> - requested #{@opt.cmd} processing skipped\n" + puts "\n#{@cX.fuchsia}FILE NOT FOUND:#{@cX.off} << #{@opt.fns} >> - requested #{@opt.cmd} processing skipped\n" end def convert_name_message(fns,type,i,o,rune) - %{\nIn filename: "#{@cX.fuschia}#{fns}#{@cX.off}" << #{type} >> #{@cX.fuschia}is apre 0.36 markup filename.#{@cX.off} #{@cX.brown}Please rename your file.#{@cX.off}\n\tAs of sisu-0.37, SiSU markup files with #{@cX.brown}the extensions #{i} should be re-named #{o}#{@cX.off}\n\tif you have the program called 'rename' installed, the following rune should do the trick:\n\t\t#{rune}\n\talternatively try:\n\t\tsisu --convert --36to37 #{fns}\n\trequested #{@opt.cmd} processing skipped\n} + %{\nIn filename: "#{@cX.fuchsia}#{fns}#{@cX.off}" << #{type} >> #{@cX.fuchsia}is apre 0.36 markup filename.#{@cX.off} #{@cX.brown}Please rename your file.#{@cX.off}\n\tAs of sisu-0.37, SiSU markup files with #{@cX.brown}the extensions #{i} should be re-named #{o}#{@cX.off}\n\tif you have the program called 'rename' installed, the following rune should do the trick:\n\t\t#{rune}\n\talternatively try:\n\t\tsisu --convert --36to37 #{fns}\n\trequested #{@opt.cmd} processing skipped\n} end def not_recognised case @opt.fns @@ -238,9 +238,9 @@ module SiSU puts convert_name_message(@opt.fns,type,'.r1 .r2 and .r3','.sst',rune) puts %{\n\tNote also that you will need to change the names of the files called/required\n\twithin the document text to build the composite document\n\t\t.s1 .s2 .s3 should be .sst \n\t\t.si should be .ssi\n\trequested #{@opt.cmd} processing skipped\n} when /(\.ssi)$/ - puts "\n#{@cX.fuschia}component filetype:#{@cX.off} << #{@opt.fns} >> - is not a processed filetype, (it may be used as a component of a .ssm markup file)\n\trequested #{@opt.cmd} processing skipped\n" + puts "\n#{@cX.fuchsia}component filetype:#{@cX.off} << #{@opt.fns} >> - is not a processed filetype, (it may be used as a component of a .ssm markup file)\n\trequested #{@opt.cmd} processing skipped\n" else - puts "\n#{@cX.fuschia}FILETYPE NOT RECOGNISED:#{@cX.off} << #{@opt.fns} >> - is not a recognized filetype,\n\trequested #{@opt.cmd} processing skipped\n" + puts "\n#{@cX.fuchsia}FILETYPE NOT RECOGNISED:#{@cX.off} << #{@opt.fns} >> - is not a recognized filetype,\n\trequested #{@opt.cmd} processing skipped\n" end end end diff --git a/lib/sisu/v5/rexml.rb b/lib/sisu/v5/rexml.rb index 5a30734f..ac8583f1 100644 --- a/lib/sisu/v5/rexml.rb +++ b/lib/sisu/v5/rexml.rb @@ -102,7 +102,7 @@ module SiSU_Rexml end end else - SiSU_Screen::Ansi.new(@md.opt.cmd,'fuschia',"File Not Found #{xmlfile}",'requested XML processing skipped').colorize unless @md.opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@md.opt.cmd,'fuchsia',"File Not Found #{xmlfile}",'requested XML processing skipped').colorize unless @md.opt.cmd =~/q/ exit end rescue diff --git a/lib/sisu/v5/screen_text_color.rb b/lib/sisu/v5/screen_text_color.rb index ebd954ae..10ced907 100644 --- a/lib/sisu/v5/screen_text_color.rb +++ b/lib/sisu/v5/screen_text_color.rb @@ -61,7 +61,7 @@ =end module SiSU_Screen class Color - attr_accessor :off,:marker,:bold,:underline,:invert,:darkgrey_hi,:grey_hi,:pink_hi,:fuschia_hi,:red_hi,:orange_hi,:yellow_hi,:brown_hi,:lightgreen_hi,:green_hi,:cyan_hi,:blue_hi,:navy_hi,:white,:white_bold,:grey,:pink,:fuschia,:ruby,:red,:orange,:yellow,:brown,:green,:darkgreen,:cyan,:blue,:navy,:black + attr_accessor :off,:marker,:bold,:underline,:invert,:darkgrey_hi,:grey_hi,:pink_hi,:fuchsia_hi,:red_hi,:orange_hi,:yellow_hi,:brown_hi,:lightgreen_hi,:green_hi,:cyan_hi,:blue_hi,:navy_hi,:white,:white_bold,:grey,:pink,:fuchsia,:ruby,:red,:orange,:yellow,:brown,:green,:darkgreen,:cyan,:blue,:navy,:black def initialize(&block) instance_eval &block end @@ -83,7 +83,7 @@ module SiSU_Screen end @cX=@@cX= unless @use_color Color.new do - self.off=self.white=self.white_bold=self.marker=self.bold=self.underline=self.invert=self.darkgrey_hi=self.grey_hi=self.pink_hi=self.fuschia_hi=self.red_hi=self.orange_hi=self.yellow_hi=self.brown_hi=self.lightgreen_hi=self.green_hi=self.cyan_hi=self.blue_hi=self.navy_hi=self.grey=self.pink=self.fuschia=self.ruby=self.red=self.orange=self.yellow=self.brown=self.green=self.darkgreen=self.cyan=self.blue=self.navy=self.black='' + self.off=self.white=self.white_bold=self.marker=self.bold=self.underline=self.invert=self.darkgrey_hi=self.grey_hi=self.pink_hi=self.fuchsia_hi=self.red_hi=self.orange_hi=self.yellow_hi=self.brown_hi=self.lightgreen_hi=self.green_hi=self.cyan_hi=self.blue_hi=self.navy_hi=self.grey=self.pink=self.fuchsia=self.ruby=self.red=self.orange=self.yellow=self.brown=self.green=self.darkgreen=self.cyan=self.blue=self.navy=self.black='' end else #default set to colors on Color.new do @@ -97,7 +97,7 @@ module SiSU_Screen self.darkgrey_hi = "\033[100m" self.grey_hi = "\033[47m" self.pink_hi = "\033[105m" - self.fuschia_hi = "\033[45m" + self.fuchsia_hi = "\033[45m" self.red_hi = "\033[41m" self.orange_hi = "\033[101m" self.yellow_hi = "\033[103m" @@ -109,7 +109,7 @@ module SiSU_Screen self.navy_hi = "\033[44m" self.grey = "\033[90m" self.pink = "\033[95m" - self.fuschia = "\033[35m" + self.fuchsia = "\033[35m" self.ruby = "\033[31m" self.red = "\033[91m" #check self.orange = "\033[91m" @@ -134,7 +134,7 @@ module SiSU_Screen when /darkgrey_hi/; @cX.darkgrey_hi when /grey_hi/; @cX.grey_hi when /pink_hi/; @cX.pink_hi - when /fuschia_hi/; @cX.fuschia_hi + when /fuchsia_hi/; @cX.fuchsia_hi when /red_hi/; @cX.red_hi when /orange_hi/; @cX.orange_hi when /yellow_hi/; @cX.yellow_hi @@ -147,7 +147,7 @@ module SiSU_Screen when /white/; @cX.white when /grey/; @cX.grey when /pink/; @cX.pink - when /fuschia/; @cX.fuschia + when /fuchsia/; @cX.fuchsia when /ruby/; @cX.ruby when /red/; @cX.red when /orange/; @cX.orange @@ -168,7 +168,7 @@ module SiSU_Screen when /darkgrey_hi/; puts "#{@cX.darkgrey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /grey_hi/; puts "#{@cX.grey_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /pink_hi/; puts "#{@cX.pink_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" - when /fuschia_hi/; puts "#{@cX.fuschia_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" + when /fuchsia_hi/; puts "#{@cX.fuchsia_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /red_hi/; puts "#{@cX.red_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /orange_hi/; puts "#{@cX.orange_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" when /yellow_hi/; puts "#{@cX.yellow_hi}#{@txt[1]}#{@cX.off} #{@cX.blue}#{@txt[2]}#{@cX.off} #{@cX.grey}#{@txt[3]}#{@cX.off}" @@ -182,7 +182,7 @@ module SiSU_Screen when /white/; puts "#{@cX.off}#{@txt[1]} #{@txt[2]}" when /grey/; puts "#{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" when /pink/; puts "#{@cX.pink}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" - when /fuschia/; puts "#{@cX.fuschia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + when /fuchsia/; puts "#{@cX.fuchsia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" when /ruby/; puts "#{@cX.ruby}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" when /red/; puts "#{@cX.red}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" when /orange/; puts "#{@cX.orange}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" @@ -204,16 +204,16 @@ module SiSU_Screen def sisu end def rescue - STDERR.puts %{\t #{@cX.orange}Rescued#{@cX.off} #{@cX.grey}#{yield if block_given?}\n\t An#{@cX.off} #{@cX.fuschia}ERROR#{@cX.off} #{@cX.grey}occurred, message:#{@cX.off} #{@cX.fuschia}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.brown}#{@txt[2]}#{@cX.off}} + STDERR.puts %{\t #{@cX.orange}Rescued#{@cX.off} #{@cX.grey}#{yield if block_given?}\n\t An#{@cX.off} #{@cX.fuchsia}ERROR#{@cX.off} #{@cX.grey}occurred, message:#{@cX.off} #{@cX.fuchsia}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off} #{@cX.brown}#{@txt[2]}#{@cX.off}} end def warn STDERR.puts "\t #{@cX.brown}#{@txt[0]}#{@cX.off} #{@cX.grey}#{@txt[1]}#{@cX.off}" end def error - STDERR.puts "\t #{@cX.fuschia}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off}" + STDERR.puts "\t #{@cX.fuchsia}#{@txt[0]}#{@cX.off} #{@cX.brown}#{@txt[1]}#{@cX.off}" end def error2 - STDERR.puts "\t #{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.fuschia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" + STDERR.puts "\t #{@cX.grey}#{@txt[0]}#{@cX.off} #{@cX.fuchsia}#{@txt[1]}#{@cX.off} #{@cX.grey}#{@txt[2]}#{@cX.off}" end def version puts "#{@cX.blue_hi}#{@txt[0]} #{@txt[1]}#{@cX.off} #{@cX.grey} (#{@txt[3]} [#{@txt[2]}]) &#{@cX.off} #{@cX.ruby}Ruby#{@cX.off} #{@cX.grey}(#{@txt[4]})#{@cX.off}\n" @@ -421,7 +421,7 @@ __END__ self.darkgrey_hi = "\033[100m" self.grey_hi = "\033[47m" self.pink_hi = "\033[105m" - self.fuschia_hi = "\033[45m" + self.fuchsia_hi = "\033[45m" self.red_hi = "\033[41m" self.orange_hi = "\033[101m" self.yellow_hi = "\033[103m" @@ -433,7 +433,7 @@ __END__ self.navy_hi = "\033[44m" self.grey = "\033[90m" self.pink = "\033[95m" - self.fuschia = "\033[35m" + self.fuchsia = "\033[35m" self.ruby = "\033[31m" self.red = "\033[91m" #check self.orange = "\033[91m" @@ -457,7 +457,7 @@ __END__ self.darkgrey_hi = "\033[100m" self.grey_hi = "\033[47m" self.pink_hi = "\033[105m" - self.fuschia_hi = "\033[45m" + self.fuchsia_hi = "\033[45m" self.red_hi = "\033[41m" self.orange_hi = "\033[101m" self.yellow_hi = "\033[103m" @@ -469,7 +469,7 @@ __END__ self.navy_hi = "\033[44m" self.grey = "\033[90m" self.pink = "\033[95m" - self.fuschia = "\033[35m" + self.fuchsia = "\033[35m" self.ruby = "\033[31m" self.red = "\033[31m" #check self.orange = "\033[91m" diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index 5993a333..1c75f4d4 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -1097,7 +1097,7 @@ module SiSU_Env elsif output_dir_structure.by_filename? '' else - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuschia) + puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) puts 'set output type, by: language, filetype or filename' end @stub_set_manifest=stub + '/manifest' diff --git a/lib/sisu/v5/texpdf.rb b/lib/sisu/v5/texpdf.rb index 08a3c953..4cf4e8f8 100644 --- a/lib/sisu/v5/texpdf.rb +++ b/lib/sisu/v5/texpdf.rb @@ -209,7 +209,7 @@ module SiSU_TeX FileUtils::cp(portrait_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_p}") FileUtils::rm(portrait_pdf) else - STDERR.puts "#{cX.fuschia}pdf file not generated#{cX.off} <#{cX.blue}#{portrait_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" + STDERR.puts "#{cX.fuchsia}pdf file not generated#{cX.off} <#{cX.blue}#{portrait_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" STDERR.puts "#{__FILE__}:#{__LINE__} NOT FOUND: #{portrait_pdf}" if @md.opt.cmd.inspect =~/M/ end end @@ -218,7 +218,7 @@ module SiSU_TeX FileUtils::cp(landscape_pdf,"#{@md.file.output_path.pdf.dir}/#{pdf_l}") FileUtils::rm(landscape_pdf) else - STDERR.puts "#{cX.fuschia}pdf file not generated#{cX.off} <#{cX.blue}#{landscape_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" + STDERR.puts "#{cX.fuchsia}pdf file not generated#{cX.off} <#{cX.blue}#{landscape_pdf.gsub(/.+?([^\/]+?\.pdf)$/,'\1')}#{cX.off}> (check texlive dependencies)" STDERR.puts "#{__FILE__}:#{__LINE__} NOT FOUND: #{landscape_pdf}" if @md.opt.cmd.inspect =~/M/ end end -- cgit v1.2.3 From bd4e38f4a8c31242caf7d7cbfd3a083a263752b8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 21 Aug 2013 23:09:51 -0400 Subject: v4 v5: rescued error messages --- lib/sisu/v4/composite.rb | 4 ++-- lib/sisu/v4/concordance.rb | 6 +++--- lib/sisu/v4/dal.rb | 16 ++++++++-------- lib/sisu/v4/db_drop.rb | 2 +- lib/sisu/v4/db_import.rb | 8 ++++---- lib/sisu/v4/db_select.rb | 2 +- lib/sisu/v4/dbi.rb | 2 +- lib/sisu/v4/dbi_discrete.rb | 4 ++-- lib/sisu/v4/digests.rb | 2 +- lib/sisu/v4/embedded.rb | 2 +- lib/sisu/v4/epub.rb | 12 ++++++------ lib/sisu/v4/epub_concordance.rb | 6 +++--- lib/sisu/v4/epub_segments.rb | 2 +- lib/sisu/v4/epub_tune.rb | 2 +- lib/sisu/v4/errors.rb | 4 ++-- lib/sisu/v4/html.rb | 8 ++++---- lib/sisu/v4/html_scroll.rb | 2 +- lib/sisu/v4/html_segments.rb | 2 +- lib/sisu/v4/html_tune.rb | 2 +- lib/sisu/v4/hub.rb | 2 +- lib/sisu/v4/manifest.rb | 4 ++-- lib/sisu/v4/manpage.rb | 2 +- lib/sisu/v4/odf.rb | 2 +- lib/sisu/v4/param.rb | 4 ++-- lib/sisu/v4/particulars.rb | 22 +++++++++++----------- lib/sisu/v4/plaintext.rb | 2 +- lib/sisu/v4/po4a.rb | 2 +- lib/sisu/v4/qrcode.rb | 4 ++-- lib/sisu/v4/rexml.rb | 2 +- lib/sisu/v4/sitemaps.rb | 2 +- lib/sisu/v4/sst_do_inline_footnotes.rb | 4 ++-- lib/sisu/v4/sst_to_s_xml_sax.rb | 4 ++-- lib/sisu/v4/texpdf.rb | 8 ++++---- lib/sisu/v4/update.rb | 2 +- lib/sisu/v4/urls.rb | 4 ++-- lib/sisu/v4/webrick.rb | 4 ++-- lib/sisu/v4/wikispeak.rb | 2 +- lib/sisu/v4/xhtml.rb | 4 ++-- lib/sisu/v4/xml.rb | 4 ++-- lib/sisu/v4/xml_dom.rb | 4 ++-- lib/sisu/v4/xml_fictionbook.rb | 2 +- lib/sisu/v4/xml_scaffold.rb | 2 +- lib/sisu/v5/composite.rb | 4 ++-- lib/sisu/v5/concordance.rb | 6 +++--- lib/sisu/v5/dal.rb | 16 ++++++++-------- lib/sisu/v5/db_drop.rb | 2 +- lib/sisu/v5/db_import.rb | 8 ++++---- lib/sisu/v5/db_select.rb | 2 +- lib/sisu/v5/dbi.rb | 2 +- lib/sisu/v5/dbi_discrete.rb | 4 ++-- lib/sisu/v5/digests.rb | 2 +- lib/sisu/v5/embedded.rb | 2 +- lib/sisu/v5/epub.rb | 12 ++++++------ lib/sisu/v5/epub_concordance.rb | 6 +++--- lib/sisu/v5/epub_segments.rb | 2 +- lib/sisu/v5/epub_tune.rb | 2 +- lib/sisu/v5/errors.rb | 4 ++-- lib/sisu/v5/html.rb | 8 ++++---- lib/sisu/v5/html_scroll.rb | 2 +- lib/sisu/v5/html_segments.rb | 2 +- lib/sisu/v5/html_tune.rb | 2 +- lib/sisu/v5/hub.rb | 2 +- lib/sisu/v5/manifest.rb | 4 ++-- lib/sisu/v5/manpage.rb | 2 +- lib/sisu/v5/odf.rb | 2 +- lib/sisu/v5/param.rb | 4 ++-- lib/sisu/v5/particulars.rb | 22 +++++++++++----------- lib/sisu/v5/plaintext.rb | 2 +- lib/sisu/v5/po4a.rb | 2 +- lib/sisu/v5/qrcode.rb | 4 ++-- lib/sisu/v5/rexml.rb | 2 +- lib/sisu/v5/sitemaps.rb | 2 +- lib/sisu/v5/sst_do_inline_footnotes.rb | 4 ++-- lib/sisu/v5/sst_to_s_xml_sax.rb | 4 ++-- lib/sisu/v5/texpdf.rb | 8 ++++---- lib/sisu/v5/update.rb | 2 +- lib/sisu/v5/urls.rb | 4 ++-- lib/sisu/v5/webrick.rb | 4 ++-- lib/sisu/v5/wikispeak.rb | 2 +- lib/sisu/v5/xhtml.rb | 4 ++-- lib/sisu/v5/xml.rb | 4 ++-- lib/sisu/v5/xml_dom.rb | 4 ++-- lib/sisu/v5/xml_fictionbook.rb | 2 +- lib/sisu/v5/xml_scaffold.rb | 2 +- 84 files changed, 180 insertions(+), 180 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v4/composite.rb b/lib/sisu/v4/composite.rb index 0d0655b8..2d537f4a 100644 --- a/lib/sisu/v4/composite.rb +++ b/lib/sisu/v4/composite.rb @@ -103,7 +103,7 @@ module SiSU_Assemble write(assembled) Dir.chdir(pwd) rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -220,7 +220,7 @@ module SiSU_Assemble @fns_array=IO.readlines(@opt.fns,'') insertions? rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/concordance.rb b/lib/sisu/v4/concordance.rb index 567b36e0..5387dce3 100644 --- a/lib/sisu/v4/concordance.rb +++ b/lib/sisu/v4/concordance.rb @@ -99,7 +99,7 @@ module SiSU_Concordance SiSU_Concordance::Source::Words.new(@particulars).songsheet end rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -216,7 +216,7 @@ WOK @alphlst=SiSU_i18n::Alphabet.new(@md.opt.lng).hash_strings @rgx_scanlist=%r{#{Mx[:fa_italics_o]}[#{@alphlst[:l]}#{@alphlst[:u]}0-9"\s]{2,12}#{Mx[:fa_italics_c]}|#{Mx[:fa_bold_o]}[#{@alphlst[:l]}#{@alphlst[:u]}0-9"\s]{2,12}#{Mx[:fa_bold_c]}|(?:https?|file)://\S+|<\S+?>|[#{@alphlst[:l]}#{@alphlst[:u]}]+|\w+}mi rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -227,7 +227,7 @@ WOK @file_concordance=File.open(@file.place_file.html_concordance.dir,'w') map_para rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/dal.rb b/lib/sisu/v4/dal.rb index e8574528..4a158fb6 100644 --- a/lib/sisu/v4/dal.rb +++ b/lib/sisu/v4/dal.rb @@ -123,7 +123,7 @@ module SiSU_DAL : @opt.fns create_dal rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@@fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@@fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -144,7 +144,7 @@ module SiSU_DAL ? read_fnc : @@dal_array.dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -163,7 +163,7 @@ module SiSU_DAL end dal=(@@idx_arr[:sst].empty?) ? read_idx_sst : @@idx_arr[:sst].dup #check rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -182,7 +182,7 @@ module SiSU_DAL end dal=(@@idx_arr[:tex].empty?) ? read_idx_raw : @@idx_arr[:tex].dup #check rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -201,7 +201,7 @@ module SiSU_DAL end dal=(@@idx_arr[:html].empty?) ? read_idx_html : @@idx_arr[:html].dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -220,7 +220,7 @@ module SiSU_DAL end dal=(@@idx_arr[:xhtml].empty?) ? read_idx_xhtml : @@idx_arr[:xhtml].dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -239,7 +239,7 @@ module SiSU_DAL end dal=(@@map_arr[:nametags].empty?) ? read_map_nametags : @@map_arr[:nametags].dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -258,7 +258,7 @@ module SiSU_DAL end dal=(@@map_arr[:ocn_htmlseg].empty?) ? read_map_ocn_htmlseg : @@map_arr[:ocn_htmlseg].dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/db_drop.rb b/lib/sisu/v4/db_drop.rb index 6c6b3cd0..80167822 100644 --- a/lib/sisu/v4/db_drop.rb +++ b/lib/sisu/v4/db_drop.rb @@ -108,7 +108,7 @@ module SiSU_DbDrop sdb.create_table.urls sdb_index.create_indexes rescue - SiSU_Errors::InfoError.new($!,$@,'-D').error do + SiSU_Errors::Rescued.new($!,$@,'-D').location do __LINE__.to_s + ':' + __FILE__ end sdb.output_dir? diff --git a/lib/sisu/v4/db_import.rb b/lib/sisu/v4/db_import.rb index 4f77cdb0..240efd67 100644 --- a/lib/sisu/v4/db_import.rb +++ b/lib/sisu/v4/db_import.rb @@ -171,7 +171,7 @@ module SiSU_DbImport STDERR.puts "Error code: #{e.err}" STDERR.puts "Error message: #{e.errstr}" STDERR.puts "Error SQLSTATE: #{e.state}" - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" @@ -184,7 +184,7 @@ module SiSU_DbImport puts "#{__FILE__}:#{__LINE__}" end rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" @@ -569,7 +569,7 @@ module SiSU_DbImport end end rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -702,7 +702,7 @@ module SiSU_DbImport t=SiSU_DbTuple::LoadUrls.new(@conn,f,u,@@id_t,@opt,@file_maint) tuple=t.tuple rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/db_select.rb b/lib/sisu/v4/db_select.rb index d8b63b3b..f6d07030 100644 --- a/lib/sisu/v4/db_select.rb +++ b/lib/sisu/v4/db_select.rb @@ -127,7 +127,7 @@ module SiSU_DbSelect @sdb.create_table.urls @sdb_index.create_indexes rescue - SiSU_Errors::InfoError.new($!,$@,'-D').error; @sdb.output_dir? do + SiSU_Errors::Rescued.new($!,$@,'-D').location; @sdb.output_dir? do __LINE__.to_s + ':' + __FILE__ end end diff --git a/lib/sisu/v4/dbi.rb b/lib/sisu/v4/dbi.rb index 20443c7c..3cd9dc85 100644 --- a/lib/sisu/v4/dbi.rb +++ b/lib/sisu/v4/dbi.rb @@ -133,7 +133,7 @@ manually create the database: "#{cX.green}#{@db.db}#{cX.off}" if it does not yet begin SiSU_DbDBI::Case.new(@opt,@conn,@sql_type).cases rescue - SiSU_Errors::InfoError.new($!,$@,@cf,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@cf,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/dbi_discrete.rb b/lib/sisu/v4/dbi_discrete.rb index 5b7d36bf..d96fbe13 100644 --- a/lib/sisu/v4/dbi_discrete.rb +++ b/lib/sisu/v4/dbi_discrete.rb @@ -136,7 +136,7 @@ module SiSU_DBI_Discrete #% database building tell=SiSU_Screen::Ansi.new(@opt.cmd,"sqlite3 #{db.sqlite.db} database?") tell.puts_grey if @opt.cmd =~/v/ rescue - SiSU_Errors::InfoError.new($!,$@,'-d').error do + SiSU_Errors::Rescued.new($!,$@,'-d').location do __LINE__.to_s + ':' + __FILE__ end sdb.output_dir? @@ -154,7 +154,7 @@ module SiSU_DBI_Discrete #% database building SiSU_Screen::Ansi.new(@opt.cmd,"DBI (#{@sql_type}) #{@opt.mod}",@opt.fns).dbi_title unless @opt.cmd =~/q/ @db.sqlite_discrete.conn_sqlite3 rescue - SiSU_Errors::InfoError.new($!,$@,@cf,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@cf,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/digests.rb b/lib/sisu/v4/digests.rb index 65a379c4..75a340b0 100644 --- a/lib/sisu/v4/digests.rb +++ b/lib/sisu/v4/digests.rb @@ -87,7 +87,7 @@ module SiSU_DigestView end SiSU_DigestView::Source::Scroll.new(@particulars).songsheet rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/embedded.rb b/lib/sisu/v4/embedded.rb index c0be9351..c36af0e5 100644 --- a/lib/sisu/v4/embedded.rb +++ b/lib/sisu/v4/embedded.rb @@ -82,7 +82,7 @@ module SiSU_Embedded multimedia begin rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/epub.rb b/lib/sisu/v4/epub.rb index 0cfdbfa5..d83e3aad 100644 --- a/lib/sisu/v4/epub.rb +++ b/lib/sisu/v4/epub.rb @@ -107,7 +107,7 @@ module SiSU_EPUB SiSU_EPUB::Source::Seg.new(@md,data).songsheet SiSU_EPUB::Source::Output.new(@md).songsheet rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -338,7 +338,7 @@ module SiSU_EPUB @@toc[:seg] << toc[:seg] @@toc[:scr] << toc[:seg] rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -635,7 +635,7 @@ module SiSU_EPUB end out.close rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -650,7 +650,7 @@ module SiSU_EPUB end out.close rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -724,7 +724,7 @@ WOK filename_xhtml.close end rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -742,7 +742,7 @@ WOK filename_xhtml.close end rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end diff --git a/lib/sisu/v4/epub_concordance.rb b/lib/sisu/v4/epub_concordance.rb index 3a8cea75..838e4595 100644 --- a/lib/sisu/v4/epub_concordance.rb +++ b/lib/sisu/v4/epub_concordance.rb @@ -89,7 +89,7 @@ module SiSU_EPUB_Concordance SiSU_EPUB_Concordance::Source::Words.new(@particulars).songsheet end rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -172,7 +172,7 @@ WOK @rgx_splitlist=%r{[—.,;:-]+|#{Mx[:nbsp]}+}mi @rgx_scanlist=%r{#{Mx[:fa_italics_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_italics_c]}|#{Mx[:fa_bold_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_bold_c]}|#{Mx[:url_o]}https?://\S+?#{Mx[:url_c]}|file://\S+|<\S+?>|\w+|[a-zA-Z]+}mi rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -186,7 +186,7 @@ WOK @file_concordance=File.open("#{@path}/content/#{@md.fn[:epub_concord]}",'w') map_para rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/epub_segments.rb b/lib/sisu/v4/epub_segments.rb index ee8ab26e..44db5fe9 100644 --- a/lib/sisu/v4/epub_segments.rb +++ b/lib/sisu/v4/epub_segments.rb @@ -144,7 +144,7 @@ WOK SiSU_EPUB_Seg::Seg.new.cleanup # (((( added )))) #### (((( END )))) #### rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/epub_tune.rb b/lib/sisu/v4/epub_tune.rb index e6e92334..45291ca8 100644 --- a/lib/sisu/v4/epub_tune.rb +++ b/lib/sisu/v4/epub_tune.rb @@ -133,7 +133,7 @@ module SiSU_EPUB_Tune end SiSU_EPUB_Tune::Tune.new(@data,@md).output rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v4/errors.rb b/lib/sisu/v4/errors.rb index 13a58f77..fc9726d4 100644 --- a/lib/sisu/v4/errors.rb +++ b/lib/sisu/v4/errors.rb @@ -62,7 +62,7 @@ module SiSU_Errors require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen - class InfoError |[#{@alphlst[:l]}#{@alphlst[:u]}]+|\w+}mi rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -227,7 +227,7 @@ WOK @file_concordance=File.open(@file.place_file.html_concordance.dir,'w') map_para rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/dal.rb b/lib/sisu/v5/dal.rb index ed03969f..5bf9b87c 100644 --- a/lib/sisu/v5/dal.rb +++ b/lib/sisu/v5/dal.rb @@ -123,7 +123,7 @@ module SiSU_DAL : @opt.fns create_dal rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@@fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@@fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -144,7 +144,7 @@ module SiSU_DAL ? read_fnc : @@dal_array.dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -163,7 +163,7 @@ module SiSU_DAL end dal=(@@idx_arr[:sst].empty?) ? read_idx_sst : @@idx_arr[:sst].dup #check rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -182,7 +182,7 @@ module SiSU_DAL end dal=(@@idx_arr[:tex].empty?) ? read_idx_raw : @@idx_arr[:tex].dup #check rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -201,7 +201,7 @@ module SiSU_DAL end dal=(@@idx_arr[:html].empty?) ? read_idx_html : @@idx_arr[:html].dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -220,7 +220,7 @@ module SiSU_DAL end dal=(@@idx_arr[:xhtml].empty?) ? read_idx_xhtml : @@idx_arr[:xhtml].dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -239,7 +239,7 @@ module SiSU_DAL end dal=(@@map_arr[:nametags].empty?) ? read_map_nametags : @@map_arr[:nametags].dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -258,7 +258,7 @@ module SiSU_DAL end dal=(@@map_arr[:ocn_htmlseg].empty?) ? read_map_ocn_htmlseg : @@map_arr[:ocn_htmlseg].dup rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/db_drop.rb b/lib/sisu/v5/db_drop.rb index caf7faa5..252a311b 100644 --- a/lib/sisu/v5/db_drop.rb +++ b/lib/sisu/v5/db_drop.rb @@ -108,7 +108,7 @@ module SiSU_DbDrop sdb.create_table.urls sdb_index.create_indexes rescue - SiSU_Errors::InfoError.new($!,$@,'-D').error do + SiSU_Errors::Rescued.new($!,$@,'-D').location do __LINE__.to_s + ':' + __FILE__ end sdb.output_dir? diff --git a/lib/sisu/v5/db_import.rb b/lib/sisu/v5/db_import.rb index 9025b359..5f89c968 100644 --- a/lib/sisu/v5/db_import.rb +++ b/lib/sisu/v5/db_import.rb @@ -171,7 +171,7 @@ module SiSU_DbImport STDERR.puts "Error code: #{e.err}" STDERR.puts "Error message: #{e.errstr}" STDERR.puts "Error SQLSTATE: #{e.state}" - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" @@ -184,7 +184,7 @@ module SiSU_DbImport puts "#{__FILE__}:#{__LINE__}" end rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end sqlfn="#{@env.processing_path.sql}/#{@md.fnb}.sql" @@ -569,7 +569,7 @@ module SiSU_DbImport end end rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -702,7 +702,7 @@ module SiSU_DbImport t=SiSU_DbTuple::LoadUrls.new(@conn,f,u,@@id_t,@opt,@file_maint) tuple=t.tuple rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/db_select.rb b/lib/sisu/v5/db_select.rb index 845cafde..879862b1 100644 --- a/lib/sisu/v5/db_select.rb +++ b/lib/sisu/v5/db_select.rb @@ -127,7 +127,7 @@ module SiSU_DbSelect @sdb.create_table.urls @sdb_index.create_indexes rescue - SiSU_Errors::InfoError.new($!,$@,'-D').error; @sdb.output_dir? do + SiSU_Errors::Rescued.new($!,$@,'-D').location; @sdb.output_dir? do __LINE__.to_s + ':' + __FILE__ end end diff --git a/lib/sisu/v5/dbi.rb b/lib/sisu/v5/dbi.rb index 2d8ac64e..cc2b614e 100644 --- a/lib/sisu/v5/dbi.rb +++ b/lib/sisu/v5/dbi.rb @@ -133,7 +133,7 @@ manually create the database: "#{cX.green}#{@db.db}#{cX.off}" if it does not yet begin SiSU_DbDBI::Case.new(@opt,@conn,@sql_type).cases rescue - SiSU_Errors::InfoError.new($!,$@,@cf,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@cf,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/dbi_discrete.rb b/lib/sisu/v5/dbi_discrete.rb index 572ac154..fe921c85 100644 --- a/lib/sisu/v5/dbi_discrete.rb +++ b/lib/sisu/v5/dbi_discrete.rb @@ -136,7 +136,7 @@ module SiSU_DBI_Discrete #% database building tell=SiSU_Screen::Ansi.new(@opt.cmd,"sqlite3 #{db.sqlite.db} database?") tell.puts_grey if @opt.cmd =~/v/ rescue - SiSU_Errors::InfoError.new($!,$@,'-d').error do + SiSU_Errors::Rescued.new($!,$@,'-d').location do __LINE__.to_s + ':' + __FILE__ end sdb.output_dir? @@ -154,7 +154,7 @@ module SiSU_DBI_Discrete #% database building SiSU_Screen::Ansi.new(@opt.cmd,"DBI (#{@sql_type}) #{@opt.mod}",@opt.fns).dbi_title unless @opt.cmd =~/q/ @db.sqlite_discrete.conn_sqlite3 rescue - SiSU_Errors::InfoError.new($!,$@,@cf,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@cf,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/digests.rb b/lib/sisu/v5/digests.rb index 9eba6544..ea2e81cd 100644 --- a/lib/sisu/v5/digests.rb +++ b/lib/sisu/v5/digests.rb @@ -87,7 +87,7 @@ module SiSU_DigestView end SiSU_DigestView::Source::Scroll.new(@particulars).songsheet rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/embedded.rb b/lib/sisu/v5/embedded.rb index c7fec7ed..5ce0bf04 100644 --- a/lib/sisu/v5/embedded.rb +++ b/lib/sisu/v5/embedded.rb @@ -82,7 +82,7 @@ module SiSU_Embedded multimedia begin rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/epub.rb b/lib/sisu/v5/epub.rb index 960ddd68..26f1dc0d 100644 --- a/lib/sisu/v5/epub.rb +++ b/lib/sisu/v5/epub.rb @@ -107,7 +107,7 @@ module SiSU_EPUB SiSU_EPUB::Source::Seg.new(@md,data).songsheet SiSU_EPUB::Source::Output.new(@md).songsheet rescue - SiSU_Errors::InfoError.new($!,$@,@opt.cmd,@opt.fns).error do + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -338,7 +338,7 @@ module SiSU_EPUB @@toc[:seg] << toc[:seg] @@toc[:scr] << toc[:seg] rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -635,7 +635,7 @@ module SiSU_EPUB end out.close rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -650,7 +650,7 @@ module SiSU_EPUB end out.close rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -724,7 +724,7 @@ WOK filename_xhtml.close end rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -742,7 +742,7 @@ WOK filename_xhtml.close end rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end diff --git a/lib/sisu/v5/epub_concordance.rb b/lib/sisu/v5/epub_concordance.rb index 8940c3a3..976ca619 100644 --- a/lib/sisu/v5/epub_concordance.rb +++ b/lib/sisu/v5/epub_concordance.rb @@ -89,7 +89,7 @@ module SiSU_EPUB_Concordance SiSU_EPUB_Concordance::Source::Words.new(@particulars).songsheet end rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure @@ -172,7 +172,7 @@ WOK @rgx_splitlist=%r{[—.,;:-]+|#{Mx[:nbsp]}+}mi @rgx_scanlist=%r{#{Mx[:fa_italics_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_italics_c]}|#{Mx[:fa_bold_o]}[a-zA-Z0-9"\s]{2,12}#{Mx[:fa_bold_c]}|#{Mx[:url_o]}https?://\S+?#{Mx[:url_c]}|file://\S+|<\S+?>|\w+|[a-zA-Z]+}mi rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end end @@ -186,7 +186,7 @@ WOK @file_concordance=File.open("#{@path}/content/#{@md.fn[:epub_concord]}",'w') map_para rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/epub_segments.rb b/lib/sisu/v5/epub_segments.rb index ee85619d..9f483610 100644 --- a/lib/sisu/v5/epub_segments.rb +++ b/lib/sisu/v5/epub_segments.rb @@ -144,7 +144,7 @@ WOK SiSU_EPUB_Seg::Seg.new.cleanup # (((( added )))) #### (((( END )))) #### rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/epub_tune.rb b/lib/sisu/v5/epub_tune.rb index 256ed323..c017c2df 100644 --- a/lib/sisu/v5/epub_tune.rb +++ b/lib/sisu/v5/epub_tune.rb @@ -133,7 +133,7 @@ module SiSU_EPUB_Tune end SiSU_EPUB_Tune::Tune.new(@data,@md).output rescue - SiSU_Errors::InfoError.new($!,$@,@md.opt.cmd,@md.fns).error do + SiSU_Errors::Rescued.new($!,$@,@md.opt.cmd,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure diff --git a/lib/sisu/v5/errors.rb b/lib/sisu/v5/errors.rb index 9721bf72..37a8e1a5 100644 --- a/lib/sisu/v5/errors.rb +++ b/lib/sisu/v5/errors.rb @@ -62,7 +62,7 @@ module SiSU_Errors require_relative 'sysenv' # sysenv.rb include SiSU_Env; include SiSU_Screen - class InfoError Date: Wed, 21 Aug 2013 23:13:05 -0400 Subject: v4 v5: terminal message, code marker --- lib/sisu/v4/constants.rb | 8 +----- lib/sisu/v4/hub.rb | 10 +++---- lib/sisu/v4/sysenv.rb | 3 +-- lib/sisu/v4/texpdf.rb | 6 ++--- lib/sisu/v4/utils.rb | 68 +++++++++++++++++++++++++++++++++++++++--------- lib/sisu/v5/constants.rb | 8 +----- lib/sisu/v5/hub.rb | 10 +++---- lib/sisu/v5/sysenv.rb | 3 +-- lib/sisu/v5/texpdf.rb | 6 ++--- lib/sisu/v5/utils.rb | 68 +++++++++++++++++++++++++++++++++++++++--------- 10 files changed, 130 insertions(+), 60 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v4/constants.rb b/lib/sisu/v4/constants.rb index fab3890f..28bb2f49 100644 --- a/lib/sisu/v4/constants.rb +++ b/lib/sisu/v4/constants.rb @@ -310,13 +310,7 @@ DEVELOPER={ maintenance: :false, } __END__ -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:red).set -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:green) -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) -puts ANSI_C[:red] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__ -puts "#{ANSI_C[:red]} #{__LINE__.to_s} #{ANSI_C[:off]} #{__FILE__}" -puts ANSI_C[:fuchsia] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__.gsub(/([^\/]+$)/,"#{ANSI_C[:fuchsia]}\\1#{ANSI_C[:off]}") -puts ANSI_C[:red] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__.gsub(/([^\/]+$)/,"#{ANSI_C[:red]}\\1#{ANSI_C[:off]}") +utils.rb consider: 〔comment〕 〔links?????〕 diff --git a/lib/sisu/v4/hub.rb b/lib/sisu/v4/hub.rb index 84c10dd2..5f80e795 100644 --- a/lib/sisu/v4/hub.rb +++ b/lib/sisu/v4/hub.rb @@ -186,22 +186,22 @@ module SiSU @@n_do=0 end def remote_put_base_site_rsync # -CR - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base end def remote_put_base_site_rsync_match # -CCRZ - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base_sync end def remote_put_base_site # -Cr - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base end def remote_put_base_site_all # -CCr - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base_all end @@ -691,7 +691,7 @@ module SiSU elsif action_on_file_ == :true \ and @opt.files.length == 0 STDERR.puts %{requested action requires valid sisu markup file [filename (.sst .ssm)] or wildcard (that includes a valid filename)} - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) if @opt.cmd =~/[MV]/ + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:fuchsia) if @opt.cmd =~/[MV]/ end elsif @opt.mod.inspect =~/--query/ require_relative 'sst_identify_markup' # sst_identify_markup.rb diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb index bcc2adce..cfbbc0c1 100644 --- a/lib/sisu/v4/sysenv.rb +++ b/lib/sisu/v4/sysenv.rb @@ -1097,8 +1097,7 @@ module SiSU_Env elsif output_dir_structure.by_filename? '' else - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) - puts 'set output type, by: language, filetype or filename' + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('set output type, by: language, filetype or filename') end @stub_set_manifest=stub + '/manifest' end diff --git a/lib/sisu/v4/texpdf.rb b/lib/sisu/v4/texpdf.rb index 82b47218..3d226533 100644 --- a/lib/sisu/v4/texpdf.rb +++ b/lib/sisu/v4/texpdf.rb @@ -246,8 +246,7 @@ module SiSU_TeX and File.size(texfile) > 0 #@tex_f_no+=1 else - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) - puts "\tzero file size #{@env.processing_path.tex}/#{texfile}" + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark("\tzero file size #{@env.processing_path.tex}/#{texfile}") end end end @@ -342,8 +341,7 @@ module SiSU_TeX elsif @md.opt.act[:pdf_p][:set]==:on 'pdfTex portrait' else - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) - 'error: neither landscape nor portrait' + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('error: neither landscape nor portrait') end SiSU_Screen::Ansi.new(@md.opt.cmd,txt_gen).txt_grey if @md.opt.cmd=~/[MVvz]/ if defined? @md.rights.all \ diff --git a/lib/sisu/v4/utils.rb b/lib/sisu/v4/utils.rb index 134fbc21..b120cc01 100644 --- a/lib/sisu/v4/utils.rb +++ b/lib/sisu/v4/utils.rb @@ -92,15 +92,39 @@ module SiSU_Utils #ansi_color + @line.to_s + ansi_color_off + ' ' + @file.gsub(/([^\/]+$)/,"#{ansi_color}\\1#{ansi_color_off}") c end - def set(color=nil) - c=ansi(color) + def var(v,x) + h={ c: nil, m: '' } + if v.class == Hash + h[:c] = (defined? v[:c]) ? v[:c] : '' + h[:m] = (defined? v[:m]) ? v[:m] : '' + else + if v.class == Symbol + h[:c]=v + elsif v.class == String + h[:m]=v + end + if x.class == Symbol + h[:c]=x + elsif x.class == String + h[:m]=x + end + h[:c] = (defined? h[:c]) ? h[:c] : '' + h[:m] = (defined? h[:m]) ? h[:m] : '' + end + h[:c]=ansi(h[:c]) + h[:m]=message(h[:m]) + h + end + def message(msg='') + @message=(msg.empty?) ? '' : " #{msg}" + end + def set(v=nil,x=nil) + v=var(v,x) file,path=File.basename(@file),File.dirname(@file) - c[:on] + @line + c[:off] + ' ' + path + '/' "#{c[:on]}#{file}#{c[:off]}" + v[:c][:on] + @line + v[:c][:off] + ' ' + path + '/' "#{v[:c][:on]}#{file}#{v[:c][:off]}" + v[:m] end - def set_(color=nil) - c=ansi(color) - c[:on] + @line + c[:off] + ' ' + - @file.gsub(/([^\/]+$)/,"#{c[:on]}\\1#{c[:off]}") + def mark(v=nil,x=nil) + puts set(v,x) end end class Path @@ -116,9 +140,29 @@ module SiSU_Utils end end __END__ -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:red) -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:green) -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:inv_red) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark({ m: %{ + code: #{@@flag[:code]}, <-- close "#{t_o}" +}}) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark({ m: %{ + code: #{@@flag['code']}, <-- close "#{t_o}" +}, c: :green}) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark({ m: %{ + code: #{@@flag['code']}, open --> "#{t_o}" +}}) if t_o=~/^```/m +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark(%{ code: #{@@flag['code']}, open --> "#{t_o}" }) \ +if t_o=~/^```/m +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark("open -->",:green) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:green,"open -->") +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark("open -->") +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:green) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark("open -->") +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark('open -->',:green) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:red).mark puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:red).set -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).set -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:inv_red).set +puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set('',:green) +puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set('',:fuchsia) +puts ANSI_C[:red] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__ +puts "#{ANSI_C[:red]} #{__LINE__.to_s} #{ANSI_C[:off]} #{__FILE__}" +puts ANSI_C[:fuchsia] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__.gsub(/([^\/]+$)/,"#{ANSI_C[:fuchsia]}\\1#{ANSI_C[:off]}") +puts ANSI_C[:red] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__.gsub(/([^\/]+$)/,"#{ANSI_C[:red]}\\1#{ANSI_C[:off]}") diff --git a/lib/sisu/v5/constants.rb b/lib/sisu/v5/constants.rb index 6f9d4580..bc98ca99 100644 --- a/lib/sisu/v5/constants.rb +++ b/lib/sisu/v5/constants.rb @@ -310,13 +310,7 @@ DEVELOPER={ maintenance: :false, } __END__ -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:red).set -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:green) -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) -puts ANSI_C[:red] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__ -puts "#{ANSI_C[:red]} #{__LINE__.to_s} #{ANSI_C[:off]} #{__FILE__}" -puts ANSI_C[:fuchsia] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__.gsub(/([^\/]+$)/,"#{ANSI_C[:fuchsia]}\\1#{ANSI_C[:off]}") -puts ANSI_C[:red] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__.gsub(/([^\/]+$)/,"#{ANSI_C[:red]}\\1#{ANSI_C[:off]}") +utils.rb consider: 〔comment〕 〔links?????〕 diff --git a/lib/sisu/v5/hub.rb b/lib/sisu/v5/hub.rb index 052d983c..08ad7b58 100644 --- a/lib/sisu/v5/hub.rb +++ b/lib/sisu/v5/hub.rb @@ -186,22 +186,22 @@ module SiSU @@n_do=0 end def remote_put_base_site_rsync # -CR - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base end def remote_put_base_site_rsync_match # -CCRZ - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).rsync_base_sync end def remote_put_base_site # -Cr - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base end def remote_put_base_site_all # -CCr - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:cyan) if @opt.act[:maintenance][:set] ==:on + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:cyan) if @opt.act[:maintenance][:set] ==:on require_relative 'remote' # remote.rb SiSU_Remote::Put.new(@opt).scp_base_all end @@ -691,7 +691,7 @@ module SiSU elsif action_on_file_ == :true \ and @opt.files.length == 0 STDERR.puts %{requested action requires valid sisu markup file [filename (.sst .ssm)] or wildcard (that includes a valid filename)} - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) if @opt.cmd =~/[MV]/ + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:fuchsia) if @opt.cmd =~/[MV]/ end elsif @opt.mod.inspect =~/--query/ require_relative 'sst_identify_markup' # sst_identify_markup.rb diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index 1c75f4d4..3092532b 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -1097,8 +1097,7 @@ module SiSU_Env elsif output_dir_structure.by_filename? '' else - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) - puts 'set output type, by: language, filetype or filename' + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('set output type, by: language, filetype or filename') end @stub_set_manifest=stub + '/manifest' end diff --git a/lib/sisu/v5/texpdf.rb b/lib/sisu/v5/texpdf.rb index 18d2d2a0..0d259cf1 100644 --- a/lib/sisu/v5/texpdf.rb +++ b/lib/sisu/v5/texpdf.rb @@ -246,8 +246,7 @@ module SiSU_TeX and File.size(texfile) > 0 #@tex_f_no+=1 else - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) - puts "\tzero file size #{@env.processing_path.tex}/#{texfile}" + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark("\tzero file size #{@env.processing_path.tex}/#{texfile}") end end end @@ -342,8 +341,7 @@ module SiSU_TeX elsif @md.opt.act[:pdf_p][:set]==:on 'pdfTex portrait' else - puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) - 'error: neither landscape nor portrait' + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('error: neither landscape nor portrait') end SiSU_Screen::Ansi.new(@md.opt.cmd,txt_gen).txt_grey if @md.opt.cmd=~/[MVvz]/ if defined? @md.rights.all \ diff --git a/lib/sisu/v5/utils.rb b/lib/sisu/v5/utils.rb index eb707ee9..8ebc3647 100644 --- a/lib/sisu/v5/utils.rb +++ b/lib/sisu/v5/utils.rb @@ -92,15 +92,39 @@ module SiSU_Utils #ansi_color + @line.to_s + ansi_color_off + ' ' + @file.gsub(/([^\/]+$)/,"#{ansi_color}\\1#{ansi_color_off}") c end - def set(color=nil) - c=ansi(color) + def var(v,x) + h={ c: nil, m: '' } + if v.class == Hash + h[:c] = (defined? v[:c]) ? v[:c] : '' + h[:m] = (defined? v[:m]) ? v[:m] : '' + else + if v.class == Symbol + h[:c]=v + elsif v.class == String + h[:m]=v + end + if x.class == Symbol + h[:c]=x + elsif x.class == String + h[:m]=x + end + h[:c] = (defined? h[:c]) ? h[:c] : '' + h[:m] = (defined? h[:m]) ? h[:m] : '' + end + h[:c]=ansi(h[:c]) + h[:m]=message(h[:m]) + h + end + def message(msg='') + @message=(msg.empty?) ? '' : " #{msg}" + end + def set(v=nil,x=nil) + v=var(v,x) file,path=File.basename(@file),File.dirname(@file) - c[:on] + @line + c[:off] + ' ' + path + '/' "#{c[:on]}#{file}#{c[:off]}" + v[:c][:on] + @line + v[:c][:off] + ' ' + path + '/' "#{v[:c][:on]}#{file}#{v[:c][:off]}" + v[:m] end - def set_(color=nil) - c=ansi(color) - c[:on] + @line + c[:off] + ' ' + - @file.gsub(/([^\/]+$)/,"#{c[:on]}\\1#{c[:off]}") + def mark(v=nil,x=nil) + puts set(v,x) end end class Path @@ -116,9 +140,29 @@ module SiSU_Utils end end __END__ -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:red) -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:green) -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:inv_red) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark({ m: %{ + code: #{@@flag[:code]}, <-- close "#{t_o}" +}}) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark({ m: %{ + code: #{@@flag['code']}, <-- close "#{t_o}" +}, c: :green}) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark({ m: %{ + code: #{@@flag['code']}, open --> "#{t_o}" +}}) if t_o=~/^```/m +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark(%{ code: #{@@flag['code']}, open --> "#{t_o}" }) \ +if t_o=~/^```/m +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark("open -->",:green) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:green,"open -->") +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark("open -->") +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark(:green) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark("open -->") +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).mark('open -->',:green) +SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:red).mark puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:red).set -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).set -puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:inv_red).set +puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set('',:green) +puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set('',:fuchsia) +puts ANSI_C[:red] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__ +puts "#{ANSI_C[:red]} #{__LINE__.to_s} #{ANSI_C[:off]} #{__FILE__}" +puts ANSI_C[:fuchsia] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__.gsub(/([^\/]+$)/,"#{ANSI_C[:fuchsia]}\\1#{ANSI_C[:off]}") +puts ANSI_C[:red] + __LINE__.to_s + ANSI_C[:off] + ' ' + __FILE__.gsub(/([^\/]+$)/,"#{ANSI_C[:red]}\\1#{ANSI_C[:off]}") -- cgit v1.2.3 From 386233f07b668554d0057c405c661a95d588b43a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 21 Aug 2013 23:14:21 -0400 Subject: v5: markup syntax add: switch ocn (object numbering) off & on for content block * switch ocn off & on for a block of content, line containing only off: "--~#" (omit headings where possible) "---#" on: "--+#" --- lib/sisu/v5/dal_doc_objects.rb | 27 +++++++++++++++++ lib/sisu/v5/dal_doc_str.rb | 66 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) (limited to 'lib') diff --git a/lib/sisu/v5/dal_doc_objects.rb b/lib/sisu/v5/dal_doc_objects.rb index 64ddbfb1..b2be6105 100644 --- a/lib/sisu/v5/dal_doc_objects.rb +++ b/lib/sisu/v5/dal_doc_objects.rb @@ -423,6 +423,33 @@ module SiSU_DAL_DocumentStructure self end end + class ObjectFlag + attr_accessor :obj,:is,:of,:flag,:mod,:tmp + def initialize + @of=:flag + @is=@obj=@flag=@mod=@tmp=nil + end + def flag(h,o=nil) + of= @of #String, classification - group + is= :flag #String, classification - specific type + obj= nil #String, text content + flag= h[:flag] || ((defined? o.flag) ? o.flag : nil) #String, text content + mod= h[:mod] || ((defined? o.mod) ? o.mod : nil) #String, text content + tmp= h[:flag] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use + @of,@is,@obj,@flag,@mod,@tmp=of,is,obj,flag,mod,tmp + self + end + def flag_ocn(h,o=nil) + of= @of #String, classification - group + is= :flag_ocn #String, classification - specific type + obj= nil #String, text content + flag= h[:flag] || ((defined? o.flag) ? o.flag : nil) #String, text content + mod= h[:mod] || ((defined? o.mod) ? o.mod : nil) #String, text content + tmp= h[:flag] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use + @of,@is,@obj,@flag,@mod,@tmp=of,is,obj,flag,mod,tmp + self + end + end class ObjectLayout attr_accessor :obj,:is,:of,:from,:tmp def initialize diff --git a/lib/sisu/v5/dal_doc_str.rb b/lib/sisu/v5/dal_doc_str.rb index 70c2e61f..c8174323 100644 --- a/lib/sisu/v5/dal_doc_str.rb +++ b/lib/sisu/v5/dal_doc_str.rb @@ -157,6 +157,24 @@ module SiSU_DAL_DocumentStructureExtract @@counter,@verse_count=0,0 @metadata={} @data.each do |t_o| + if t_o =~/^--([+~-])[#]$/ + h=case $1 + when /[+]/ + @@flag[:ocn]=:on + {flag: :ocn_on} + when /[~]/ + @@flag[:ocn]=:off_headings_substantive + {flag: :ocn_off, mod: :headings_substantive} + when /[-]/ + @@flag[:ocn]=:off_headings_exclude + {flag: :ocn_off, mod: :headings_exclude} + else + @@flag[:ocn]=:on + {flag: :ocn_on} + end + t_o=SiSU_DAL_DocumentStructure::ObjectFlag.new.flag_ocn(h) + next + end t_o=t_o.gsub(/(?:\n\s*\n)+/m,"\n") unless @@flag['code'] if t_o !~/^(?:code|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\{|\{table)[ ~]/ \ and not @@flag['code'] \ @@ -192,18 +210,48 @@ module SiSU_DAL_DocumentStructureExtract obj=$1 note=endnote_test?(obj) obj,tags=extract_tags(obj) + if @@flag[:ocn]==:off_headings_exclude \ + or @@flag[:ocn]==:off_headings_substantive + unless obj =~ /[~-][#]\s*$/ + if @@flag[:ocn]==:off_headings_exclude + obj << ' -#' + elsif @@flag[:ocn]==:off_headings_substantive + obj << ' ~#' + end + end + end h={ lv: lv, ln: ln, obj: obj, idx: idx, tags: tags } SiSU_DAL_DocumentStructure::ObjectHeading.new.heading(h) elsif t_o=~/^:?[A-C1-6]\~(\S+?)-\s+(.+)/m name,obj=$1,$2 note=endnote_test?(obj) obj,tags=extract_tags(obj) + if @@flag[:ocn]==:off_headings_exclude \ + or @@flag[:ocn]==:off_headings_substantive + unless obj =~ /[~-][#]\s*$/ + if @@flag[:ocn]==:off_headings_exclude + obj << ' -#' + elsif @@flag[:ocn]==:off_headings_substantive + obj << ' ~#' + end + end + end h={ lv: lv, name: name, obj: obj, idx: idx, autonum_: false, tags: tags} SiSU_DAL_DocumentStructure::ObjectHeading.new.heading(h) elsif t_o=~/^:?[A-C1-6]\~(\S+)\s+(.+)/m name,obj=$1,$2 note=endnote_test?(obj) obj,tags=extract_tags(obj,name) + if @@flag[:ocn]==:off_headings_exclude \ + or @@flag[:ocn]==:off_headings_substantive + unless obj =~ /[~-][#]\s*$/ + if @@flag[:ocn]==:off_headings_exclude + obj << ' -#' + elsif @@flag[:ocn]==:off_headings_substantive + obj << ' ~#' + end + end + end h={ lv: lv, name: name, obj: obj, idx: idx, tags: tags } SiSU_DAL_DocumentStructure::ObjectHeading.new.heading(h) else nil @@ -221,6 +269,12 @@ module SiSU_DAL_DocumentStructureExtract note=endnote_test?(obj) obj,tags=extract_tags(obj) unless obj=~/\A\s*\Z/m + if @@flag[:ocn]==:off_headings_exclude \ + or @@flag[:ocn]==:off_headings_substantive + unless obj =~ /[~-][#]\s*$/ + obj << ' ~#' + end + end h={ bullet_: bullet, hang: hang, indent: indent, obj: obj, idx: idx, note_: note, image_: image, tags: tags } SiSU_DAL_DocumentStructure::ObjectPara.new.paragraph(h) end @@ -238,6 +292,12 @@ module SiSU_DAL_DocumentStructureExtract note=endnote_test?(obj) obj,tags=extract_tags(obj) unless obj=~/\A\s*\Z/m + if @@flag[:ocn]==:off_headings_exclude \ + or @@flag[:ocn]==:off_headings_substantive + unless obj =~ /[~-][#]\s*$/ + obj << ' ~#' + end + end h={ hang: hang, indent: indent, obj: obj, idx: idx, note_: note, image_: image, tags: tags } SiSU_DAL_DocumentStructure::ObjectPara.new.paragraph(h) end @@ -255,6 +315,12 @@ module SiSU_DAL_DocumentStructureExtract image=image_test(t_o) note=endnote_test?(t_o) obj,tags=extract_tags(t_o) + if @@flag[:ocn]==:off_headings_exclude \ + or @@flag[:ocn]==:off_headings_substantive + unless obj =~ /[~-][#]\s*$/ + obj << ' ~#' + end + end unless obj=~/\A\s*\Z/m h={ bullet_: false, indent: 0, hang: 0, obj: obj, idx: idx, note_: note, image_: image, tags: tags } SiSU_DAL_DocumentStructure::ObjectPara.new.paragraph(h) -- cgit v1.2.3 From 27cce87ed33bd46ef298c848a45651ce782830a3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 21 Aug 2013 23:18:00 -0400 Subject: v5: alternative open and close for blocks using line starting with "```" * e.g. open code block: "``` code" close code block: "```" start poem: "``` poem" end poem: "```" * remove need for an empty line between opening & closing of a text block --- lib/sisu/v5/dal.rb | 4 +- lib/sisu/v5/dal_doc_str.rb | 223 +++++++++++++++--------- lib/sisu/v5/dal_expand_insertions.rb | 4 +- lib/sisu/v5/dal_misc_arrange.rb | 155 ++++++++++++++++ lib/sisu/v5/dal_substitutions_and_insertions.rb | 145 --------------- 5 files changed, 299 insertions(+), 232 deletions(-) create mode 100644 lib/sisu/v5/dal_misc_arrange.rb delete mode 100644 lib/sisu/v5/dal_substitutions_and_insertions.rb (limited to 'lib') diff --git a/lib/sisu/v5/dal.rb b/lib/sisu/v5/dal.rb index 5bf9b87c..0a2a35b1 100644 --- a/lib/sisu/v5/dal.rb +++ b/lib/sisu/v5/dal.rb @@ -78,7 +78,7 @@ module SiSU_DAL require_relative 'dal_images' # dal_images.rb require_relative 'dal_metadata' # dal_metadata.rb require_relative 'dal_character_check' # dal_character_check.rb - require_relative 'dal_substitutions_and_insertions' # dal_substitutions_and_insertions.rb + require_relative 'dal_misc_arrange' # dal_misc_arrange.rb require_relative 'dal_expand_insertions' # dal_expand_insertions.rb require_relative 'prog_text_translation' # prog_text_translation.rb require_relative 'shared_sem' # shared_sem.rb @@ -479,7 +479,7 @@ module SiSU_DAL reset data=@data data=SiSU_DAL_Insertions::Insertions.new(@md,data).expand_insertions? # dal_expand_insertions.rb - data=SiSU_DAL_SubstituteAndInsert::SI.new(@md,data).substitutions_and_insertions? # dal_substitutions_and_insertions.rb + data=SiSU_DAL_MiscArrangeText::SI.new(@md,data).prepare_text # dal_misc_arrange.rb data,metadata=SiSU_DAL_DocumentStructureExtract::Build.new(@md,data).identify_parts # dal_doc_str.rb data=SiSU_DAL_Syntax::Markup.new(@md,data).songsheet # dal_syntax.rb data,endnote_array=SiSU_DAL_CharacterCheck::Check.new(data).character_check_and_oldstyle_endnote_array # dal_character_check.rb diff --git a/lib/sisu/v5/dal_doc_str.rb b/lib/sisu/v5/dal_doc_str.rb index c8174323..ebde930a 100644 --- a/lib/sisu/v5/dal_doc_str.rb +++ b/lib/sisu/v5/dal_doc_str.rb @@ -61,15 +61,33 @@ =end module SiSU_DAL_DocumentStructureExtract class Instantiate < SiSU_Param::Parameters::Instructions - @@flag={} #Beware!! + @@flag={ + ocn: :on, + code: :off, + poem: :off, + block: :off, + group: :off, + alt: :off, + table: :off, + table_to: :off, + } def initialize - @@flag['table_to']=false + @@flag[:table_to]=:off @@counter=@@column=@@columns=0 @@line_mode='' end end class Build - @@flag={} #Beware!! + @@flag={ + ocn: :on, + code: :off, + poem: :off, + block: :off, + group: :off, + alt: :off, + table: :off, + table_to: :off, + } def initialize(md,data) @md,@data=md,data SiSU_DAL_DocumentStructureExtract::Instantiate.new @@ -175,14 +193,15 @@ module SiSU_DAL_DocumentStructureExtract t_o=SiSU_DAL_DocumentStructure::ObjectFlag.new.flag_ocn(h) next end - t_o=t_o.gsub(/(?:\n\s*\n)+/m,"\n") unless @@flag['code'] + t_o=t_o.gsub(/(?:\n\s*\n)+/m,"\n") if @@flag[:code]==:off if t_o !~/^(?:code|poem|alt|group|block)\{|^\}(?:code|poem|alt|group|block)|^(?:table\{|\{table)[ ~]/ \ - and not @@flag['code'] \ - and not @@flag['poem'] \ - and not @@flag['group'] \ - and not @@flag['block'] \ - and not @@flag['alt'] \ - and not @@flag['table'] + and t_o !~/^```\s+(?:code|poem|alt|group|block)|^```(?:\s*[~-][#])?\s*$/ \ + and @@flag[:code]==:off \ + and @@flag[:poem]==:off \ + and @@flag[:group]==:off \ + and @@flag[:block]==:off \ + and @@flag[:alt]==:off \ + and @@flag[:table]==:off unless t_o =~/^(?:@\S+?:|%+)\s/ # extract book index for paragraph if any idx=if t_o=~/^=\{(.+)\}\s*$\Z/m; m=$1 t_o=t_o.gsub(/\n=\{.+\}\s*$\Z/m,'') @@ -326,39 +345,73 @@ module SiSU_DAL_DocumentStructureExtract SiSU_DAL_DocumentStructure::ObjectPara.new.paragraph(h) end end - elsif not @@flag['code'] - if t_o =~/^code\{/ - @@flag['code']=true + elsif @@flag[:code]==:off + if t_o =~/^(?:code\{|```\s+code)/ + @@flag[:code]=case t_o + when /^code\{/; :curls + when /^```\s+code/; :tics + else @@flag[:code] #error + end @@counter=1 - @codeblock_numbered=(t_o =~/^code\{#/) ? true : false + @codeblock_numbered=(t_o =~/^(?:code\{#|```\s+code\s[#])/) ? true : false h={ obj: 'code block start' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) - elsif t_o =~/^poem\{/ - @@flag['poem']=true + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) + elsif t_o =~/^(?:poem\{|```\s+poem)/ + @@flag[:poem]=case t_o + when /^poem\{/; :curls + when /^```\s+poem/; :tics + else @@flag[:poem] #error + end h={ obj: 'poem start' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) tuned_file << t_o - elsif t_o =~/^group\{/ - @@flag['group']=true + elsif t_o =~/^(?:group\{|```\s+group)/ + @@flag[:group]=case t_o + when /^group\{/; :curls + when /^```\s+group/; :tics + else @@flag[:group] #error + end h={ obj: 'group text start' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) tuned_file << t_o - elsif t_o =~/^block\{/ - @@flag['block']=true + elsif t_o =~/^(?:block\{|```\s+block)/ + @@flag[:block]=case t_o + when /^block\{/; :curls + when /^```\s+block/; :tics + else @@flag[:block] #error + end h={ obj: 'block text start' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) tuned_file << t_o - elsif t_o =~/^alt\{/ - @@flag['alt']=true + elsif t_o =~/^(?:alt\{|```\s+alt)/ + @@flag[:alt]=case t_o + when /^alt\{/; :curls + when /^```\s+alt/; :tics + else @@flag[:alt] #error + end h={ obj: 'alt text start' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) tuned_file << t_o elsif t_o =~/^(?:table\{|\{table)[ ~]/ h={ obj: 'table start' } #introduce a counter - ins=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #ins=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) + ins=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) tuned_file << ins if t_o=~/^table\{(?:~h)?\s+/ - @@flag['table']=true + @@flag[:table]=:curls + @rows='' + case t_o + when /table\{~h\s+c(\d+);\s+(.+)/ + cols=$1 + col=$2.scan(/\d+/) + heading=true + when /table\{\s+c(\d+);\s+(.+)/ + cols=$1 + col=$2.scan(/\d+/) + heading=false + end + @h={ head_: heading, cols: cols, widths: col, idx: idx } + elsif t_o=~/^```\s+table(?:~h)?\s+/ + @@flag[:table]=:tics @rows='' case t_o when /table\{~h\s+c(\d+);\s+(.+)/ @@ -427,21 +480,23 @@ module SiSU_DAL_DocumentStructureExtract end t_o end - if @@flag['table'] - if @@flag['table'] \ - and t_o =~/^\}table/ #two table representations should be consolidated as one - @@flag['table']=false + if @@flag[:table]==:curls or @@flag[:table]==:tics + if (@@flag[:table]==:curls \ + and t_o =~/^\}table/) \ + or (@@flag[:table]==:tics \ + and t_o =~/^```(?:\s*[~-][#])?\s*$/) + @@flag[:table]=:off headings,columns,widths,idx=@h[:head_],@h[:cols],@h[:widths],@h[:idx] @h={ head_: headings, cols: columns, widths: widths, idx: idx, obj: @rows } t_o=SiSU_DAL_DocumentStructure::ObjectTable.new.table(@h) tuned_file << t_o @h,@rows=nil,'' h={ obj: 'table end' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) t_o else if t_o.is_a?(String) \ - and t_o !~/^table\{/ + and t_o !~/^(?:table\{|```\s+table)/ t_o=t_o.gsub(/^\n+/m,''). #check added for ruby 1.9.2 not needed in 1.8 series (tested in v2) gsub(/\n+/m,"#{Mx[:tc_p]}") @rows += t_o + Mx[:tc_c] @@ -449,9 +504,10 @@ module SiSU_DAL_DocumentStructureExtract t_o=nil end end - if @@flag['code'] - if t_o =~/^\}code/ - @@flag['code']=false + if @@flag[:code]==:curls or @@flag[:code]==:tics + if (@@flag[:code]==:curls and t_o =~/^\}code/) \ + or (@@flag[:code]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + @@flag[:code]=:off obj=@tuned_code.join("\n") tags=[] h={ obj: obj, tags: tags, number_: @codeblock_numbered } @@ -459,66 +515,66 @@ module SiSU_DAL_DocumentStructureExtract @tuned_code=[] tuned_file << t_o h={ obj: 'code block end' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) end - if @@flag['code'] \ + if (@@flag[:code]==:curls or @@flag[:code]==:tics) \ and t_o.is_a?(String) sub_array=t_o.dup + "#{Mx[:br_nl]}" - @line_mode=sub_array.scan(/.+/) @line_mode=[] sub_array.scan(/.+/) {|w| @line_mode << w if w =~/[\S]+/} - t_o=SiSU_DAL_DocumentStructureExtract::Build.new(@md,@line_mode).build_lines('code').join + t_o=SiSU_DAL_DocumentStructureExtract::Build.new(@md,@line_mode).build_lines(:code).join @tuned_code << t_o t_o=nil end - elsif @@flag['poem'] \ - or @@flag['group'] \ - or @@flag['block'] \ - or @@flag['alt'] - if @@flag['poem'] \ - and t_o =~/^\}poem/ - @@flag['poem']=false + elsif (@@flag[:poem]==:curls or @@flag[:poem]==:tics) \ + or (@@flag[:group]==:curls or @@flag[:group]==:tics) \ + or (@@flag[:block]==:curls or @@flag[:block]==:tics) \ + or (@@flag[:alt]==:curls or @@flag[:alt]==:tics) + if (@@flag[:poem]==:curls and t_o =~/^\}poem/) \ + or (@@flag[:poem]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + @@flag[:poem]=:off h={ obj: 'poem end' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) - elsif ( @@flag['group'] \ - and t_o =~/^\}group/ ) - @@flag['group']=false + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) + elsif (@@flag[:group]==:curls and t_o =~/^\}group/) \ + or (@@flag[:group]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + @@flag[:group]=:off obj,tags=extract_tags(@tuned_block.join("\n")) h={ obj: obj, tags: tags } @tuned_block=[] t_o=SiSU_DAL_DocumentStructure::ObjectBlockTxt.new.group(h) tuned_file << t_o h={ obj: 'group text end' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) - elsif ( @@flag['block'] \ - and t_o =~/^\}block/ ) - @@flag['block']=false + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) + elsif (@@flag[:block]==:curls and t_o =~/^\}block/) \ + or (@@flag[:block]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + @@flag[:block]=:off obj,tags=extract_tags(@tuned_block.join("\n")) h={ obj: obj, tags: tags } @tuned_block=[] t_o=SiSU_DAL_DocumentStructure::ObjectBlockTxt.new.block(h) tuned_file << t_o h={ obj: 'block text end' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) - elsif ( @@flag['alt'] \ - and t_o =~/^\}alt/ ) - @@flag['alt']=false + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) + elsif (@@flag[:alt]==:curls and t_o =~/^\}alt/) \ + or (@@flag[:alt]==:tics and t_o =~/^```(?:\s*[~-][#])?\s*$/) + @@flag[:alt]=:off obj,tags=extract_tags(@tuned_block.join("\n")) h={ obj: obj, tags: tags } t_o=SiSU_DAL_DocumentStructure::ObjectBlockTxt.new.alt(h) @tuned_block=[] tuned_file << t_o h={ obj: 'alt text end' } #introduce a counter - t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h) + t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) end - if @@flag['poem'] \ - or @@flag['group'] \ - or @@flag['alt'] \ + if (@@flag[:poem]==:curls or @@flag[:poem]==:tics \ + or @@flag[:group]==:curls or @@flag[:group]==:tics \ + or @@flag[:alt]==:curls or @@flag[:alt]==:tics) \ and t_o =~/\S/ \ - and t_o !~/^(?:\}(?:verse|code|alt|group|block)|(?:verse|code|alt|group|block)\{)/ # fix logic + and t_o !~/^(?:\}(?:verse|code|alt|group|block)|(?:verse|code|alt|group|block)\{)/ \ + and t_o !~/^```\s+(?:code|poem|alt|group|block)|^```(?:\s*[~-][#])?\s*$/ # fix logic sub_array=t_o.dup @line_mode=sub_array.scan(/.+/) - type=if @@flag['poem'] + type=if @@flag[:poem]==:curls or @@flag[:poem]==:tics t_o=SiSU_DAL_DocumentStructureExtract::Build.new(@md,@line_mode).build_lines(type).join poem=t_o.split(/\n\n/) poem.each do |v| @@ -528,16 +584,16 @@ module SiSU_DAL_DocumentStructureExtract t_o=SiSU_DAL_DocumentStructure::ObjectBlockTxt.new.verse(h) tuned_file << t_o end - 'poem' - else 'group' + :poem + else :group end end - @verse_count+=1 if @@flag['poem'] + @verse_count+=1 if @@flag[:poem]==:curls or @@flag[:poem]==:tics end - if not @@flag['code'] - if @@flag['poem'] \ - or @@flag['group'] \ - or @@flag['alt'] + if @@flag[:code]==:off + if @@flag[:poem]==:curls or @@flag[:poem]==:tics \ + or @@flag[:group]==:curls or @@flag[:group]==:tics \ + or @@flag[:alt]==:curls or @@flag[:alt]==:tics if t_o.is_a?(String) t_o=t_o.gsub(/\n/m,"#{Mx[:br_nl]}"). gsub(/[ ][ ]/m,"#{Mx[:nbsp]*2}"). @@ -598,16 +654,17 @@ module SiSU_DAL_DocumentStructureExtract h={ obj: str, ocn_: false } SiSU_DAL_DocumentStructure::ObjectPara.new.paragraph(h) end - def build_lines(type='') + def build_lines(type=:none) lines,lines_new=@data,[] lines.each do |line| line=if line =~/\S/ \ - and line !~/^code\{|^\}code/ \ - and not line.is_a?(Hash) - @@counter+=1 if @@flag['code'] + and line !~/^(?:code\{|\}code)/ \ + and line !~/^(?:```\s+code|```(?:\s*[~-][#])?\s*$)/ \ + and not line.is_a?(Hash) #watch + @@counter+=1 if @@flag[:code]==:curls or @@flag[:code]==:tics line=line.gsub(/\s\s/,"#{Mx[:nbsp]*2}"). gsub(/#{Mx[:nbsp]}\s/,"#{Mx[:nbsp]*2}") - line=line.gsub(/^/,"#{Mx[:gr_o]}codeline#{Mx[:gr_c]}") if type=='code' # REMOVE try sort for texpdf special case + line=line.gsub(/^/,"#{Mx[:gr_o]}codeline#{Mx[:gr_c]}") if type==:code # REMOVE try sort for texpdf special case line=if line =~/(?:https?|file|ftp):\/\/\S+$/ line.gsub(/\s*$/," #{Mx[:br_nl]}") else line.gsub(/\s*$/,"#{Mx[:br_nl]}") #unless type=='code' @@ -630,7 +687,7 @@ module SiSU_DAL_DocumentStructureExtract @dob end def structure_markup #build structure where structure provided only in meta header - @dob=if @dob.is ==:para \ + @dob=if @dob.is==:para \ && (((@dob.hang !~/[1-9]/) && (@dob.indent !~/[1-9]/)) \ || (@dob.hang != @dob.indent)) \ and not @dob.bullet_ @@ -672,7 +729,7 @@ module SiSU_DAL_DocumentStructureExtract parent=node1=node2=node3=node4=node5=node6=nil data.each do |dob| h={} - if (dob.obj !~ regex_exclude_ocn_and_node || dob.is ==:code) \ + if (dob.obj !~ regex_exclude_ocn_and_node || dob.is==:code) \ && (dob.of !=:comment \ && dob.of !=:layout \ && dob.of !=:meta) \ @@ -825,8 +882,8 @@ module SiSU_DAL_DocumentStructureExtract puts "<#{@s[0]}>" end data.each_with_index do |o,i| - if o.is ==:heading \ - || o.is ==:heading_insert + if o.is==:heading \ + || o.is==:heading_insert case o.ln when 1 tuned_file << tag_close(o.ln,hs) diff --git a/lib/sisu/v5/dal_expand_insertions.rb b/lib/sisu/v5/dal_expand_insertions.rb index ca234624..eb4f8363 100644 --- a/lib/sisu/v5/dal_expand_insertions.rb +++ b/lib/sisu/v5/dal_expand_insertions.rb @@ -332,9 +332,9 @@ module SiSU_DAL_Insertions tuned_file,tuned_file_tmp=[],[] codeblock_=false data.each do |para| - codeblock_=if para =~/^code\{/ + codeblock_=if para =~/^(?:code\{|```\s+code)/ true - elsif para =~/^\}code/ + elsif para =~/^(?:\}code|```)/m false else codeblock_ end diff --git a/lib/sisu/v5/dal_misc_arrange.rb b/lib/sisu/v5/dal_misc_arrange.rb new file mode 100644 index 00000000..c1751360 --- /dev/null +++ b/lib/sisu/v5/dal_misc_arrange.rb @@ -0,0 +1,155 @@ +# encoding: utf-8 +=begin + + * 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, 2010, 2011, 2012, 2013 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: + + + * Git + + + + * Ralph Amissah + + + + ** Description: system environment, resource control and configuration details + +=end +module SiSU_DAL_MiscArrangeText + class SI + def initialize(md,data) + @md,@data=md,data + end + def conditional_headings(para) + para=para.gsub(/^(:?A~)\s*$/,'\1~ @title @author'). #conditional header + gsub(/^((?:[1-9]|:?[A-C])~\S*)\s*$/,'\1~ [Note: heading marker::required title missing]~#') #conditional header for incorporated document 2004w12 + if para =~/^@\S+?:/ + para=para.gsub(/^@(\S+?):(\s+|$)/,"#{Mx[:meta_o]}\\1#{Mx[:meta_c]}\\2"). + gsub(/^@(\S+?):([+-])(\s+|$)/,"#{Mx[:meta_o]}\\1\\2#{Mx[:meta_c]}\\3") + end + para + end + def code_blocks(para) + def ticks(para) + block_open,block_close,text=nil,nil,nil + if para =~/\A(``` .+?)\n(.+?)\n(```(?: [~-][#])?)\s*\Z/m + block_open,text,block_close=/\A(``` .+?)\n(.+?)\n(```(?: [~-][#])?)\s*\Z/m.match(para)[1..3] + para=[] + para << block_open << text << block_close + elsif para =~/\A(``` .+?)\n(.*?)\Z/m #look at, study + block_open,text=/\A(```(?: .+?))\n(.*?)\Z/m.match(para)[1,2] + para=[] + if not text.to_s.empty? + para << block_open << text + else + para << block_open + end + elsif para =~/\A(.+?)\n(```(?:\s*[~-][#])?)\s*\Z/m + text,block_close=/\A(.+?)\n(```(?: [~-][#])?)\s*\Z/m.match(para)[1,2] + para=[] + if not text.to_s.empty? + para << text.to_s << block_close + else + para << block_close + end + else para + end + para + end + def curly_braces(para) + block_open,block_close,text=nil,nil,nil + para=if para =~/\A(?:code|poem|alt|group|block|table)\{ .+?\n.+?\n\}(?:code|poem|alt|group|block|table)(?: [~-][#])?\s*\Z/m + block_open,text,block_close=/\A((?:code|poem|alt|group|block|table)\{ .+?)\n(.+?)\n(\}(?:code|poem|alt|group|block|table)(?: [~-][#])?)\s*\Z/m.match(para)[1..3] + para=[] + para << block_open << text << block_close + elsif para =~/\A(?:code|poem|alt|group|block|table)\{ .+?\n.+?\Z/m + block_open,text=/\A((?:code|poem|alt|group|block|table)\{ .+?)\n(.+?)\Z/m.match(para)[1,2] + para=[] + if not text.to_s.empty? + para << block_open << text + else + para << block_open + end + elsif para =~/\A.+?\n\}(?:code|poem|alt|group|block|table)(?: [~-][#])?\s*\Z/m + text,block_close=/\A(.+?)\n(\}(?:code|poem|alt|group|block|table)(?: [~-][#])?)\s*\Z/m.match(para)[1,2] + para=[] + if not text.to_s.empty? + para << text.to_s << block_close + else + para << block_close + end + else para + end + para + end + para=para =~/^```/m \ + ? ticks(para) + : para + para=(para =~/^(?:code|poem|alt|group|block|table)\{|^\}(?:code|poem|alt|group|block|table)/m) \ + ? curly_braces(para) + : para + end + def prepare_text + data=@data + data_new=[],[] + if data[0] =~ /^#!\s*(?:\/usr\/bin\/env sisu|\/usr\/bin\/sisu)/ # remove bang from top #! (however file is stripped, so will be removed provided no content precedes it) + data[0]=data[0].gsub(/^#!\s*\/usr\/bin\/sisu/,''). + gsub(/^#!\s*\/usr\/bin\/env sisu/,'') + end + if data[0] =~ /^(SiSU\s+[\d.]*|sisu-[\d.]+)$/ # SiSU identifier + data[0]=data[0].gsub(/^(SiSU\s*[\d.]*)$/,'% \1'). + gsub(/^(sisu-[\d.]+)$/,'% \1') + end + data.each do |para| + para=conditional_headings(para) + data_new << code_blocks(para) + end + data_new=data_new.flatten + end + end +end +__END__ diff --git a/lib/sisu/v5/dal_substitutions_and_insertions.rb b/lib/sisu/v5/dal_substitutions_and_insertions.rb deleted file mode 100644 index eeabc1a5..00000000 --- a/lib/sisu/v5/dal_substitutions_and_insertions.rb +++ /dev/null @@ -1,145 +0,0 @@ -# encoding: utf-8 -=begin - - * 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, 2010, 2011, 2012, 2013 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: - - - * Git - - - - * Ralph Amissah - - - - ** Description: system environment, resource control and configuration details - -=end -module SiSU_DAL_SubstituteAndInsert - class SI - def initialize(md,data) - @md,@data=md,data - end - def substitutions_and_insertions? - data=@data - data_expand=[] - if data[0] =~ /^#!\s*(?:\/usr\/bin\/env sisu|\/usr\/bin\/sisu)/ # remove bang from top #! (however file is stripped, so will be removed provided no content precedes it) - data[0]=data[0].gsub(/^#!\s*\/usr\/bin\/sisu/,''). - gsub(/^#!\s*\/usr\/bin\/env sisu/,'') - end - if data[0] =~ /^(SiSU\s+[\d.]*|sisu-[\d.]+)$/ # SiSU identifier - data[0]=data[0].gsub(/^(SiSU\s*[\d.]*)$/,'% \1'). - gsub(/^(sisu-[\d.]+)$/,'% \1') - end - data.each do |para| - if para =~/<:(insert\d+)!?>/ \ - and para !~/^%\s+/ - ins=SiSU_Viz::Inserts.new - case para - when /^\s*<:(insert1)>\s*$/ - i=$1 - if defined? ins.insert1 - para=[] - ins.insert1.split(/\n\n/).each {|x| para << x } - end - when /^\s*<:(insert2)>\s*$/ - i=$1 - if defined? ins.insert2 - para=[] - ins.insert2.split(/\n\n/).each {|x| para << x } - end - when /^\s*<:(insert3)>\s*$/ - i=$1 - if defined? ins.insert3 - para=[] - ins.insert3.split(/\n\n/).each {|x| para << x << "\n"} - end - when /^\s*<:(insert4)>\s*$/ - i=$1 - if defined? ins.insert4 - para=[] - ins.insert4.split(/\n\n/).each {|x| para << x << "\n"} - end - when /^\s*<:(insert5)>\s*$/ - i=$1 - if defined? ins.insert5 - para=[] - ins.insert5.split(/\n\n/).each {|x| para << x << "\n"} - end - when /^\s*<:(insert6)>\s*$/ - i=$1 - if defined? ins.insert6 - para=[] - ins.insert6.split(/\n\n/).each {|x| para << x << "\n"} - end - when /^\s*<:(insert7)>\s*$/ - i=$1 - if defined? ins.insert7 - para=[] - ins.insert7.split(/\n\n/).each {|x| para << x << "\n"} - end - end - para.each {|x| data_expand << x } - else data_expand << para - end - data_expand=data_expand.flatten.compact - end - data_new=[] - data_expand.each do |para| - para=para.gsub(/^(:?A~)\s*$/,'\1~ @title @author'). #conditional header - gsub(/^((?:[1-9]|:?[A-C])~\S*)\s*$/,'\1~ [Note: heading marker::required title missing]~#') #conditional header for incorporated document 2004w12 - if para =~/^@\S+?:/ - para=para.gsub(/^@(\S+?):(\s+|$)/,"#{Mx[:meta_o]}\\1#{Mx[:meta_c]}\\2"). - gsub(/^@(\S+?):([+-])(\s+|$)/,"#{Mx[:meta_o]}\\1\\2#{Mx[:meta_c]}\\3") - end - data_new << para - end - data_new - end - end -end -__END__ -- cgit v1.2.3