Removed env from redirect and changed redirect from method to macro.

Removed `env.redirect` in-favor of `redirect` in-order to make Kemal's
API look more like Sinatra.

Thanks @sdogruyol and @f for introducing me to macros :-).

Binding HTTP::Server to 0.0.0.0
This commit is contained in:
Imran Latif 2015-12-10 00:37:23 +05:00
parent d825b2316a
commit 4d1e31cb41
8 changed files with 20 additions and 11 deletions

View file

@ -187,7 +187,7 @@ describe "Kemal::Handler" do
it "redirects user to provided url" do
kemal = Kemal::Handler.new
kemal.add_route "GET", "/" do |env|
env.redirect("/login")
redirect "/login"
end
request = HTTP::Request.new("GET", "/")
response = kemal.call(request)