From a9839731e6f8ad795736c7b17baaca8a0db1ffb1 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Tue, 4 Jun 2013 09:48:01 -0700 Subject: [PATCH] only require padrino once --- .../lib/middleman-core/meta_pages/sitemap_resource.rb | 6 ++++-- .../lib/middleman-more/core_extensions/default_helpers.rb | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/middleman-core/lib/middleman-core/meta_pages/sitemap_resource.rb b/middleman-core/lib/middleman-core/meta_pages/sitemap_resource.rb index 24112d99..85a9b2c0 100644 --- a/middleman-core/lib/middleman-core/meta_pages/sitemap_resource.rb +++ b/middleman-core/lib/middleman-core/meta_pages/sitemap_resource.rb @@ -1,5 +1,7 @@ -require 'vendored-middleman-deps/padrino-core-0.10.7/lib/padrino-core/support_lite' -require 'vendored-middleman-deps/padrino-helpers-0.10.7/lib/padrino-helpers' +if defined?(::Padrino::Helpers) + require 'vendored-middleman-deps/padrino-core-0.10.7/lib/padrino-core/support_lite' + require 'vendored-middleman-deps/padrino-helpers-0.10.7/lib/padrino-helpers' +end module Middleman module MetaPages 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 f9069f68..670aa831 100644 --- a/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb +++ b/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb @@ -4,8 +4,11 @@ class Middleman::CoreExtensions::DefaultHelpers < ::Middleman::Extension super require 'active_support/core_ext/object/to_query' - require 'vendored-middleman-deps/padrino-core-0.10.7/lib/padrino-core/support_lite' - require 'vendored-middleman-deps/padrino-helpers-0.10.7/lib/padrino-helpers' + + if defined?(::Padrino::Helpers) + require 'vendored-middleman-deps/padrino-core-0.10.7/lib/padrino-core/support_lite' + require 'vendored-middleman-deps/padrino-helpers-0.10.7/lib/padrino-helpers' + end app.helpers ::Padrino::Helpers::OutputHelpers app.helpers ::Padrino::Helpers::TagHelpers