parse.rb
#take a relative url, and make it relative with respect to cur_folder
#WARNING: assume that cur_folder is only of level 1 ie ploum/ and not
#ploum/plam:
take a relative url, and make it relative with respect to cur_folder
WARNING: assume that cur_folder is only of level 1 ie ploum/ and not
ploum/plam.
take a relative url and make it relative with respect to cur_folder WARNING : assume that cur_folder is only of level 1 ie ploum / and not ploum / plam .
def relative_link(relurl,cur_folder=nil)
			return relurl if ! cur_folder or cur_folder.empty?
			cur_folder+='/' unless cur_folder[cur_folder.length-1]='/'
			if relurl=~/^#{cur_folder}/
				return relurl.sub(/^#{cur_folder}/,'')
			else
				return "../"+relurl
			end
		end
def relative_link ( relurl , cur_folder = nil ) return relurl if ! cur_folder or cur_folder . empty? cur_folder += '/' unless cur_folder [ cur_folder . length - 1 ] = '/' if relurl =~ / ^ #{ cur_folder } / return relurl . sub ( / ^ #{ cur_folder } / , '' ) else return "../" + relurl end end
take a relative url, and make it relative with respect to cur_folder
WARNING: assume that cur_folder is only of level 1 ie ploum/ and not
ploum/plam:
take a relative url and make it relative with respect to cur_folder WARNING : assume that cur_folder is only of level 1 ie ploum / and not ploum / plam :
relurl
cur_folder