lib/rubysmith/renderers/erb.rb in rubysmith-1.1.0 vs lib/rubysmith/renderers/erb.rb in rubysmith-1.1.1

- old
+ new

@@ -19,9 +19,17 @@ private attr_accessor :buffer attr_reader :configuration, :scope, :client - def namespace = self.buffer = block_given? ? scope.call(yield) : buffer + scope.call + def namespace + source = buffer.dup + + self.buffer = source + if block_given? + scope.call(yield.sub(source, "")) + else + scope.call + end + end end end end