diff --git a/lib/middleman/base.rb b/lib/middleman/base.rb index 267c042d..5d994ce9 100644 --- a/lib/middleman/base.rb +++ b/lib/middleman/base.rb @@ -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 diff --git a/lib/middleman/core_extensions/builder.rb b/lib/middleman/core_extensions/builder.rb index bad03ec2..fc000ae7 100644 --- a/lib/middleman/core_extensions/builder.rb +++ b/lib/middleman/core_extensions/builder.rb @@ -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 \ No newline at end of file