Sha256: cc85c9df8555c2324d00f57027588b40595ec59d7a4c2ce4db41ce5044eee6f2

Contents?: true

Size: 421 Bytes

Versions: 24

Compression:

Stored size: 421 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)
        YAML.safe_load yaml, permitted_classes: PERMITTED_CLASSES
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
bridgetown-core-1.3.1 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.3.0 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.3.0.beta3 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.3.0.beta2 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.3.0.beta1 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.2.0 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.2.0.beta5 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.2.0.beta4 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.2.0.beta3 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.2.0.beta2 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.2.0.beta1 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.1.0 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.1.0.beta3 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.1.0.beta2 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.1.0.beta1 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.0.0 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.0.0.beta3 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.0.0.beta2 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.0.0.beta1 lib/bridgetown-core/yaml_parser.rb
bridgetown-core-1.0.0.alpha11 lib/bridgetown-core/yaml_parser.rb