From d1286c7502d1918fd55f8605798b791ed469313d Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Mat=C3=ADas=20Flores?= Date: Tue, 9 Feb 2010 17:39:55 -0300 Subject: [PATCH] Use Rack::Builder.app shortcut when possible --- lib/rack/builder.rb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rack/builder.rb b/lib/rack/builder.rb index 530f0aa..11c4f19 100644 --- a/lib/rack/builder.rb +++ b/lib/rack/builder.rb @@ -32,7 +32,7 @@ module Rack options = opts.parse! $1.split(/\s+/) end cfgfile.sub!(/^__END__\n.*/, '') - app = eval "Rack::Builder.new {( " + cfgfile + "\n )}.to_app", + app = eval "Rack::Builder.app {( " + cfgfile + "\n )}", TOPLEVEL_BINDING, config else require config @@ -60,7 +60,7 @@ module Rack def map(path, &block) if @ins.last.kind_of? Hash - @ins.last[path] = self.class.new(&block).to_app + @ins.last[path] = self.class.app(&block) else @ins << {} map(path, &block) -- 1.6.3.3