From 9a3f09986f04ac23767a1b7b89b51b2ecc3561e9 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Thu, 4 Aug 2011 19:52:23 -0700 Subject: [PATCH] simplify --- lib/middleman/base.rb | 21 --------------------- lib/middleman/core_extensions/builder.rb | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 21 deletions(-) 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