Sha256: 889992a4216aedb2d7e6881238a332dfac749394f5907f30b1cba5338c4f0ab6

Contents?: true

Size: 536 Bytes

Versions: 2

Compression:

Stored size: 536 Bytes

Contents

require 'erubis'
module Erubis
  
  class MEruby < Erubis::Eruby
    include PercentLineEnhancer
    include StringBufferEnhancer
  end

  # 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.
  def self.load_yaml_file(file, binding = binding)
    YAML::load(Erubis::MEruby.new(IO.read(File.expand_path(file))).result(binding))
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
merb-core-0.9.2 lib/merb-core/gem_ext/erubis.rb
merb-core-0.9.3 lib/merb-core/gem_ext/erubis.rb