# File lib/glue/macro.rb, line 20 def require(path) return if $__required__[path] source = File.read(path) # parse macro source.gsub!(/defmacro\s*\/(.*?)\/\s(.*?)endmacro/m) { $__macros__[Regexp.new($1)] = $2 ; "" } # expand macros $__macros__.each { |match, replace| source.gsub!(match, replace) } $__required__[path] = true eval(source) end