diff options
author | Ralph Amissah <ralph@amissah.com> | 2009-12-19 16:44:00 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2009-12-19 16:44:00 -0500 |
commit | c55796e30e0aad7db8367d7a56dd80c9a278d2d5 (patch) | |
tree | 35c28fbfe619778e14f3cbaf0d7e3b737067be4c /lib/sisu/v1/dal_substitutions_and_insertions.rb | |
parent | minor code adjustments (diff) |
param & dal, includes removal of older header markup, simplification to allow cleaner v1 & v2
Diffstat (limited to 'lib/sisu/v1/dal_substitutions_and_insertions.rb')
-rw-r--r-- | lib/sisu/v1/dal_substitutions_and_insertions.rb | 73 |
1 files changed, 49 insertions, 24 deletions
diff --git a/lib/sisu/v1/dal_substitutions_and_insertions.rb b/lib/sisu/v1/dal_substitutions_and_insertions.rb index cadae8a7..1ffb22d4 100644 --- a/lib/sisu/v1/dal_substitutions_and_insertions.rb +++ b/lib/sisu/v1/dal_substitutions_and_insertions.rb @@ -79,29 +79,55 @@ module SiSU_substitute_and_insert @skin.select ins=SiSU_Viz::Inserts.new case para - when /^\s*<:insert1>\s*$/ - para=[] - ins.insert1.split(/\n\n/).each{|x| para << x } - when /^\s*<:insert2>\s*$/ - para=[] - ins.insert2.split(/\n\n/).each{|x| para << x } - when /^\s*<:insert3>\s*$/ - para=[] - ins.insert3.split(/\n\n/).each{|x| para << x << "\n"} - para=ins.insert3 - when /^\s*<:insert4>\s*$/ - para=[] - ins.insert4.split(/\n\n/).each{|x| para << x << "\n"} - para=ins.insert4 - when /^\s*<:insert5>\s*$/ - para=[] - ins.insert5.split(/\n\n/).each{|x| para << x << "\n"} - when /^\s*<:insert6>\s*$/ - para=[] - ins.insert6.split(/\n\n/).each{|x| para << x << "\n"} - when /^\s*<:insert7>\s*$/ - para=[] - ins.insert7.split(/\n\n/).each{|x| para << x << "\n"} + when /^\s*<:(insert1)>\s*$/ + i=$1 + if defined? ins.insert1 + para=[] + ins.insert1.split(/\n\n/).each{|x| para << x } + else p "skin #{i} not found in #{@skin.select}" + end + when /^\s*<:(insert2)>\s*$/ + i=$1 + if defined? ins.insert2 + para=[] + ins.insert2.split(/\n\n/).each{|x| para << x } + else p "skin #{i} not found in #{@skin.select}" + end + when /^\s*<:(insert3)>\s*$/ + i=$1 + if defined? ins.insert3 + para=[] + ins.insert3.split(/\n\n/).each{|x| para << x << "\n"} + else p "skin #{i} not found in #{@skin.select}" + end + when /^\s*<:(insert4)>\s*$/ + i=$1 + if defined? ins.insert4 + para=[] + ins.insert4.split(/\n\n/).each{|x| para << x << "\n"} + else p "skin #{i} not found in #{@skin.select}" + end + when /^\s*<:(insert5)>\s*$/ + i=$1 + if defined? ins.insert5 + para=[] + ins.insert5.split(/\n\n/).each{|x| para << x << "\n"} + else p "skin #{i} not found in #{@skin.select}" + end + when /^\s*<:(insert6)>\s*$/ + i=$1 + if defined? ins.insert6 + para=[] + ins.insert6.split(/\n\n/).each{|x| para << x << "\n"} + else p "skin #{i} not found in #{@skin.select}" + end + when /^\s*<:(insert7)>\s*$/ + i=$1 + if defined? ins.insert7 + para=[] + ins.insert7.split(/\n\n/).each{|x| para << x << "\n"} + else p "skin #{i} not found in #{@skin.select}" + end end para.each{|x| data_expand << x } else data_expand << para @@ -126,4 +152,3 @@ module SiSU_substitute_and_insert end end __END__ - |