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