lib/nanoc/data_sources/filesystem.rb in nanoc-4.0.0b4 vs lib/nanoc/data_sources/filesystem.rb in nanoc-4.0.0rc1
- old
+ new
@@ -52,11 +52,11 @@
# Get filenames
meta_filename = filename_for(base_filename, meta_ext)
content_filename = filename_for(base_filename, content_ext)
# Read content and metadata
- is_binary = content_filename && !@site.config[:text_extensions].include?(File.extname(content_filename)[1..-1])
+ is_binary = content_filename && !@site_config[:text_extensions].include?(File.extname(content_filename)[1..-1])
if is_binary && klass == Nanoc::Int::Item
meta = (meta_filename && YAML.load_file(meta_filename)) || {}
content_or_filename = content_filename
elsif is_binary && klass == Nanoc::Int::Layout
raise "The layout file '#{content_filename}' is a binary file, but layouts can only be textual"
@@ -167,19 +167,19 @@
# data sources may prefer to implement this differently (for example,
# {Nanoc::DataSources::FilesystemVerbose} doubles the last part of the
# basename before concatenating it with a period and the extension).
def filename_for(_base_filename, _ext)
raise NotImplementedError.new(
- "#{self.class} does not implement #filename_for"
+ "#{self.class} does not implement #filename_for",
)
end
# Returns the identifier that corresponds with the given filename, which
# can be the content filename or the meta filename.
def identifier_for_filename(_filename)
raise NotImplementedError.new(
- "#{self.class} does not implement #identifier_for_filename"
+ "#{self.class} does not implement #identifier_for_filename",
)
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,
@@ -232,10 +232,10 @@
# Split data
pieces = data.split(/^(-{5}|-{3})[ \t]*\r?\n?/, 3)
if pieces.size < 4
raise RuntimeError.new(
- "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."
+ "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
# Parse
begin