Browse files

Use Sinatra functions to make get methods look nicer

  • Loading branch information...
1 parent 55153b1 commit 5f77b972a89aea2aea3ac002e286a4fbba2843eb @ttencate committed Jan 15, 2012
Showing with 4 additions and 6 deletions.
  1. +2 −3 lib/blimp/handlers/page_handler.rb
  2. +2 −3 lib/blimp/handlers/static_handler.rb
View
5 lib/blimp/handlers/page_handler.rb
@@ -11,10 +11,9 @@ class PageHandler < Blimp::Handler
rescue Page::NotFound
raise Sinatra::NotFound
end
- headers = {"Content-Type" => "text/html;charset=utf-8"}
+ headers "Content-Type" => "text/html;charset=utf-8"
# TODO verify that the theme actually returns utf-8
- body = theme.render(resource.body)
- [200, headers, body]
+ body theme.render(resource.body)
end
end
end
View
5 lib/blimp/handlers/static_handler.rb
@@ -9,9 +9,8 @@ class StaticHandler < Blimp::Handler
rescue Static::NotFound
raise Sinatra::NotFound
end
- headers = {"Content-Type" => resource.mimetype}
- body = resource.contents
- [200, headers, body]
+ headers "Content-Type" => resource.mimetype
+ body resource.contents
end
end
end

0 comments on commit 5f77b97

Please sign in to comment.