From c5b0ba17eafc3632f4ae196fd798ce237b5aa974 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Sat, 22 Feb 2014 20:10:25 -0800 Subject: [PATCH] Fix Padrino integration after merge --- .../middleman-more/core_extensions/default_helpers.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb b/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb index 6bbceb66..288c99b4 100644 --- a/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb +++ b/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb @@ -68,7 +68,7 @@ class Middleman::CoreExtensions::DefaultHelpers < ::Middleman::Extension handler = auto_find_proper_handler(&block) captured_block, captured_html = nil, '' - if handler && handler.block_is_type?(block) + if handler && handler.engine_matches?(block) captured_html, captured_block = handler.capture_from_template(*args, &block) end @@ -80,7 +80,13 @@ class Middleman::CoreExtensions::DefaultHelpers < ::Middleman::Extension def auto_find_proper_handler(&block) if block_given? engine = File.extname(block.source_location[0])[1..-1].to_sym - ::Padrino::Helpers::OutputHelpers.handlers.map { |h| h.new(self) }.find { |h| h.engines.include?(engine) && h.block_is_type?(block) } + ::Padrino::Helpers::OutputHelpers.handlers.select do |e, h| + e == engine + end.values.map do |h| + h.new(self) + end.find do |h| + h.engine_matches?(block) + end else find_proper_handler end