From df31f655222359129a24a506378fe9331764f590 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Wed, 4 Jul 2012 11:29:00 -0700 Subject: [PATCH] Make automatic helpers smarter. Fixes #510 --- .../external-helpers/helpers/{three_helper.rb => derp.rb} | 2 +- .../helpers/{four_helper.rb => four_helpers.rb} | 2 +- .../helpers/{two_helper.rb => yet_another_thingy.rb} | 2 +- .../lib/middleman-core/core_extensions/external_helpers.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename middleman-core/fixtures/external-helpers/helpers/{three_helper.rb => derp.rb} (60%) rename middleman-core/fixtures/external-helpers/helpers/{four_helper.rb => four_helpers.rb} (58%) rename middleman-core/fixtures/external-helpers/helpers/{two_helper.rb => yet_another_thingy.rb} (51%) diff --git a/middleman-core/fixtures/external-helpers/helpers/three_helper.rb b/middleman-core/fixtures/external-helpers/helpers/derp.rb similarity index 60% rename from middleman-core/fixtures/external-helpers/helpers/three_helper.rb rename to middleman-core/fixtures/external-helpers/helpers/derp.rb index 067137be..5e6ea1fe 100644 --- a/middleman-core/fixtures/external-helpers/helpers/three_helper.rb +++ b/middleman-core/fixtures/external-helpers/helpers/derp.rb @@ -1,3 +1,3 @@ -module ThreeHelper +module Derp def three; "Three"; end end \ No newline at end of file diff --git a/middleman-core/fixtures/external-helpers/helpers/four_helper.rb b/middleman-core/fixtures/external-helpers/helpers/four_helpers.rb similarity index 58% rename from middleman-core/fixtures/external-helpers/helpers/four_helper.rb rename to middleman-core/fixtures/external-helpers/helpers/four_helpers.rb index a0bb07cb..4e05c65e 100644 --- a/middleman-core/fixtures/external-helpers/helpers/four_helper.rb +++ b/middleman-core/fixtures/external-helpers/helpers/four_helpers.rb @@ -1,3 +1,3 @@ -module FourHelper +module FourHelpers def four; "Four"; end end \ No newline at end of file diff --git a/middleman-core/fixtures/external-helpers/helpers/two_helper.rb b/middleman-core/fixtures/external-helpers/helpers/yet_another_thingy.rb similarity index 51% rename from middleman-core/fixtures/external-helpers/helpers/two_helper.rb rename to middleman-core/fixtures/external-helpers/helpers/yet_another_thingy.rb index b6c2e26e..b7e6f003 100644 --- a/middleman-core/fixtures/external-helpers/helpers/two_helper.rb +++ b/middleman-core/fixtures/external-helpers/helpers/yet_another_thingy.rb @@ -1,3 +1,3 @@ -module TwoHelper +module YetAnotherThingy def two; "Two"; end end \ No newline at end of file diff --git a/middleman-core/lib/middleman-core/core_extensions/external_helpers.rb b/middleman-core/lib/middleman-core/core_extensions/external_helpers.rb index 4a9d779e..fc0b726c 100644 --- a/middleman-core/lib/middleman-core/core_extensions/external_helpers.rb +++ b/middleman-core/lib/middleman-core/core_extensions/external_helpers.rb @@ -10,7 +10,7 @@ module Middleman def registered(app) # Setup a default helpers paths app.set :helpers_dir, "helpers" - app.set :helpers_filename_glob, "**/*_helper.rb" + app.set :helpers_filename_glob, "**/*.rb" app.set :helpers_filename_to_module_name_proc, Proc.new { |filename| basename = File.basename(filename, File.extname(filename)) basename.camelcase