lib/glue/template.rb in glue-0.24.0 vs lib/glue/template.rb in glue-0.25.0
- old
+ new
@@ -35,26 +35,26 @@
#
# gmosx: must be xformed before the <?r pi.
#
# Example:
# <?include href="root/myfile.sx" ?>
-
+
text.gsub!(/<\?include href=["|'](.*?)["|'](.*)\?>/) do |match|
- text = File.read("#{base_dir}/#$1")
- text.gsub!(/<\?xml.*\?>/, '')
- text.gsub!(/<\/?root(.*?)>/m, ' ');
- text
+ itext = File.read("#{base_dir}/#$1")
+ itext.gsub!(/<\?xml.*\?>/, '')
+ itext.gsub!(/<\/?root(.*?)>/m, ' ');
+ itext
end
# Transform include instructions <include href="xxx" />
# must be transformed before the processinc instructions.
# Useful to include fragments cached on disk
#
# gmosx, FIXME: NOT TESTED! test and add caching.
# add load_statically_included fixes.
text.gsub!(/<include href=["|'](.*?)["|'](.*)(.?)\/>/) do |match|
- "<?r File.read( '\#\{@dispatcher.root\}/#$1' ?>"
+ "<?r File.read( '\#{@dispatcher.root}/#$1' ?>"
end
# xform render/inject instructions <render href="xxx" />
# must be transformed before the processinc instructions.