aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/current/ao_numbering.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/current/ao_numbering.rb')
-rw-r--r--lib/sisu/current/ao_numbering.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/sisu/current/ao_numbering.rb b/lib/sisu/current/ao_numbering.rb
index 31986a86..861bbf07 100644
--- a/lib/sisu/current/ao_numbering.rb
+++ b/lib/sisu/current/ao_numbering.rb
@@ -172,7 +172,6 @@ module SiSU_AO_Numbering
gsub(/#{Mx[:gl_bullet]}/,'')
end
def auto_number_heading_ie_title(data) #also does some segment naming
- @tuned_file=[]
if defined? @md.make.num_top \
and @md.make.num_top \
and @md.make.num_top !~/^$/
@@ -185,7 +184,7 @@ module SiSU_AO_Numbering
end
chapter_number_counter=0
data=data.compact
- data.each do |dob| #@md.seg_names << [additions to segment names]
+ @tuned_file=data.each.map do |dob| #@md.seg_names << [additions to segment names]
title_no=nil
if dob.is ==:heading \
&& dob.autonum_ \
@@ -274,9 +273,8 @@ module SiSU_AO_Numbering
dob.tags=set_tags(dob.tags,dob.name)
end
dob.tags=dob.tags.uniq if defined? dob.tags
- @tuned_file << dob
- end
- @tuned_file=@tuned_file.flatten
+ dob
+ end.flatten
end
def ocn(data) #and auto segment numbering increment
@tuned_file=SiSU_AO_DocumentStructureExtract::OCN.new(@md,data,@fnx,@process).ocn
@@ -287,10 +285,9 @@ module SiSU_AO_Numbering
@tuned_file
end
def minor_numbering(data) #and auto segment numbering increment
- @tuned_file=[]
number_small,letter_small=0,0
letter=%w( a b c d e f g h i j k l m n o p q r s t u v w x y z )
- data.each do |dob|
+ @tuned_file=data.each.map do |dob|
if dob.of ==:heading \
|| dob.of ==:heading_insert \
|| dob.of ==:para \
@@ -313,9 +310,8 @@ module SiSU_AO_Numbering
end
end
end
- @tuned_file << dob
- end
- @tuned_file=@tuned_file.flatten
+ dob
+ end.flatten
end
def leading_zeros_fixed_width_number(possible_seg_name)
if possible_seg_name.to_s =~/^([0-9]+?\.|[0-9]+)$/m #!~/[.,:-]+/