Browse files

configs

  • Loading branch information...
1 parent 4f4b864 commit 0315f4bfb2e389c1b89c8ff4eafc34f26fac15c5 blake.mizerany@gmail.com committed Sep 18, 2007
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/sinatra/dsl.rb
View
12 lib/sinatra/dsl.rb
@@ -13,11 +13,19 @@ def after_attend(filter_name = nil, &block)
end
def helpers(&block)
- Sinatra::EventContext.class_eval &block
+ Sinatra::EventContext.class_eval(&block)
end
def static(path, root)
Sinatra::StaticEvent.new(path, File.join(File.dirname($0) + root))
end
-
+
+ %w(test development production).each do |env|
+ module_eval <<-end_eval
+ def #{env}
+ yield if Sinatra::Options.environment == :#{env}
+ end
+ end_eval
+ end
+
end

0 comments on commit 0315f4b

Please sign in to comment.