1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

Backwards compatibility with old Rack aPI. Fixes #447

This commit is contained in:
Thomas Reynolds 2012-05-24 11:01:46 -07:00
parent b202e71348
commit fffa80a987

View file

@ -23,6 +23,8 @@ module Middleman
app.extend ClassMethods app.extend ClassMethods
app.extend ServerMethods app.extend ServerMethods
Middleman.extend CompatibleClassMethods
# Include instance methods # Include instance methods
app.send :include, InstanceMethods app.send :include, InstanceMethods
end end
@ -135,6 +137,18 @@ module Middleman
end end
end end
module CompatibleClassMethods
# Create a new Class which is based on Middleman::Application
# Used to create a safe sandbox into which extensions and
# configuration can be included later without impacting
# other classes and instances.
#
# @return [Class]
def server(&block)
::Middleman::Application.server(&block)
end
end
# Methods to be mixed-in to Middleman::Application # Methods to be mixed-in to Middleman::Application
module InstanceMethods module InstanceMethods
# Backwards-compatibility with old request.path signature # Backwards-compatibility with old request.path signature