lib/nanoc/data_sources/filesystem.rb in nanoc-4.11.0 vs lib/nanoc/data_sources/filesystem.rb in nanoc-4.11.1

- old
+ new

@@ -64,16 +64,16 @@ config.fetch(:layouts_dir, 'layouts') end # See {Nanoc::DataSource#items}. def items - load_objects(content_dir_name, Nanoc::Int::Item) + load_objects(content_dir_name, Nanoc::Core::Item) end # See {Nanoc::DataSource#layouts}. def layouts - load_objects(layouts_dir_name, Nanoc::Int::Layout) + load_objects(layouts_dir_name, Nanoc::Core::Layout) end def item_changes changes_for_dir(content_dir_name) end @@ -139,15 +139,15 @@ end def read_proto_document(content_filename, meta_filename, klass) is_binary = content_filename && !@site_config[:text_extensions].include?(File.extname(content_filename)[1..-1]) - if is_binary && klass == Nanoc::Int::Item + if is_binary && klass == Nanoc::Core::Item meta = (meta_filename && YAML.load_file(meta_filename)) || {} ProtoDocument.new(is_binary: true, filename: content_filename, attributes: meta) - elsif is_binary && klass == Nanoc::Int::Layout + elsif is_binary && klass == Nanoc::Core::Layout raise Errors::BinaryLayout.new(content_filename) else parse_result = parse(content_filename, meta_filename) ProtoDocument.new( @@ -259,13 +259,13 @@ def content_for(proto_doc, content_filename) full_content_filename = content_filename && File.expand_path(content_filename) if proto_doc.binary? - Nanoc::Int::BinaryContent.new(full_content_filename) + Nanoc::Core::BinaryContent.new(full_content_filename) else - Nanoc::Int::TextualContent.new(proto_doc.content, filename: full_content_filename) + Nanoc::Core::TextualContent.new(proto_doc.content, filename: full_content_filename) end end def mtime_of(content_filename, meta_filename) meta_mtime = meta_filename ? File.stat(meta_filename).mtime : nil @@ -349,19 +349,19 @@ # Returns the identifier that corresponds with the given filename, which # can be the content filename or the meta filename. def identifier_for_filename(filename) if config[:identifier_type] == 'full' - return Nanoc::Identifier.new(filename) + return Nanoc::Core::Identifier.new(filename) end regex = if /(^|\/)index(\.[^\/]+)?$/.match?(filename) allow_periods_in_identifiers? ? /\/?(index)?(\.[^\/\.]+)?$/ : /\/?index(\.[^\/]+)?$/ else allow_periods_in_identifiers? ? /\.[^\/\.]+$/ : /\.[^\/]+$/ end - Nanoc::Identifier.new(filename.sub(regex, ''), type: :legacy) + Nanoc::Core::Identifier.new(filename.sub(regex, ''), type: :legacy) end # Returns the base name of filename, i.e. filename with the first or all # extensions stripped off. By default, all extensions are stripped off, # but when allow_periods_in_identifiers is set to true in the site