This commit is contained in:
Thomas Reynolds 2011-08-04 19:52:23 -07:00
parent 0303ed6442
commit 9a3f09986f
2 changed files with 21 additions and 21 deletions

View file

@ -127,27 +127,6 @@ module Middleman::Base
super(option, value, &nil)
end
def build_reroute(&block)
@build_rerouters ||= []
@build_rerouters << block
end
def reroute_builder(desination, request_path)
@build_rerouters ||= []
result = [desination, request_path]
@build_rerouters.each do |block|
output = block.call(desination, request_path)
if output
result = output
break
end
end
result
end
def before_processing(&block)
@before_processes ||= []
@before_processes << block

View file

@ -16,5 +16,26 @@ module Middleman::CoreExtensions::Builder
@run_after_build ||= []
@run_after_build
end
def build_reroute(&block)
@build_rerouters ||= []
@build_rerouters << block
end
def reroute_builder(desination, request_path)
@build_rerouters ||= []
result = [desination, request_path]
@build_rerouters.each do |block|
output = block.call(desination, request_path)
if output
result = output
break
end
end
result
end
end
end