aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/dal_doc_str.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/dal_doc_str.rb')
-rw-r--r--lib/sisu/v3/dal_doc_str.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/sisu/v3/dal_doc_str.rb b/lib/sisu/v3/dal_doc_str.rb
index 0abaf4d0..6bde88e2 100644
--- a/lib/sisu/v3/dal_doc_str.rb
+++ b/lib/sisu/v3/dal_doc_str.rb
@@ -363,8 +363,8 @@ module SiSU_DAL_DocumentStructureExtract
t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h)
t_o
else
- if t_o !~/^table\{/ \
- and not t_o.nil?
+ if t_o.is_a?(String) \
+ and t_o !~/^table\{/
t_o=t_o.gsub(/^\n+/m,''). #check added for ruby 1.9.2 not needed in 1.8 series (tested in v2)
gsub(/\n+/m,"#{Mx[:tc_p]}")
@rows += t_o + Mx[:tc_c]
@@ -385,8 +385,7 @@ module SiSU_DAL_DocumentStructureExtract
t_o=SiSU_DAL_DocumentStructure::ObjectComment.new.comment(h) #t_o=SiSU_DAL_DocumentStructure::ObjectLayout.new.insert(h)
end
if @@flag['code'] \
- and t_o.class==String \
- and not t_o.nil? #you may need to introduce t_o.class==String test more widely
+ and t_o.is_a?(String)
sub_array=t_o.dup + "#{Mx[:br_nl]}"
@line_mode=sub_array.scan(/.+/)
@line_mode=[]
@@ -461,7 +460,7 @@ module SiSU_DAL_DocumentStructureExtract
if @@flag['poem'] \
or @@flag['group'] \
or @@flag['alt']
- if t_o.class==String
+ if t_o.is_a?(String)
t_o=t_o.gsub(/\n/m,"#{Mx[:br_nl]}").
gsub(/[ ][ ]/m,"#{Mx[:nbsp]*2}").
gsub(/#{Mx[:nbsp]}\s/,"#{Mx[:nbsp]*2}")
@@ -527,7 +526,7 @@ module SiSU_DAL_DocumentStructureExtract
lines.each do |line|
line=if line =~/\S/ \
and line !~/^code\{|^\}code/ \
- and line.class != Hash
+ and not line.is_a?(Hash)
@@counter+=1 if @@flag['code']
line=line.gsub(/\s\s/,"#{Mx[:nbsp]*2}").
gsub(/#{Mx[:nbsp]}\s/,"#{Mx[:nbsp]*2}")