From 8e092e0f3acc154f60f296419d1fab4d59f65e53 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 15 Oct 2007 19:22:03 +0100 Subject: regex matching of images, (and rearrangement of conditionals) --- lib/sisu/v0/remote.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v0/remote.rb') diff --git a/lib/sisu/v0/remote.rb b/lib/sisu/v0/remote.rb index 2a45e3cb..efa49dc0 100644 --- a/lib/sisu/v0/remote.rb +++ b/lib/sisu/v0/remote.rb @@ -113,7 +113,7 @@ module SiSU_Remote require 'open-uri' require 'pp' require "#{SiSU_lib}/composite" - @rgx_image=/\{\s*(\S+?\.(?:png|jpg|gif))/ + @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ @rgx_skin=/(?:0~|@)skin:?\s+(\S+)/ #@rgx_skin=/^0~skin\s+(\S+)/ threads=[] for requested_page in @get_s @@ -133,10 +133,12 @@ module SiSU_Remote images << r.scan(@rgx_image).uniq if r =~@rgx_image downloaded_file << r end - if skin and skin.length > 0 + if skin \ + and skin.length > 0 SiSU_Assemble::Remote_image.new.download_doc_skin(skin) end - if images and images.length > 1 + if images \ + and images.length > 1 images.flatten!.uniq! @msg,@msgs='downloading images:', [ images.join(',') ] @tell.call.warn unless @opt.cmd =~/q/ -- cgit v1.2.3