fixes: alphabet list (concordance, dal_idx), and file types (dal_expand_insertions)
authorRalph Amissah <ralph@amissah.com>
Tue, 16 Sep 2008 04:35:57 +0000 (00:35 -0400)
committerRalph Amissah <ralph@amissah.com>
Tue, 16 Sep 2008 04:35:57 +0000 (00:35 -0400)
CHANGELOG
lib/sisu/v0/concordance.rb
lib/sisu/v0/dal.rb
lib/sisu/v0/dal_expand_insertions.rb
lib/sisu/v0/dal_idx.rb

index 1cfaf8a16cccfef1f9f8c3c16373bb047d628c1f..663cb8fdd32750362559ba4aa3db049c3a5bd92c 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,7 +9,7 @@ Reverse Chronological:
 
 %% STABLE MANIFEST
 
-%% sisu_0.69.0.orig.tar.gz (2008-09-15:37/1)
+%% sisu_0.69.0.orig.tar.gz (2008-09-16:37/2)
 http://www.jus.uio.no/sisu/pkg/src/sisu_0.69.0.orig.tar.gz
   sisu_0.69.0.orig.tar.gz
   sisu_0.69.0-1.dsc
index dd4411acde9c0e494c4c806d7e6054d47c18ade3..babc6655743e7a7bcc6d706d18022cca44ca368b 100644 (file)
@@ -326,8 +326,11 @@ WOK
           f=/^(\S)/.match(word)[1]
           if letter < f.upcase
             while letter < f.upcase
