Sha256: 1432c38c4561f8f730b11acce03775af3854f4e8052f44abf4e71674d2e2133e

Contents?: true

Size: 484 Bytes

Versions: 1

Compression:

Stored size: 484 Bytes

Contents

require 'liquid'
require 'yaml'

module Frise
  # Provides a static parse method for reading a config from a YAML file applying the required
  # transformations.
  module Parser
    class << self
      def parse(file, symbol_table = nil)
        return {} unless File.file? file
        content = File.open(file).read
        content = Liquid::Template.parse(content).render symbol_table if symbol_table
        YAML.safe_load(content, [], [], true) || {}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
frise-0.1.0 lib/frise/parser.rb