Permalink
Browse files

Moving #read to Rack::ESI

  • Loading branch information...
1 parent 90082c2 commit 6620175a37b7257b1a10435c21ca78b8957324ce Daniel O'Brien committed May 2, 2012
Showing with 6 additions and 6 deletions.
  1. +5 −0 lib/rack-esi.rb
  2. +1 −6 lib/rack-esi/processor.rb
View
@@ -27,6 +27,11 @@ def queue(&block)
@queue.push block
end
+ def read(enumerable, buffer = '')
+ enumerable.each { |str| buffer << str }
+ buffer
+ end
+
attr_reader :serializer
def call(env)
@@ -12,17 +12,12 @@ def process_document(d)
Error = Class.new RuntimeError
- def read(enumerable, buffer = '')
- enumerable.each { |str| buffer << str }
- buffer
- end
-
def process_document(document)
raise NotImplementedError
end
def process(body)
- document = read(body)
+ document = esi.read(body)
process_document document
[
document.send( esi.serializer )

0 comments on commit 6620175

Please sign in to comment.