From 610509b37370cc68d5ccf714715ec5610e4eacf0 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Thu, 10 Nov 2011 15:35:53 -0800 Subject: [PATCH] don't try to parse frontmatter from binary files, duh --- lib/middleman/core_extensions/front_matter.rb | 5 ++++- lib/middleman/guard.rb | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/middleman/core_extensions/front_matter.rb b/lib/middleman/core_extensions/front_matter.rb index 35b20356..baa842e8 100644 --- a/lib/middleman/core_extensions/front_matter.rb +++ b/lib/middleman/core_extensions/front_matter.rb @@ -66,7 +66,7 @@ module Middleman::CoreExtensions::FrontMatter next if file.match(/\/\./) || (file.match(/\/_/) && !file.match(/\/__/)) || File.directory?(file) - + touch_file(file) end end @@ -76,6 +76,9 @@ module Middleman::CoreExtensions::FrontMatter end def touch_file(file) + extension = File.extname(file).sub(/\./, "") + return unless ::Tilt.mappings.has_key?(extension) + content = File.read(file) file = file.sub(@source, "") result = parse_front_matter(content) diff --git a/lib/middleman/guard.rb b/lib/middleman/guard.rb index d61dd4b9..f41084e7 100644 --- a/lib/middleman/guard.rb +++ b/lib/middleman/guard.rb @@ -23,7 +23,6 @@ module Middleman options_hash << ", :#{k} => '#{v}'" end - $stderr.puts options_hash.inspect guardfile_contents = %Q{ guard 'middleman'#{options_hash} do watch(%r{(.*)})