Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

configs

  • Loading branch information...
commit 0315f4bfb2e389c1b89c8ff4eafc34f26fac15c5 1 parent 4f4b864
blake.mizerany@gmail.com authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.