Sha256: b55a4a6282cd94b3c8893284835d35384b144441935998205f11d29a1e3d352b

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 Bytes

Contents

require 'safe_yaml'

module Jekyll
  module Drivers
    class YamlDriver
      def initialize(options)
        @path = options['path']

        if !@path
          raise FatalException.new "'path' must be specified for yaml data source: #{options['name']}."
        end

        if !File.exists?(@path)
          raise FatalException.new "the file '#{@path}' doesn't exist for data source '#{options['name']}'"
        end
      end

      def load
        YAML.safe_load_file(@path)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
monad-0.0.3 lib/jekyll/drivers/yaml_driver.rb