Sha256: 31c0d89330d291d7db8da438695c8142845aa74850649afd56e5446095d5d38f

Contents?: true

Size: 1.68 KB

Versions: 23

Compression:

Stored size: 1.68 KB

Contents

class Nanoc::DataSources::Filesystem < Nanoc::DataSource
  # @api private
  module Errors
    class Generic < ::Nanoc::Error
    end

    class BinaryLayout < Generic
      def initialize(content_filename)
        super("The layout file '#{content_filename}' is a binary file, but layouts can only be textual")
      end
    end

    class MultipleMetaFiles < Generic
      def initialize(meta_filenames, basename)
        super("Found #{meta_filenames.size} meta files for #{basename}; expected 0 or 1")
      end
    end

    class MultipleContentFiles < Generic
      def initialize(content_filenames, basename)
        super("Found #{content_filenames.size} content files for #{basename}; expected 0 or 1")
      end
    end

    class InvalidFormat < Generic
      def initialize(content_filename)
        super("The file '#{content_filename}' appears to start with a metadata section (three or five dashes at the top) but it does not seem to be in the correct format.")
      end
    end

    class UnparseableMetadata < Generic
      def initialize(filename, error)
        super("Could not parse metadata for #{filename}: #{error.message}")
      end
    end

    class InvalidMetadata < Generic
      def initialize(filename, klass)
        super("The file #{filename} has invalid metadata (expected key-value pairs, found #{klass} instead)")
      end
    end

    class InvalidEncoding < Generic
      def initialize(filename, encoding)
        super("Could not read #{filename} because the file is not valid #{encoding}.")
      end
    end

    class FileUnreadable < Generic
      def initialize(filename, error)
        super("Could not read #{filename}: #{error.inspect}")
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
nanoc-4.7.9 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.7.8 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.7.7 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.7.6 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.7.5 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.7.4 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.7.3 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.7.2 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.7.1 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.7.0 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.6.4 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.6.3 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.6.2 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.6.1 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.6.0 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.5.4 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.5.3 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.5.2 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.5.1 lib/nanoc/data_sources/filesystem/errors.rb
nanoc-4.5.0 lib/nanoc/data_sources/filesystem/errors.rb