Module: Erubis

Defined in:
merb-core/lib/merb-core/gem_ext/erubis.rb,
merb-core/lib/merb-core/controller/template.rb

Defined Under Namespace

Modules: BlockAwareEnhancer Classes: BlockAwareEruby, MEruby

Class Method Summary (collapse)

Class Method Details

+ (Object) load_yaml_file(file, binding = binding)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Loads a file, runs it through Erubis and parses it as YAML.

Parameters:

  • file (String)

    The name of the file to load.

  • binding (Binding) (defaults to: binding)

    The binding to use when evaluating the ERB tags.



79
80
81
# File 'merb-core/lib/merb-core/gem_ext/erubis.rb', line 79

def self.load_yaml_file(file, binding = binding)
  YAML::load(Erubis::MEruby.new(IO.read(File.expand_path(file))).result(binding))
end