-              letter=alph.shift
-              @file_concordance << %{\n<hr />\n<p class="book_index_lev1"><a name="#{letter}">#{letter}</a></p>}
+              if alph.length > 0
+                letter=alph.shift
+                @file_concordance << %{\n<hr />\n<p class="book_index_lev1"><a name="#{letter}">#{letter}</a></p>}
+              else break
+              end
             end
           end
           keyword=SiSU_Concordance::Source::Word.new(word,@freq[word]).html
index c01c2d0a958f5dc1cfae50e57c8fb9622fb319a6..18e2f8dd7d08795ab7ac551def210c2e6f8aaa6b 100644 (file)
@@ -265,51 +265,6 @@ module SiSU_DAL
       outputdata
     end
   protected
-    def output_filetypes_in_cmd(cmd_shortcut,source=nil)
-      #make list of file types in shortcut command (as configured), e.g. when sisu -3 is used
-      cf_defaults=SiSU_Env::Info_processing_flag.new
-      cmd_list=case cmd_shortcut.inspect
-      when /0/; cf_defaults.cf_0
-      when /1/; cf_defaults.cf_1
-      when /2/; cf_defaults.cf_2
-      when /3/; cf_defaults.cf_3
-      when /4/; cf_defaults.cf_4
-      when /5/; cf_defaults.cf_5
-      end
-      file_type_names={}
-      file_type_names[:gen],file_type_names[:src]=[],[]
-      file_type_names[:gen] <<= if cmd_list =~ /y/; 'sisu_manifest.html'
-      end
-      file_type_names[:gen] <<= if cmd_list =~ /h/; ['toc.html', 'doc.html']
-      end
-      file_type_names[:gen] <<= if cmd_list =~ /p/; ['landscape.pdf', 'portrait.pdf']
-      end
-      #file_type_names[:gen] <<= if cmd_list =~ /i/; 'manpage.1'
-      #end
-      file_type_names[:gen] <<= if cmd_list =~ /o/; 'opendocument.odt'
-      end
-      file_type_names[:gen] <<= if cmd_list =~ /b/; 'scroll.xhtml'
-      end
-      file_type_names[:gen] <<= if cmd_list =~ /x/; 'sax.xml'
-      end
-      file_type_names[:gen] <<= if cmd_list =~ /X/; 'dom.xml'
-      end
-      file_type_names[:gen] <<= if cmd_list =~ /a/; 'plain.txt'
-      end
-      file_type_names[:gen] <<= if cmd_list =~ /g/; 'wiki.txt'
-      end
-      file_type_names[:gen] <<= if cmd_list =~ /w/; 'concordance.html'
-      end
-      file_type_names[:gen] <<= if cmd_list =~ /N/; 'digest.txt'
-      end
-      file_type_names[:src] <<= if source and cmd_shortcut =~ /s/; source
-      end
-      file_type_names[:src] <<= if cmd_shortcut =~ /S/; "#{source}.zip"
-      end
-      file_type_names[:gen]=file_type_names[:gen].flatten
-      file_type_names[:src]=file_type_names[:src].flatten
-      file_type_names
-    end
   end
 end
 __END__
index 1ab0c03b810a33368371aef82bc7dcd14674163c..173620921755f1be5777c313b0d9c115f549aea9 100644 (file)
@@ -64,6 +64,51 @@ module SiSU_insertions
     def initialize(data)
       @data=data
     end
+    def output_filetypes_in_cmd(cmd_shortcut,source=nil)
+      #make list of file types in shortcut command (as configured), e.g. when sisu -3 is used
+      cf_defaults=SiSU_Env::Info_processing_flag.new
+      cmd_list=case cmd_shortcut.inspect
+      when /0/; cf_defaults.cf_0
+      when /1/; cf_defaults.cf_1
+      when /2/; cf_defaults.cf_2
+      when /3/; cf_defaults.cf_3
+      when /4/; cf_defaults.cf_4
+      when /5/; cf_defaults.cf_5
+      end
+      file_type_names={}
+      file_type_names[:gen],file_type_names[:src]=[],[]
+      file_type_names[:gen] <<= if cmd_list =~ /y/; 'sisu_manifest.html'
+      end
+      file_type_names[:gen] <<= if cmd_list =~ /h/; ['toc.html', 'doc.html']
+      end
+      file_type_names[:gen] <<= if cmd_list =~ /p/; ['landscape.pdf', 'portrait.pdf']
+      end
+      #file_type_names[:gen] <<= if cmd_list =~ /i/; 'manpage.1'
+      #end
+      file_type_names[:gen] <<= if cmd_list =~ /o/; 'opendocument.odt'
+      end
+      file_type_names[:gen] <<= if cmd_list =~ /b/; 'scroll.xhtml'
+      end
+      file_type_names[:gen] <<= if cmd_list =~ /x/; 'sax.xml'
+      end
+      file_type_names[:gen] <<= if cmd_list =~ /X/; 'dom.xml'
+      end
+      file_type_names[:gen] <<= if cmd_list =~ /a/; 'plain.txt'
+      end
+      file_type_names[:gen] <<= if cmd_list =~ /g/; 'wiki.txt'
+      end
+      file_type_names[:gen] <<= if cmd_list =~ /w/; 'concordance.html'
+      end
+      file_type_names[:gen] <<= if cmd_list =~ /N/; 'digest.txt'
+      end
+      file_type_names[:src] <<= if source and cmd_shortcut =~ /s/; source
+      end
+      file_type_names[:src] <<= if cmd_shortcut =~ /S/; "#{source}.zip"
+      end
+      file_type_names[:gen]=file_type_names[:gen].flatten
+      file_type_names[:src]=file_type_names[:src].flatten
+      file_type_names
+    end
     def expand_insertions?
       data=@data
       tuned_file,tuned_file_tmp=[],[]
index c2bba84691b3ee75b5ab86fe1bb713a440692d5e..d7d5223e3e41f58f45bcceda73300388fa19f796 100644 (file)
@@ -181,8 +181,11 @@ module SiSU_book_index
             f=/^(\S)/.match(x)[1]
             if letter < f
               while letter < f
-                letter=alph.shift
-                @idx[:html] << %{\n<hr />\n<p class="book_index_lev1"><a name="#{letter}">#{letter}</a></p>}
+                if alph.length > 0
+                  letter=alph.shift
+                  @idx[:html] << %{\n<hr />\n<p class="book_index_lev1"><a name="#{letter}">#{letter}</a></p>}
+                else break
+                end
               end
             end
             @idx[:sst] << %{\n\n#{Mx[:fa_bold_o]}#{x},#{Mx[:fa_bold_c]} }