split up util module, fix some rubocop complaints

This commit is contained in:
Thomas Reynolds 2016-01-31 14:13:52 -08:00
parent c5aabbbe4f
commit 3f18efeed9
13 changed files with 660 additions and 619 deletions

View file

@ -100,13 +100,13 @@ module Middleman
extension = File.extname(data_path)
basename = File.basename(data_path, extension)
return unless %w(.yaml .yml .json).include?(extension)
if %w(.yaml .yml).include?(extension)
data, postscript = ::Middleman::Util::Data.parse(file, @app.config[:frontmatter_delims], :yaml)
data[:postscript] = postscript if !postscript.nil? && data.is_a?(Hash)
elsif extension == '.json'
data, _postscript = ::Middleman::Util::Data.parse(file, @app.config[:frontmatter_delims], :json)
else
return
end
data_branch = @local_data