From 350efc6d6b35b6e06130cf806f5c9d07897636d8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 30 Mar 2011 23:05:09 -0400 Subject: v2: param, nested regex match fix (backport from v3) --- lib/sisu/v2/param.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb index 655177a7..c500c282 100644 --- a/lib/sisu/v2/param.rb +++ b/lib/sisu/v2/param.rb @@ -908,7 +908,7 @@ module SiSU_Param skip unless fns_array # consider @markup_version=SiSU_Markup_type::Markup_identify.new(fns_array,@opt).markup_version? #% determine markup version if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?[\d.]*|sisu-[\d.]+)$/ #check markup and markup version - if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)(?:[0-9]+)?(?:\.[0-9]+)?(?:\.[0-9]+)?$/ #check markup and markup version + if fns_array[0] =~ /^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)(?:(?:[0-9]+?)(?:\.[0-9]+?)(?:\.[0-9]+))?$/ #check markup and markup version @markup_version_declared=fns_array[0].match(/^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)([\d.]+)$/)[1] sm_a,sm_b,sm_c=fns_array[0].match(/^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3] sm_c ||=0 -- cgit v1.2.3 From 9542185b9e59836211caecf9e34dc355619909d1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 30 Mar 2011 23:07:19 -0400 Subject: v2, v3: sysenv, remove repeated method --- lib/sisu/v2/sysenv.rb | 3 --- lib/sisu/v3/sysenv.rb | 3 --- 2 files changed, 6 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index ef6d86c7..72b1ffc7 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -2757,9 +2757,6 @@ WOK ? @rc['db']['postgresql']['port'] \ : (@defaults[:postgresql_port]) end - def dbi - "DBI:Pg:database=#{psql.db};port=#{psql.port}" - end def password ((defined? @rc['db']['postgresql']['password']) \ && @rc['db']['postgresql']['password']=~/\S+/) \ diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index d4d0f16d..7cc2a327 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -3647,9 +3647,6 @@ WOK ? @rc['db']['postgresql']['port'] \ : (@defaults[:postgresql_port]) end - def dbi - "DBI:Pg:database=#{psql.db};port=#{psql.port}" - end def password ((defined? @rc['db']['postgresql']['password']) \ && @rc['db']['postgresql']['password']=~/\S+/) \ -- cgit v1.2.3 From d5d39d4e70efefa8d0166dd75ab1a4649e071c93 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 30 Mar 2011 23:10:59 -0400 Subject: v2, v3: cgi, sample-search-form, string output (+ clean unused help text) * ruby1.9.2 transition related --- lib/sisu/v2/cgi.rb | 2 -- lib/sisu/v2/cgi_pgsql.rb | 2 +- lib/sisu/v2/cgi_sqlite.rb | 2 +- lib/sisu/v3/cgi.rb | 2 -- lib/sisu/v3/cgi_pgsql.rb | 2 +- lib/sisu/v3/cgi_sqlite.rb | 2 +- 6 files changed, 4 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/cgi.rb b/lib/sisu/v2/cgi.rb index a375282f..d9bbc9ed 100644 --- a/lib/sisu/v2/cgi.rb +++ b/lib/sisu/v2/cgi.rb @@ -71,8 +71,6 @@ module SiSU_CGI a=%{ For help on sisu search, type: sisu --help search - For help on setting up hyperestraier for sisu, type: - sisu --help hyperestraier } SiSU_Screen::Ansi.new(@opt.cmd,a).print_grey end diff --git a/lib/sisu/v2/cgi_pgsql.rb b/lib/sisu/v2/cgi_pgsql.rb index 7a948366..416a7d88 100644 --- a/lib/sisu/v2/cgi_pgsql.rb +++ b/lib/sisu/v2/cgi_pgsql.rb @@ -83,7 +83,7 @@ module SiSU_CGI_pgsql else put "WARNING: no postgresql database available, (have you created one?)" end serve.sort! - f1,f2,f3=[],[],[] + f1,f2,f3='','','' serve.each do |x| f1 << %{ \n} unless x =~/apache|sisu\/image/ #check end diff --git a/lib/sisu/v2/cgi_sqlite.rb b/lib/sisu/v2/cgi_sqlite.rb index 5c20b072..d7e131d3 100644 --- a/lib/sisu/v2/cgi_sqlite.rb +++ b/lib/sisu/v2/cgi_sqlite.rb @@ -78,7 +78,7 @@ module SiSU_CGI_sqlite end end serve.sort! - f1,f2,f3=[],[],[] + f1,f2,f3='','','' serve.each do |x| f1 << %{ \n} end diff --git a/lib/sisu/v3/cgi.rb b/lib/sisu/v3/cgi.rb index 7b01ae98..357a4332 100644 --- a/lib/sisu/v3/cgi.rb +++ b/lib/sisu/v3/cgi.rb @@ -71,8 +71,6 @@ module SiSU_CGI a=%{ For help on sisu search, type: sisu --help search - For help on setting up hyperestraier for sisu, type: - sisu --help hyperestraier } SiSU_Screen::Ansi.new(@opt.cmd,a).print_grey end diff --git a/lib/sisu/v3/cgi_pgsql.rb b/lib/sisu/v3/cgi_pgsql.rb index 5f23f22d..3821f402 100644 --- a/lib/sisu/v3/cgi_pgsql.rb +++ b/lib/sisu/v3/cgi_pgsql.rb @@ -83,7 +83,7 @@ module SiSU_CGI_pgsql else put "WARNING: no postgresql database available, (have you created one?)" end serve.sort! - f1,f2,f3=[],[],[] + f1,f2,f3='','','' serve.each do |x| f1 << %{ \n} unless x =~/apache|sisu\/image/ #check end diff --git a/lib/sisu/v3/cgi_sqlite.rb b/lib/sisu/v3/cgi_sqlite.rb index 8d2ff53d..7251c81a 100644 --- a/lib/sisu/v3/cgi_sqlite.rb +++ b/lib/sisu/v3/cgi_sqlite.rb @@ -78,7 +78,7 @@ module SiSU_CGI_sqlite end end serve.sort! - f1,f2,f3=[],[],[] + f1,f2,f3='','','' serve.each do |x| f1 << %{ \n} end -- cgit v1.2.3 From 709e80673697492baa637ef5da95ece803f78e2b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 30 Mar 2011 23:16:21 -0400 Subject: v2, v3: dal_images, image path setting * ruby1.9.2 transition related --- lib/sisu/v2/dal_images.rb | 5 +++-- lib/sisu/v3/dal_images.rb | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/dal_images.rb b/lib/sisu/v2/dal_images.rb index ed537f22..2f9eb79d 100644 --- a/lib/sisu/v2/dal_images.rb +++ b/lib/sisu/v2/dal_images.rb @@ -92,8 +92,9 @@ module SiSU_images dir=SiSU_Env::Info_env.new(@md.fns) path_image=[dir.path.image_source_local_tex,dir.path.image_source_remote_tex,dir.path.image_source_tex] image_path=nil - path_image.each do |image_path| - break if FileTest.exist?("#{image_path}/#{image}") + path_image.each do |img_pth| + image_path=img_pth + break if FileTest.exist?("#{img_pth}/#{image}") end if FileTest.exist?("#{image_path}/#{image}") if @rmgk diff --git a/lib/sisu/v3/dal_images.rb b/lib/sisu/v3/dal_images.rb index 0d541a13..8c7e9f94 100644 --- a/lib/sisu/v3/dal_images.rb +++ b/lib/sisu/v3/dal_images.rb @@ -92,8 +92,9 @@ module SiSU_images dir=SiSU_Env::Info_env.new(@md.fns) path_image=[dir.path.image_source_include_local,dir.path.image_source_include_remote,dir.path.image_source_include] image_path=nil - path_image.each do |image_path| - break if FileTest.exist?("#{image_path}/#{image}") + path_image.each do |img_pth| + image_path=img_pth + break if FileTest.exist?("#{img_pth}/#{image}") end if FileTest.exist?("#{image_path}/#{image}") if @rmgk -- cgit v1.2.3 From b06c1e8a0641448b170dcc8a73f5e00f204e1d23 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 30 Mar 2011 23:19:43 -0400 Subject: v2, v3: dal_doc_str, empty line not paragraph object * ruby1.9.2 transition related --- lib/sisu/v2/dal_doc_str.rb | 14 +++++++++----- lib/sisu/v3/dal_doc_str.rb | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb index 56bf205f..94f668a5 100644 --- a/lib/sisu/v2/dal_doc_str.rb +++ b/lib/sisu/v2/dal_doc_str.rb @@ -178,8 +178,10 @@ module SiSU_document_structure_extract image=image_test(obj) note=endnote_test?(obj) obj,tags=extract_tags(obj) - h={:bullet_=>bullet,:indent=>indent,:obj=>obj,:idx=>idx,:note_=>note,:image_=>image,:tags=>tags} - SiSU_document_structure::Object_para.new.paragraph(h) + unless obj=~/\A\s*\Z/m + h={:bullet_=>bullet,:indent=>indent,:obj=>obj,:idx=>idx,:note_=>note,:image_=>image,:tags=>tags} + SiSU_document_structure::Object_para.new.paragraph(h) + end else nil end when /^?\s*$/ @@ -193,8 +195,10 @@ module SiSU_document_structure_extract image=image_test(t_o) note=endnote_test?(t_o) obj,tags=extract_tags(t_o) - h={:bullet_=>false,:indent=>0,:obj=>obj,:idx=>idx,:note_=>note,:image_=>image,:tags=>tags} - SiSU_document_structure::Object_para.new.paragraph(h) + unless obj=~/\A\s*\Z/m + h={:bullet_=>false,:indent=>0,:obj=>obj,:idx=>idx,:note_=>note,:image_=>image,:tags=>tags} + SiSU_document_structure::Object_para.new.paragraph(h) + end end elsif not @@flag['code'] if t_o =~/^code\{/ @@ -786,7 +790,7 @@ module SiSU_document_structure_extract @o_array=[] node=ocn=ocn_dv=ocn_sp=ocnh=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnm=ocnu=ocnk=nm=0 # h heading, o other, t table, g group, i image node_count_flag=false - regex_exclude_ocn_and_node = /#{Rx[:meta]}|^@\S+?:\s|^4~endnotes|^#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}|^\^~ |<:e[:_]\d+?>|^<:\#|<:- |<[:!]!4|
|^<:\#|<:- |<[:!]!4|
\]]\s*$/ #[br:par] #[br:obj] @@ -193,8 +195,10 @@ module SiSU_document_structure_extract image=image_test(t_o) note=endnote_test?(t_o) obj,tags=extract_tags(t_o) - h={ bullet_: false, indent: 0, obj: obj, idx: idx, note_: note, image_: image, tags: tags } - SiSU_document_structure::Object_para.new.paragraph(h) + unless obj=~/\A\s*\Z/m + h={ bullet_: false, indent: 0, obj: obj, idx: idx, note_: note, image_: image, tags: tags } + SiSU_document_structure::Object_para.new.paragraph(h) + end end elsif not @@flag['code'] if t_o =~/^code\{/ @@ -803,7 +807,7 @@ module SiSU_document_structure_extract @o_array=[] node=ocn=ocn_dv=ocn_sp=ocnh=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnm=ocnu=ocnk=nm=0 # h heading, o other, t table, g group, i image node_count_flag=false - regex_exclude_ocn_and_node = /#{Rx[:meta]}|^@\S+?:\s|^4~endnotes|^#{Mx[:lv_o]}4:endnotes#{Mx[:lv_c]}|^\^~ |<:e[:_]\d+?>|^<:\#|<:- |<[:!]!4|
|^<:\#|<:- |<[:!]!4|
Date: Wed, 30 Mar 2011 23:22:06 -0400 Subject: v2, v3: dal_doc_str.rb, table structure issue * ruby1.9.2 transition related * double spaced empty line creates spurious newline --- lib/sisu/v2/dal_doc_str.rb | 4 +++- lib/sisu/v3/dal_doc_str.rb | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb index 94f668a5..6fd7eff2 100644 --- a/lib/sisu/v2/dal_doc_str.rb +++ b/lib/sisu/v2/dal_doc_str.rb @@ -310,7 +310,9 @@ module SiSU_document_structure_extract t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) t_o else - if t_o !~/^table\{/ and not t_o.nil? + if t_o !~/^table\{/ \ + and not t_o.nil? + t_o.gsub!(/^\n+/m,'') #check added for ruby 1.9.2 not needed in 1.8 series t_o.gsub!(/\n/m,"#{Mx[:tc_p]}") @rows += t_o + Mx[:tc_c] end diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb index 8da571e4..09635066 100644 --- a/lib/sisu/v3/dal_doc_str.rb +++ b/lib/sisu/v3/dal_doc_str.rb @@ -315,8 +315,10 @@ module SiSU_document_structure_extract t_o=SiSU_document_structure::Object_comment.new.comment(h) #t_o=SiSU_document_structure::Object_layout.new.insert(h) t_o else - if t_o !~/^table\{/ and not t_o.nil? - t_o.gsub!(/\n/m,"#{Mx[:tc_p]}") + if t_o !~/^table\{/ \ + and not t_o.nil? + t_o.gsub!(/^\n+/m,'') #check added for ruby 1.9.2 not needed in 1.8 series (tested in v2) + t_o.gsub!(/\n+/m,"#{Mx[:tc_p]}") @rows += t_o + Mx[:tc_c] end t_o=nil -- cgit v1.2.3