mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
simplify
This commit is contained in:
parent
0303ed6442
commit
9a3f09986f
2 changed files with 21 additions and 21 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue