Make automatic helpers smarter. Fixes #510
This commit is contained in:
parent
be2589de0d
commit
df31f65522
|
@ -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 +1,3 @@
|
||||||
module TwoHelper
|
module YetAnotherThingy
|
||||||
def two; "Two"; end
|
def two; "Two"; end
|
||||||
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