lib/nanoc/data_sources/filesystem.rb in nanoc-4.12.18 vs lib/nanoc/data_sources/filesystem.rb in nanoc-4.12.19
- old
+ new
@@ -46,12 +46,10 @@
# understood by Ruby’s `Encoding`. If no encoding is set in the configuration,
# one will be inferred from the environment.
#
# @api private
class Filesystem < Nanoc::DataSource
- PERMITTED_YAML_CLASSES = Nanoc::Core::ConfigLoader::PERMITTED_YAML_CLASSES
-
class AmbiguousMetadataAssociationError < ::Nanoc::Core::Error
def initialize(content_filenames, meta_filename)
super("There are multiple content files (#{content_filenames.sort.join(', ')}) that could match the file containing metadata (#{meta_filename}).")
end
end
@@ -152,10 +150,10 @@
def read_proto_document(content_filename, meta_filename, klass)
is_binary = content_filename && !@site_config[:text_extensions].include?(File.extname(content_filename)[1..])
if is_binary && klass == Nanoc::Core::Item
- meta = (meta_filename && YAML.safe_load_file(meta_filename, permitted_classes: PERMITTED_YAML_CLASSES)) || {}
+ meta = (meta_filename && Nanoc::Core::YamlLoader.load_file(meta_filename)) || {}
ProtoDocument.new(is_binary: true, filename: content_filename, attributes: meta)
elsif is_binary && klass == Nanoc::Core::Layout
raise Errors::BinaryLayout.new(content_filename)
else