Permalink
Browse files

Allow passing a list of modules to the 'helpers' method [NO TESTS]

  • Loading branch information...
1 parent 64c8297 commit e6614a2a21171367018f5984bdf7056d4d5c74e8 @foca foca committed with bmizerany Jan 26, 2009
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/sinatra/main.rb
View
@@ -32,8 +32,11 @@ class Default < Base
include Sinatra::Delegator
-def helpers(&block)
- Sinatra::Application.send :class_eval, &block
+def helpers(*modules, &block)
+ Sinatra::Application.class_eval do
+ modules.each {|m| include m }
+ end
+ Sinatra::Application.class_eval(&block)
end
def mime(ext, type)

0 comments on commit e6614a2

Please sign in to comment.