<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,27 +2,45 @@ require 'erb'
 
 # = OpenTemplate
 #
-# The Erb OpenTemplate provides a quick and conenient way to create a clean rendering
-# space with out the defined response desired.
+# The Erb OpenTemplate provides a quick and convenient way to
+# create a clean rendering space with the desired responses.
 #
-# TODO: Perhaps can be improved by using singletons instead of method_missing.
+# TODO: This might make a good addon library. Just add 
+# require 'erb' to the erb_result method? Call it OpenResponse?
 #
 class ERB::OpenTemplate
 
+  # TODO: Should we do this? Perhaps offer it as an option?
   instance_methods.each do |m|
-    undef_method(m) unless /^(__|instance_|inspect$)/ =~ m.to_s
+    undef_method(m) unless /^(__|instance_|inspect$|extend$)/ =~ m.to_s
   end
 
   #
   def initialize(*objs_ioc)
     ioc = Hash===objs_ioc.last ? objs_ioc.pop : {}
-    @objs = objs_ioc
+    objs = objs_ioc
 
+    mods = []
+
+    objs.each do |obj|
+      mod = Module.new
+      obj.public_methods.each do |m|
+        mod.module_eval do
+          define_method(m){ |*a,&amp;b| obj.__send__(m,*a,&amp;b) }
+        end
+      end
+      mods &lt;&lt; mod
+    end
+
+    mod = Module.new
     ioc.each do |k,v|
-      (class &lt;&lt; self; self; end).module_eval do
+      mod.module_eval do
         define_method(k){ v }
       end
     end
+    mods &lt;&lt; mod
+
+    extend *mods.reverse
   end
 
   #
@@ -31,15 +49,15 @@ class ERB::OpenTemplate
   end
 
   #
-  def method_missing(sym, *args, &amp;block)
-    #if @ioc.key?(sym)
-    #  @ioc[sym]
-    if obj = @objs.find{ |o| o.respond_to?(sym) }
-      obj.__send__(sym, *args, &amp;block)
-    else
-      super
-    end
-  end
+  #def method_missing(sym, *args, &amp;block)
+  #  #if @ioc.key?(sym)
+  #  #  @ioc[sym]
+  #  if obj = @objs.find{ |o| o.respond_to?(sym) }
+  #    obj.__send__(sym, *args, &amp;block)
+  #  else
+  #    super
+  #  end
+  #end
 
 end
 </diff>
      <filename>lib/more/facets/erb.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bcfada1ee44da801fdc07f9224bd8af4915614ed</id>
    </parent>
  </parents>
  <author>
    <name>trans</name>
    <email>transfire@gmail.com</email>
  </author>
  <url>http://github.com/trans/facets/commit/d8062f9cb4787624f534a6e9f4f476a8fad78c0d</url>
  <id>d8062f9cb4787624f534a6e9f4f476a8fad78c0d</id>
  <committed-date>2009-10-19T23:57:54-07:00</committed-date>
  <authored-date>2009-10-19T23:57:54-07:00</authored-date>
  <message>improved erb.rb using dynamic modules</message>
  <tree>5eea105cbb819b69e8a5a84b52a0f8309bfb5737</tree>
  <committer>
    <name>trans</name>
    <email>transfire@gmail.com</email>
  </committer>
</commit>
