minor builder refactor
This commit is contained in:
parent
537fdbb76b
commit
1b9ad20ed1
|
@ -1,8 +1,9 @@
|
|||
2.1.pre
|
||||
====
|
||||
Finally support Compass in Sprockets! Thanks to @xdite and @petebrowne
|
||||
Middleman::Sitemap object representing the known world
|
||||
Middleman::FileWatcher proxies file change events
|
||||
Sitemap object representing the known world
|
||||
FileWatcher proxies file change events
|
||||
Unified callback solution
|
||||
|
||||
2.0.14
|
||||
====
|
||||
|
|
|
@ -18,17 +18,16 @@ module Middleman::CoreExtensions::RackMap
|
|||
|
||||
# Creates a Rack::Builder instance with all the middleware set up and
|
||||
# an instance of this class as end point.
|
||||
def build(*args, &bk)
|
||||
builder = ::Rack::Builder.new
|
||||
builder.use ::Sinatra::ShowExceptions if show_exceptions?
|
||||
builder.use ::Rack::CommonLogger if logging?
|
||||
builder.use ::Rack::Head
|
||||
middleware.each { |c,a,b| builder.use(c, *a, &b) }
|
||||
def build(builder, *args, &bk)
|
||||
setup_default_middleware builder
|
||||
setup_middleware builder
|
||||
|
||||
maps.each { |p,b| builder.map(p, &b) }
|
||||
app = self
|
||||
builder.map "/" do
|
||||
run app.new!(*args, &bk)
|
||||
end
|
||||
|
||||
builder
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue