Helpers defined in config.rb don't seem to be found #248

Closed
jmulder opened this Issue Jan 24, 2012 · 5 comments

2 participants

@jmulder

Using 3.0.0b1 the exact syntax mentioned in the generated config.rb I can't seem to get helpers to work. Middleman returns a NoMethodError.

helpers do

    # Include partial with optional parameters
    def include (name, args)
        partial "_partials/#{name}", :locals => args
    end

end
@tdreyno
Middleman member

Thanks for reporting. Are you able to test on the current master in Github?

Planning on releasing a second beta gem soon, but hung up waiting for a library we rely on to release their own update.

@jmulder

@tdreyno I wish I was able to test on the current master, but I'm having some issues installing it.

My current test case is nothing special. Just gem install middleman --pre to get the 3.0.0b1 and defined a helper in the config.rb the way it is explained.

Looking forward to the second beta! Meanwhile, I'll try to get the above sorted myself and come back to you soon, in case you have not yet tested it yourself yet.

@jmulder

@tdreyno I just tried it on the master and it doesn't seem to work. However, if you extend the module Middleman::CoreExtensions::DefaultHelpers I can monkey patch it... ;-)

Edit: Call me crazy, I am not exactly sure what's going on, but it's working fine in 3.0.0.beta.1 one now. Might it be related to me trying this on ruby 1.9.3 now instead of 1.8.7?

@tdreyno
Middleman member

Interesting. We have test cases which cover this functionality which are passing on ruby 1.8.7, 1.9.2 and 1.9.3

I'll take a closer look.

@jmulder

I just tried to reproduce the problem on my machine at home and it seems to work fine under 1.8.7 and 1.9.3.

I fear I'm wasting time here, but I'll do some more tests on 1.8.7 at work tomorrow.

@tdreyno tdreyno closed this Mar 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment