Permalink
Browse files

Update setup.rb to silence errors on shebang replacement. Camping han…

…dler now allows passing back of an IO object, to allow large file streaming. Simpler underscore replacement on Tepee wiki words.

git-svn-id: svn://rubyforge.org/var/svn/mongrel/trunk@154 19e92222-5c0b-0410-8929-a290d50e31e9
  • Loading branch information...
1 parent c21a82a commit 8c52783d14d025f5c86be1a580182cc625808524 why committed Apr 10, 2006
Showing with 813 additions and 578 deletions.
  1. +4 −3 examples/camping/tepee.rb
  2. +10 −1 lib/mongrel/camping.rb
  3. +799 −574 setup.rb
@@ -115,12 +115,13 @@ def list
def _markup body
return '' if body.blank?
body.gsub!(Tepee::Models::Page::PAGE_LINK) do
- page = title = $1.underscore
+ page = title = $1
title = $2 unless $2.empty?
+ page = page.gsub /\W/, '_'
if Tepee::Models::Page.find(:all, :select => 'title').collect { |p| p.title }.include?(page)
- %Q{<a href="#{R Show, page}">#{title}</a>}
+ %Q{<a href="#{self/R(Show, page)}">#{title}</a>}
else
- %Q{<span>#{title}<a href="#{R Edit, page, 1}">?</a></span>}
+ %Q{<span>#{title}<a href="#{self/R(Edit, page, 1)}">?</a></span>}
end
end
RedCloth.new(body, [ :hard_breaks ]).to_html
@@ -40,7 +40,16 @@ def process(request, response)
head[k] = vi
end
end
- out << controller.body
+ if controller.body.respond_to? :read
+ while chunk = controller.body.read(16384)
+ out << chunk
+ end
+ if controller.body.respond_to? :close
+ controller.body.close
+ end
+ else
+ out << controller.body
+ end
end
end
end
Oops, something went wrong. Retry.

0 comments on commit 8c52783

Please sign in to comment.