mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Make automatic helpers smarter. Fixes #510
This commit is contained in:
parent
be2589de0d
commit
df31f65522
5 changed files with 6 additions and 6 deletions
|
@ -1,3 +1,3 @@
|
||||||
module ThreeHelper
|
module Derp
|
||||||
def three; "Three"; end
|
def three; "Three"; end
|
||||||
end
|
end
|
|
@ -1,3 +1,3 @@
|
||||||
module FourHelper
|
module FourHelpers
|
||||||
def four; "Four"; end
|
def four; "Four"; end
|
||||||
end
|
end
|
|
@ -1,3 +0,0 @@
|
||||||
module TwoHelper
|
|
||||||
def two; "Two"; end
|
|
||||||
end
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
module YetAnotherThingy
|
||||||
|
def two; "Two"; end
|
||||||
|
end
|
|
@ -10,7 +10,7 @@ module Middleman
|
||||||
def registered(app)
|
def registered(app)
|
||||||
# Setup a default helpers paths
|
# Setup a default helpers paths
|
||||||
app.set :helpers_dir, "helpers"
|
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|
|
app.set :helpers_filename_to_module_name_proc, Proc.new { |filename|
|
||||||
basename = File.basename(filename, File.extname(filename))
|
basename = File.basename(filename, File.extname(filename))
|
||||||
basename.camelcase
|
basename.camelcase
|
||||||
|
|
Loading…
Reference in a new issue