aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/dal.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-05-10 01:38:12 -0400
committerRalph Amissah <ralph@amissah.com>2008-05-10 01:38:12 -0400
commitdc0648fefb0f43e6432d55d05416a1b38bafeb95 (patch)
tree69c07817f2eb5279fbae2391592cf37fabcbefb2 /lib/sisu/v0/dal.rb
parentsisu-0.66.2 + md5s (diff)
addition of a couple of multiline search tags, and minor rearrangement
Diffstat (limited to 'lib/sisu/v0/dal.rb')
-rw-r--r--lib/sisu/v0/dal.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb
index 577c3b9e..c5a07f9c 100644
--- a/lib/sisu/v0/dal.rb
+++ b/lib/sisu/v0/dal.rb
@@ -663,7 +663,7 @@ module SiSU_DAL
@tuned_file=[]
object_array=SiSU_document_structure::OCN.new(@md,data).ocn
object_array.each do |o|
- @tuned_file <<= if o.ocn; "#{o.txt} <~#{o.ocn};#{o.lv};#{o.type}>"
+ @tuned_file <<= if o.ocn; "#{o.txt} <~#{o.ocn};#{o.lv};#{o.type}>" #main ocn descriptor
else o.txt
end
end
@@ -1112,10 +1112,10 @@ module SiSU_DAL
if en_plus =~/~\{.+?\}~|~\[.+?\]~/
para_txt,en_open,en_txt,en_close=/(.*?)(~\{|~\[)(.+?)(\}~|\]~)/m.match(en_plus)[1..4]
stripped_en=strip_clean_of_markup(en_txt)
- if @env.digest.type =~/sha256/
- digest_en_strip=Digest::SHA256.hexdigest(stripped_en)
+ digest_en_strip=if @env.digest.type =~/sha256/
+ Digest::SHA256.hexdigest(stripped_en)
else
- digest_en_strip=Digest::MD5.hexdigest(stripped_en)
+ Digest::MD5.hexdigest(stripped_en)
end
para_txt + en_open + en_txt + '<' + digest_en_strip + '>' + en_close
else puts "Error Exception - problem encountered with:\n#{en_plus}" #arbitrary exception, tidy up
@@ -1136,7 +1136,7 @@ module SiSU_DAL
def strip_clean_of_markup(s) # used for digest, define rules, make same as in db clean
#consider: <\/?[ib]>|<(?:\/ )?br>|<del>(.+?)<\/del>
s=s.dup
- s=s.gsub(/(?:<\/?[ib]>|<~\d+;(?:\w|[0-6]:)\d+;\w\d+>|<#@dp:#@dp>|^[1-6]~\S+|~\{\d+\s.+?\}~)/,'') # markup and endnotes removed
+ s=s.gsub(/(?:<\/?[ib]>|<~\d+;(?:\w|[0-6]:)\d+;\w\d+>|<#@dp:#@dp>|^[1-6]~\S+|~\{\d+\s.+?\}~)/m,'') # markup and endnotes removed
#% same as db clean -->
s=s.gsub(/<del>(.+?)<\/del>/,'DELETED(\1)') # deletions
s=s.gsub(/<sup>(\d+)<\/sup>/,'[\1]')