Sha256: 1abdb400563bb05eb4281db5c0844cebf5abe9c68a3ca3cd27bfe5de148f4fe7
Contents?: true
Size: 540 Bytes
Versions: 14
Compression:
Stored size: 540 Bytes
Contents
# frozen_string_literal: true module Bridgetown class YAMLParser PERMITTED_CLASSES = [Date, Time, Rb].freeze class << self def load_file(filename, **kwargs) kwargs = { permitted_classes: PERMITTED_CLASSES }.merge(kwargs) YAML.safe_load_file(filename, **kwargs) end def load(yaml) if RUBY_VERSION.start_with?("2.5") YAML.safe_load yaml, PERMITTED_CLASSES else YAML.safe_load yaml, permitted_classes: PERMITTED_CLASSES end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems