Skip to content

Can't access Middleman data files, helpers #15

@erosdome

Description

@erosdome

Upon loading, I get:

undefined local variable or method `data' for #<#<Class:0x007f9913a97528>:0x007f99157d60f8>

Most of my scripts are .js.erb since I pull a lot of strings from Middleman data .yml files, so I have a lot of code like this:

var aString = "<%= data[:strings][:a_string] %>";

which works fine, except when running Jasmine-tests, as if Jasmine would not load Middleman data files. Is there a configuration setting where I can tell Jasmine to do so?

UPDATE:

It seems I also can't use Middleman helpers. I receive the same error when trying to use a Middleman helper defined in Middleman's config.rb file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions