Module: Erubis

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

Defined Under Namespace

Modules: BlockAwareEnhancer Classes: BlockAwareEruby, MEruby

Class Method Summary collapse

Class Method Details

.load_yaml_file(file, binding = binding) ⇒ Object

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

Parameters
file<String>

The name of the file to load.

binding<Binding>

The binding to use when evaluating the ERB tags. Defaults to the current binding.



74
75
76
# File 'lib/merb-core/gem_ext/erubis.rb', line 74

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