From 084d10a94dd5a62b09de69ad95971f579097f07e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 8 Dec 2007 01:45:13 +0000 Subject: changelog and version updated --- CHANGELOG | 12 +++- conf/sisu/version.yml | 6 +- data/doc/sisu/CHANGELOG | 16 ++++- .../sisu_manual/sisu_download.ssi | 24 +++---- .../conf/editor-syntax-etc/vim/ftplugin/sisu.vim | 2 +- lib/sisu/v0/cgi.rb | 9 ++- lib/sisu/v0/cgi_pgsql.rb | 11 +-- lib/sisu/v0/cgi_sqlite.rb | 6 +- lib/sisu/v0/dal_doc_str_tables.rb | 4 +- lib/sisu/v0/db_load_tuple.rb | 6 +- lib/sisu/v0/digests.rb | 2 +- lib/sisu/v0/html_promo.rb | 8 +-- lib/sisu/v0/param.rb | 2 +- lib/sisu/v0/plaintext.rb | 2 +- lib/sisu/v0/shared_xml.rb | 3 +- lib/sisu/v0/sst_to_s_xml_dom.rb | 4 +- lib/sisu/v0/sst_to_s_xml_node.rb | 8 +-- lib/sisu/v0/sst_to_s_xml_sax.rb | 4 +- lib/sisu/v0/texpdf_format.rb | 79 ++++++++++++---------- lib/sisu/v0/wikispeak.rb | 2 +- 20 files changed, 121 insertions(+), 89 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5c1e04a2..faa110b9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,12 +9,22 @@ Reverse Chronological: %% STABLE MANIFEST +%% sisu_0.62.4.orig.tar.gz (2007-12-04:49/2) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4.orig.tar.gz + sisu_0.62.4.orig.tar.gz + sisu_0.62.4-1.dsc + sisu_0.62.4-1.diff.gz + + * cgi_sqlite, variable name bugfix + + * gpl3 or later links to online source updated + %% sisu_0.62.3.orig.tar.gz (2007-11-27:48/2) http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.3.orig.tar.gz 46511173fc0e3d75982debc37206fa6e 1481806 sisu_0.62.3.orig.tar.gz 494386aa1e44ebd9ea4d2c7bcfd41ba3 606 sisu_0.62.3-1.dsc d7a5222e99c53c7bd561b1e322b8a490 145532 sisu_0.62.3-1.diff.gz - + * html
follows text, before footnotes (refine later) * rsync remote images partial fix diff --git a/conf/sisu/version.yml b/conf/sisu/version.yml index d41328d8..be73bfa4 100644 --- a/conf/sisu/version.yml +++ b/conf/sisu/version.yml @@ -1,5 +1,5 @@ --- -:version: 0.62.3 -:date_stamp: 2007w48/5 -:date: "2007-11-30" +:version: 0.62.4 +:date_stamp: 2007w49/6 +:date: "2007-12-08" :project: SiSU diff --git a/data/doc/sisu/CHANGELOG b/data/doc/sisu/CHANGELOG index 342ebb6b..faa110b9 100644 --- a/data/doc/sisu/CHANGELOG +++ b/data/doc/sisu/CHANGELOG @@ -9,12 +9,22 @@ Reverse Chronological: %% STABLE MANIFEST +%% sisu_0.62.4.orig.tar.gz (2007-12-04:49/2) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4.orig.tar.gz + sisu_0.62.4.orig.tar.gz + sisu_0.62.4-1.dsc + sisu_0.62.4-1.diff.gz + + * cgi_sqlite, variable name bugfix + + * gpl3 or later links to online source updated + %% sisu_0.62.3.orig.tar.gz (2007-11-27:48/2) http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.3.orig.tar.gz 46511173fc0e3d75982debc37206fa6e 1481806 sisu_0.62.3.orig.tar.gz 494386aa1e44ebd9ea4d2c7bcfd41ba3 606 sisu_0.62.3-1.dsc d7a5222e99c53c7bd561b1e322b8a490 145532 sisu_0.62.3-1.diff.gz - + * html
follows text, before footnotes (refine later) * rsync remote images partial fix @@ -34,8 +44,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.3.orig.tar.gz * debian/changelog (take more care with git reset) sisu_0.62.3-3 (2007-11-30:48/5) - sisu_0.62.3-3.dsc - sisu_0.62.3-3.diff.gz + 6eb4289cf9e1ca7ade96ccf22cc9188e 629 sisu_0.62.3-3.dsc + b71825bd5746149780cef709659fb7a3 146249 sisu_0.62.3-3.diff.gz * debian/control XS-Dm-Upload-Allowed: yes [dpkg does not yet recognize Dm-Upload-Allowed field unless prefixed by diff --git a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi index 65240f7f..d6a7b0bd 100644 --- a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi +++ b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi @@ -18,9 +18,9 @@ @date.available: 2007-08-28 -@date.modified: 2007-11-20 +@date.modified: 2007-12-05 -@date: 2007-11-20 +@date: 2007-12-05 @level: new=C; break=1; num_top=1 @@ -55,7 +55,7 @@ Download the latest version of SiSU (and SiSU markup samples):~{ Breakage and Fixes Report
http://www.jus.uio.no/sisu/SiSU/breakage_and_fixes.html }~ -_* {~^ sisu_0.62.3.orig.tar.gz (of 2007-11-26:48/1) }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.3.orig.tar.gz +_* {~^ sisu_0.62.4.orig.tar.gz (of 2007-12-05:49/3) }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4.orig.tar.gz _* {~^ sisu-markup-samples_1.0.8.orig.tar.gz (of 2007-08-19:33/7 ) }http://www.jus.uio.no/sisu/pkg/src/sisu-markup-samples_1.0.8.orig.tar.gz *~sisu-markup-samples @@ -90,23 +90,23 @@ deb-src http://www.jus.uio.no/sisu/archive unstable main non-free !_ Source -_* {~^ sisu_0.62.3.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.3.orig.tar.gz +_* {~^ sisu_0.62.4.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4.orig.tar.gz -_* {~^ sisu_0.62.3-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.3-1.diff.gz +_* {~^ sisu_0.62.4-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4-1.diff.gz -_* {~^ sisu_0.62.3-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.3-1.dsc +_* {~^ sisu_0.62.4-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4-1.dsc !_ Debs -_* {~^ sisu_0.62.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_0.62.3-1_all.deb ~{
sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies
Depends: ruby (>=1.8.2), libwebrick-ruby
Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~ +_* {~^ sisu_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_0.62.4-1_all.deb ~{
sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies
Depends: ruby (>=1.8.2), libwebrick-ruby
Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~ -_* {~^ sisu-complete_0.62.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_0.62.3-1_all.deb ~{
a package that pulls in other packages to build the whole of sisu (excluding sisu-examples)
Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu
Recommends: sisu-examples }~ +_* {~^ sisu-complete_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_0.62.4-1_all.deb ~{
a package that pulls in other packages to build the whole of sisu (excluding sisu-examples)
Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu
Recommends: sisu-examples }~ -_* {~^ sisu-pdf_0.62.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_0.62.3-1_all.deb ~{
dependencies used by sisu to produce pdf from LaTeX generated
Depends: sisu, tetex-bin, tetex-extra, latex-ucs
Suggests: evince, xpdf }~ +_* {~^ sisu-pdf_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_0.62.4-1_all.deb ~{
dependencies used by sisu to produce pdf from LaTeX generated
Depends: sisu, tetex-bin, tetex-extra, latex-ucs
Suggests: evince, xpdf }~ -_* {~^ sisu-postgresql_0.62.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_0.62.3-1_all.deb ~{
dependencies used by sisu to populate postgresql database (further configuration is necessary)
Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby
Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~ +_* {~^ sisu-postgresql_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_0.62.4-1_all.deb ~{
dependencies used by sisu to populate postgresql database (further configuration is necessary)
Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby
Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~ -_* {~^ sisu-sqlite_0.62.3-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_0.62.3-1_all.deb ~{
dependencies used by sisu to populate sqlite database
Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
Suggests: libdbd-sqlite }~ +_* {~^ sisu-sqlite_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_0.62.4-1_all.deb ~{
dependencies used by sisu to populate sqlite database
Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
Suggests: libdbd-sqlite }~ For changelogs see: @@ -132,7 +132,7 @@ _1 http://www.jus.uio.no/sisu/sisu_markup_samples_changelog/changelog_markup_sam The RPM is generated Alien~{ http://www.kitenet.net/programs/alien/ }~ from two deb packages (sisu and sisu-doc). Dependencies are not handled, not even that of the essential Ruby. -_* {~^ sisu-0.62.3-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-0.62.3-2.noarch.rpm ~{ untested, created using: alien -r sisu_0.62.3-1_all.deb }~ +_* {~^ sisu-0.62.4-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-0.62.4-2.noarch.rpm ~{ untested, created using: alien -r sisu_0.62.4-1_all.deb }~ _* {~^ sisu-markup-samples_1.0.8.orig-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-markup-samples_1.0.6.orig-2.noarch.rpm ~{
untested, created using alien }~ diff --git a/data/sisu/conf/editor-syntax-etc/vim/ftplugin/sisu.vim b/data/sisu/conf/editor-syntax-etc/vim/ftplugin/sisu.vim index bbb98bf3..269530de 100644 --- a/data/sisu/conf/editor-syntax-etc/vim/ftplugin/sisu.vim +++ b/data/sisu/conf/editor-syntax-etc/vim/ftplugin/sisu.vim @@ -77,7 +77,7 @@ "% colorscheme slate :map :syntax on :colorscheme slate "% search and replace -:map :.,$s///c "search and replace down +:map :.,$s///c "search and replace down :map :%s///c "search and replace whole file :map :rubyd gsub!(//,"") "% pwd t64 working directory set to that of the file you're editing diff --git a/lib/sisu/v0/cgi.rb b/lib/sisu/v0/cgi.rb index e17374b0..9ade56bd 100644 --- a/lib/sisu/v0/cgi.rb +++ b/lib/sisu/v0/cgi.rb @@ -31,9 +31,12 @@ If you have Internet connection, the latest version of the GPL should be available at these locations: - + - + + + + * SiSU uses: * Standard SiSU markup syntax, @@ -63,7 +66,7 @@ module SiSU_CGI class SiSU_search def initialize(opt) @opt=opt - @webserv=@opt.files[0].to_s.strip + @webserv=@opt.files[0].to_s.strip #verify @opt.files[0].class end def search_info a=%{ diff --git a/lib/sisu/v0/cgi_pgsql.rb b/lib/sisu/v0/cgi_pgsql.rb index 9a6486ff..173f46db 100644 --- a/lib/sisu/v0/cgi_pgsql.rb +++ b/lib/sisu/v0/cgi_pgsql.rb @@ -31,9 +31,12 @@ If you have Internet connection, the latest version of the GPL should be available at these locations: - + - + + + + * SiSU uses: * Standard SiSU markup syntax, @@ -173,10 +176,10 @@ module SiSU_CGI_pgsql @search_text,@search_endnotes=[],[] #% search[:text].each{|x| @search_text << "#{x} AND " } - @search_text=@search_text.to_s.gsub!(/AND\s+$/,'') + @search_text=@search_text.join.gsub!(/AND\s+$/,'') #watch @search_text.gsub!(/(documents\.clean~[*]?\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean~[*]?\(\s*'[^']+'\s*\))+)/,'(\1)') search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } - @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'') + @search_endnotes=@search_endnotes.join.gsub!(/AND\s+$/,'') #watch @search_endnotes.gsub!(/(endnotes\.clean~\(\s*'[^']+'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean~\(\s*'[^']+'\s*\))+)/,'(\1)') end WOK_SQL diff --git a/lib/sisu/v0/cgi_sqlite.rb b/lib/sisu/v0/cgi_sqlite.rb index e54c8570..eb249b2d 100644 --- a/lib/sisu/v0/cgi_sqlite.rb +++ b/lib/sisu/v0/cgi_sqlite.rb @@ -167,10 +167,10 @@ module SiSU_CGI_sqlite @search_text,@search_endnotes=[],[] #% search[:text].each{|x| @search_text << "#{x} AND " } - @search_text=@search_text.to_s.gsub!(/AND\s+$/,'') + @search_text=@search_text.join.gsub!(/AND\s+$/,'') @search_text.gsub!(/(documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+documents\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') search[:endnotes].each{|x| @search_endnotes << "#{x} AND " } - @search_endnotes=@search_endnotes.to_s.gsub!(/AND\s+$/,'') + @search_endnotes=@search_endnotes.join.gsub!(/AND\s+$/,'') @search_text.gsub!(/(endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\)\s+(?:(?:AND|OR)\s+endnotes\.clean\s+LIKE\s+\(\s*'%[^']+%'\s*\))+)/,'(\1)') end WOK_SQL @@ -210,7 +210,7 @@ module SiSU_CGI_sqlite end def dbi_connect <<-'WOK_SQL' - @dbi="DBI:SQLite:#{sqlite.db}" #sqlite3 ? + @dbi="DBI:SQLite:#{db_sqlite}" #sqlite3 ? @conn=DBI.connect(@dbi) WOK_SQL end diff --git a/lib/sisu/v0/dal_doc_str_tables.rb b/lib/sisu/v0/dal_doc_str_tables.rb index 280a280a..d1ba776a 100644 --- a/lib/sisu/v0/dal_doc_str_tables.rb +++ b/lib/sisu/v0/dal_doc_str_tables.rb @@ -83,8 +83,8 @@ module SiSU_document_structure_tables @row[count]=row.split(/\|/) end @row.compact! - widths=if @row[0].to_s =~/^\{(?:t|table)(?:~h)?\s+\d+;/ - col_width=@row[0].to_s.scan(/\d+/) + widths=if @row[0].join =~/^\{(?:t|table)(?:~h)?\s+\d+;/ + col_width=@row[0].join.scan(/\d+/) rem=(100 - col_width[0].to_i) col_w=rem/(@row[1].length - 1) "#{col_width[0].to_s};" + ("#{col_w};" * (@row[1].length-1)) diff --git a/lib/sisu/v0/db_load_tuple.rb b/lib/sisu/v0/db_load_tuple.rb index e324fd1b..d85346cc 100644 --- a/lib/sisu/v0/db_load_tuple.rb +++ b/lib/sisu/v0/db_load_tuple.rb @@ -89,8 +89,8 @@ module SiSU_DB_tuple }) end if @opt.cmd =~/v/ - if @col[:lev].to_s =~/[1235678]/ - lev=case @col[:lev].to_s + if @col[:lev].inspect =~/[1235678]/ + lev=case @col[:lev].inspect when /1/; ':A' when /2/; ':B' when /3/; ':C' @@ -98,7 +98,7 @@ module SiSU_DB_tuple when /6/; ' 3' end puts %{#{lev}>\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:ocnd]}\t#{@col[:ocns]}} - elsif @col[:lev].to_s =~/[4]/ + elsif @col[:lev].inspect =~/[4]/ puts %{ #{@cX.green}1>#{@cX.off}\t#{@col[:lv1]}\t#{@col[:lv2]}\t#{@col[:lv3]}\t#{@col[:lv4]}\t#{@col[:lv5]}\t#{@col[:lv6]}\t#{@col[:ocn]}\t#{@col[:ocnd]}\t#{@col[:ocns]}\t#{@col[:seg]}} end end diff --git a/lib/sisu/v0/digests.rb b/lib/sisu/v0/digests.rb index e603f0c9..1d49bb1d 100644 --- a/lib/sisu/v0/digests.rb +++ b/lib/sisu/v0/digests.rb @@ -139,7 +139,7 @@ module SiSU_Digest_view end def output filename_digest=SiSU_Env::SiSU_file.new(@md,@md.fn[:digest]).mkfile - filename_digest << @@description << @@ds[:digests] << @@ds[:tree] << @@ds[:summary] << @@sc_info + filename_digest << @@description.join << @@ds[:digests].join << @@ds[:tree].join << @@ds[:summary].join << @@sc_info.join end def rgx_txt(txt) txt=txt.gsub(/([()])/,"\\\\\\1") diff --git a/lib/sisu/v0/html_promo.rb b/lib/sisu/v0/html_promo.rb index 75a8e46b..43040c25 100644 --- a/lib/sisu/v0/html_promo.rb +++ b/lib/sisu/v0/html_promo.rb @@ -101,7 +101,7 @@ module SiSU_HTML_promo end ads_array end - adverts(ads) + adverts(ads.join) #else no_adverts end end @@ -192,7 +192,7 @@ module SiSU_HTML_promo links_a << %{\n} end end - links_a.to_s + links_a.join else '' end end @@ -382,7 +382,7 @@ WOK @ad[:promo_list][category].keys.each do |type| @ad[:promo_list][category][type].each do |i| if i - id=i.to_s =~/^\d/ ? "id_#{i.to_s.strip}" : i.to_s.strip + id=i.inspect =~/^\d/ ? "id_#{i.to_s.strip}" : i.to_s.strip #watch remove .to_s ? gbp=usd=euro=nil if defined? @ad[:promo][type][id] \ and not @ad[:promo][type][id].nil? @@ -395,7 +395,7 @@ WOK tell=SiSU_Screen::Ansi.new(@md.cmd,"category not found: #{category}") tell.warn unless @md.cmd =~/q/ end - adverts.to_s + adverts.join end def advert_extract_all #extracts all products from list (which is broken down into categories) adverts=[] diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb index 1fea8729..92fbf26f 100644 --- a/lib/sisu/v0/param.rb +++ b/lib/sisu/v0/param.rb @@ -828,7 +828,7 @@ module SiSU_Param @lv2=/^(?:Part|PART)\b/ end if doc_struct[:part] > 2 \ - and @lv[2].to_s !~/Part/ \ + and @lv[2].inspect !~/Part/ \ and @lv[1].nil? @lv1=/^(Part|PART)\b/ end diff --git a/lib/sisu/v0/plaintext.rb b/lib/sisu/v0/plaintext.rb index 3af2f8c3..43e8553c 100644 --- a/lib/sisu/v0/plaintext.rb +++ b/lib/sisu/v0/plaintext.rb @@ -199,7 +199,7 @@ module SiSU_Plaintext def extract_endnotes(para='') notes=para.scan(/~[{\[]([\d*+]+\s+.+?)\s*<#@dp>[}\]]~/) @n=[] - notes.each do |n| #high cost to deal with
appropriately within plaintext, consider + notes.flatten.each do |n| #high cost to deal with
appropriately within plaintext, consider n=n.dup.to_s if n =~// fix = n.split(//) #watch #added diff --git a/lib/sisu/v0/shared_xml.rb b/lib/sisu/v0/shared_xml.rb index 4492dbe7..25f0d4d4 100644 --- a/lib/sisu/v0/shared_xml.rb +++ b/lib/sisu/v0/shared_xml.rb @@ -441,7 +441,8 @@ module SiSU_XML_tags #Format @rdfurl=%{ rdf:about="http://www.jus.uio.no/lm/toc"\n} if @md.dc_title # DublinCore 1 - title @rdf_title=%{ dc.title="#{seg_name}#{@md.dc_title}"\n} - @dc_title=%{ \n} + @dc_title=%{ \n} + #@dc_title=%{ \n} end if @md.dc_creator # DublinCore 2 - creator/author (author) @rdf_creator=%{ dc.creator="#{@md.dc_creator}"\n} diff --git a/lib/sisu/v0/sst_to_s_xml_dom.rb b/lib/sisu/v0/sst_to_s_xml_dom.rb index 589051a5..9aefe901 100644 --- a/lib/sisu/v0/sst_to_s_xml_dom.rb +++ b/lib/sisu/v0/sst_to_s_xml_dom.rb @@ -535,7 +535,7 @@ WOK content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata] content << @@xml[:owner_details] if @md.stmp =~/\w\w/ content << @@xml[:tail] << @@xml[:close] - Output.new(content.to_s,@md).xml + Output.new(content.join,@md).xml @@xml={} end end @@ -559,7 +559,7 @@ WOK para="#{para}\n" unless para.empty? @sisu << para end - new_file_data=@sisu.to_s + new_file_data=@sisu.join @sisu=new_file_data.scan(/.+/) SiSU_Env::SiSU_file.new(@md).mkdir filename_sxm=SiSU_Env::SiSU_file.new(@md,@md.fn[:sxd]).mkfile_pwd diff --git a/lib/sisu/v0/sst_to_s_xml_node.rb b/lib/sisu/v0/sst_to_s_xml_node.rb index d0252e44..4f4168f6 100644 --- a/lib/sisu/v0/sst_to_s_xml_node.rb +++ b/lib/sisu/v0/sst_to_s_xml_node.rb @@ -225,11 +225,11 @@ WOK self end def build_relationships(o='',lv='') - if lv.to_s =~/[0-6]/ + if lv.inspect =~/[0-6]/ @node[:ocn][lv]=o.ocn @node[:no][lv]=o.node end - if lv.to_s =~/^[1-6]/; @@current=lv + if lv.inspect =~/^[1-6]/; @@current=lv end if o.node == 1 \ or lv == 1 @@ -579,7 +579,7 @@ WOK content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata] content << @@xml[:owner_details] if @md.stmp =~/\w\w/ content << @@xml[:tail] << @@xml[:close] - Output.new(content.to_s,@md).xml + Output.new(content.join,@md).xml @@xml={} end end @@ -597,7 +597,7 @@ WOK para="#{para}\n" unless para.empty? @sisu << para end - new_file_data=@sisu.to_s + new_file_data=@sisu.join @sisu=new_file_data.scan(/.+/) SiSU_Env::SiSU_file.new(@md).mkdir filename_sxm=SiSU_Env::SiSU_file.new(@md,@md.fn[:sxn]).mkfile_pwd diff --git a/lib/sisu/v0/sst_to_s_xml_sax.rb b/lib/sisu/v0/sst_to_s_xml_sax.rb index c5e68f34..8da3c9cf 100644 --- a/lib/sisu/v0/sst_to_s_xml_sax.rb +++ b/lib/sisu/v0/sst_to_s_xml_sax.rb @@ -396,7 +396,7 @@ WOK content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata] content << @@xml[:owner_details] if @md.stmp =~/\w\w/ content << @@xml[:tail] << @@xml[:close] - Output.new(content.to_s,@md).xml + Output.new(content.join,@md).xml @@xml={} end end @@ -414,7 +414,7 @@ WOK para="#{para}\n" unless para.empty? @sisu << para end - new_file_data=@sisu.to_s + new_file_data=@sisu.join @sisu=new_file_data.scan(/.+/) SiSU_Env::SiSU_file.new(@md).mkdir filename_sxm=SiSU_Env::SiSU_file.new(@md,@md.fn[:sxs]).mkfile_pwd diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb index e1e3a583..7d0f3967 100644 --- a/lib/sisu/v0/texpdf_format.rb +++ b/lib/sisu/v0/texpdf_format.rb @@ -803,23 +803,26 @@ WOK # clean up ! - work area, testing dir=SiSU_Env::Info_env.new(@md.fns) @words=[] + @url_generic_rgx=/\\\{.+?\\?\}(?:https?|file|ftp):\S+/ @string.each do |word| - @words << if word=~/\\\{.+?\\\}(?:https?|file|ftp):\S+/ - if word =~/\\\{(.+?)\\\}((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/ - r=%r/\\\{(.+?)\\?\}((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)(?:[;.,]?(?:\s|$)|(?:\s|$))/ - d=/\\\{.+?\\?\}(?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?([;.,]?(?:\s|$))/.match(word).captures.to_s + @words << if word=~@url_generic_rgx + if word =~/\\\{(?:.+?)\\?\}(?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?(?:[;.,]?(?:\s|$)|(?:\s|$))/ + regx_url=%r/\\\{(.+?)\\?\}((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)(?:[;.,]?(?:\s|$)|(?:\s|$))/ + punctuate=/\\\{.+?\\?\}(?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?([;.,]?(?:\s|$))/.match(word).captures.join else - r=%r/\\\{(.+?)\\?\}((?:https?|file|ftp):\S+)/ - d='' + regx_url=%r/\\\{(.+?)\\?\}((?:https?|file|ftp):\S+)/ + punctuate='' end - z,url=r.match(word).captures if word =~r + z,url=regx_url.match(word).captures if word =~regx_url url=url.strip if word =~/\{\s*\S+\.?(?:png|jpg|gif)/ \ and word=~/\s+\d+x\d+\s+/ image,x,y=z.scan(/\S+/) image.gsub!(/\\/,'') - width=200 - width=z[/(\d+)x\d*/,1] ||='200' #watch + width=if z =~/(\d+)x\d*/ + z[/(\d+)x\d*/,1] + else 200 + end dm=case @md.papersize when /a4/; @tx.a4 when /letter/; @tx.letter @@ -829,58 +832,60 @@ WOK else @tx.a4 end width=if orientation =~/portrait/ #value is not currently passed - width=if width.to_i > dm.portrait.img_px; dm.portrait.img_px - else width + width=if width.to_i > dm.portrait.img_px + dm.portrait.img_px + else width end else - width=if width.to_i > dm.landscape.img_px; dm.landscape.img_px - else width + width=if width.to_i > dm.landscape.img_px + dm.landscape.img_px + else width end end c=z[/``(.+?)''/m,1] hsp="\n{\\color{mywhite} .}&~\n" # ~ character for hardspace - caption="{\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c}\\end{scriptsize}&}" if c + caption=if c + "{\\\\\ \n\\begin{scriptsize}#{hsp*3}#{c}\\end{scriptsize}&}" + else '' + end elsif word =~/\{\s*(\S+\.?\.(?:png|jpg|gif))/ tell=SiSU_Screen::Ansi.new(@md.cmd,%{document built without image: "#{$1}" as image dimensions not provided (& librmagick-ruby is not installed)?\n}) tell.print_grey #unless @opt.cmd =~/q/ end - ins=if image #most images fc etc. #% clean up ! - out=if @md.fns =~/\.(?:ssm\.)?sst$/ \ + word=if image #most images fc etc. #% clean up ! + word=if @md.fns =~/\.(?:ssm\.)?sst$/ \ and FileTest.file?("#{dir.path.image_source_local_tex}/#{image}") - @center_begin + - "\\\n\\href{#{url}}" + #not satisfactory: \\ added to ^line to mimic reference file output - "{\\includegraphics*[width=#{width}pt]" + - "{#{dir.path.image_source_local_tex}/#{image}}}" + - "#{caption}" + - @center_end if word =~ /(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|file|ftp):\/\/\S+)/ + word=if word =~ /(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|file|ftp):\/\/\S+)/ + "#@center_begin\\\n\\href{#{url}}{\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_local_tex}/#{image}}}#{caption} #@center_end" + end + word elsif @md.fns =~/\.-ss[tm]$/ \ and FileTest.file?("#{dir.path.image_source_remote_tex}/#{image}") - @center_begin + - "\\\n\\href{#{url}}" + #not satisfactory: \\ added to ^line to mimic reference file output - "{\\includegraphics*[width=#{width}pt]" + - "{#{dir.path.image_source_remote_tex}/#{image}}}" + - "#{caption}" + - @center_end if word =~ /(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|file|ftp):\/\/\S+)/ + word=if word =~ /(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|file|ftp):\/\/\S+)/ + "#@center_begin\\\n\\href{#{url}}{\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_remote_tex}/#{image}}}#{caption}#@center_end" + end + word elsif FileTest.file?("#{dir.path.image_source_tex}/#{image}") - @center_begin + - "\\\n\\href{#{url}}\n" + #not satisfactory: \\ added to ^line to mimic reference file output, mirror above ... not tested - "{\\includegraphics*[width=#{width}pt]" + - "{#{dir.path.image_source_tex}/#{image}}}" + - "#{caption}" + - @center_end if word =~/(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|file|ftp):\/\/\S+)/ + word=if word =~/(\{[a-zA-Z0-9_\\]+\.(?:png|jpg|gif).+?\}(?:https?|file|ftp):\/\/\S+)/ + "#@center_begin\\\n\\href{#{url}}\n{\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_tex}/#{image}}}#{caption}#@center_end" + end + word else tell=SiSU_Screen::Ansi.new(@md.cmd,"ERROR - image:",%{"#{image}" missing},"search locations: #{dir.path.image_source_local_tex},#{dir.path.image_source_remote_tex} and #{dir.path.image_source_tex}") tell.error2 unless @md.cmd =~/q/ - '' if word =~ /\{\S+\.(png|jpg|gif).+?\}(?:https?|file|ftp):\/\/\S+/ + word='' if word =~ /\{\S+\.(png|jpg|gif).+?\}(?:https?|file|ftp):\/\/\S+/ + word end else link=z.strip #[/(.+?)\\/m,1] - word="\\href{#{url}}{#{link}}#{d}" if word =~/\\\{.+?\\\}(?:https?|file|ftp):\/\/\S+/ + word="\\href{#{url}}{#{link}}#{punctuate}" if word =~/\\\{.+?\\\}(?:https?|file|ftp):\/\/\S+/ + word end else word end end - @words.join + @words=@words.join + @words end def http(orientation) wm=@string.dup.scan(/\\\{.+?\\\}(?:(?:https?|file|ftp):\S+|image)|\w+\s*|./m) diff --git a/lib/sisu/v0/wikispeak.rb b/lib/sisu/v0/wikispeak.rb index acf14759..224e1497 100644 --- a/lib/sisu/v0/wikispeak.rb +++ b/lib/sisu/v0/wikispeak.rb @@ -379,7 +379,7 @@ WOK #content << @@wiki[:metadata] #content << @@wiki[:owner_details] if @md.stmp =~/\w+/ #not used? #content << @@wiki[:tail] - Output.new(content.to_s,@md).wiki + Output.new(content.join,@md).wiki @@wiki[:head],@@wiki[:body],@@wiki[:tail],@@wiki[:metadata]=[],[],[],[] end end -- cgit v1.2.3