diff options
Diffstat (limited to 'lib/sisu/v3/dal_numbering.rb')
-rw-r--r-- | lib/sisu/v3/dal_numbering.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sisu/v3/dal_numbering.rb b/lib/sisu/v3/dal_numbering.rb index c0bb4cb1..f81563f3 100644 --- a/lib/sisu/v3/dal_numbering.rb +++ b/lib/sisu/v3/dal_numbering.rb @@ -82,7 +82,7 @@ module SiSU_DAL_Numbering && dob.ocn_ #and dob.obj !~ /#{Mx[:gr_o]}Th|#{Mx[:tc_o]}#{Mx[:tc_p]}#{Mx[:tc_p]}/ #FIX dob.obj=dob.obj.gsub(/(.+)\n/,'\1 ') #messy, but idea is that tables should retain breaks end - unless dob.obj.class==Array + unless dob.obj.is_a?(Array) dob.obj=dob.obj.gsub(/^\s+/,''). gsub(/\s$/,"\n") end @@ -160,7 +160,7 @@ module SiSU_DAL_Numbering if dob.ln==no1 t_no1+=1; t_no2=0; t_no3=0 title_no="#{t_no1}" - if not @md.seg_names.nil? \ + if @md.seg_names.is_a?(Array) \ and not @md.seg_names.include?(title_no) if dob.ln==no1 dob.name="#{title_no}" if not dob.name @@ -303,7 +303,7 @@ module SiSU_DAL_Numbering possible_seg_name=$1 possible_seg_name=possible_seg_name.gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') - if not @md.seg_names.nil? \ + if @md.seg_names.is_a?(Array) \ and not @md.seg_names.include?(possible_seg_name) dob.name=possible_seg_name dob.tags=[dob.name,dob.tags].flatten if dob.name !~/^\d+$/ @@ -313,7 +313,7 @@ module SiSU_DAL_Numbering end if dob.ln==4 \ and dob.name #extract segment name from embedded document structure info - if not @md.seg_names.nil? \ + if @md.seg_names.is_a?(Array) \ and not @md.seg_names.include?(dob.name) dob.tags=[dob.name,dob.tags].flatten if dob.name !~/^\d+$/ @md.seg_names << dob.name @@ -323,7 +323,7 @@ module SiSU_DAL_Numbering and not dob.name #if still no segment name, provide a numerical one pf='_' #pg='' #may use e.g. '' or '~' or '_' segn_auto="#{pf}#{art_filename_auto.to_s}" - if not @md.seg_names.nil? \ + if @md.seg_names.is_a?(Array) \ and not @md.seg_names.include?(segn_auto) dob.name=segn_auto dob.tags=[dob.name,dob.tags].flatten if dob.name !~/^\d+$/ #check whether will work across file types with stop signs @@ -435,9 +435,9 @@ module SiSU_DAL_Numbering and dob.obj !~/\A\s*\Z/m \ and dob.is !=:layout @md.set_heading_seg=true - head=if @md.title.main ; dob.ln,dob.name,dob.obj=4,'seg',@md.title.main - else dob.ln,dob.name,dob.obj=4,'seg','[segment]' - end + head=@md.title.main \ + ? (dob.ln,dob.name,dob.obj=4,'seg',@md.title.main) + : (dob.ln,dob.name,dob.obj=4,'seg','[segment]') @tuned_file << head end end |