From 1b330e7a27c93b6bff4f9c6243d4d1e96cf0d1b6 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Wed, 30 Nov 2011 22:06:00 -0800 Subject: [PATCH 1/4] Oops - the change to the frontmatter regex broke it somehow. This reverts that change (but also reigns in the file_deleted hook). --- lib/middleman/core_extensions/front_matter.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/middleman/core_extensions/front_matter.rb b/lib/middleman/core_extensions/front_matter.rb index 416f686d..28c662fe 100644 --- a/lib/middleman/core_extensions/front_matter.rb +++ b/lib/middleman/core_extensions/front_matter.rb @@ -17,7 +17,7 @@ module Middleman::CoreExtensions::FrontMatter frontmatter.touch_file(file) end - file_deleted do |file| + file_deleted FrontMatter.matcher do |file| frontmatter.remove_file(file) end @@ -52,7 +52,7 @@ module Middleman::CoreExtensions::FrontMatter class FrontMatter class << self def matcher - %r{^source/.*\.html} + %r{source/.*\.html} end end @@ -121,4 +121,4 @@ module Middleman::CoreExtensions::FrontMatter [data, content] end end -end \ No newline at end of file +end From c730af108c1721d775c520a2c0e612075d1aa93b Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Wed, 30 Nov 2011 20:55:44 -0800 Subject: [PATCH 2/4] Document "doc" task and use "sh" so it prints output --- Rakefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 08de0540..0be3d96c 100644 --- a/Rakefile +++ b/Rakefile @@ -7,11 +7,11 @@ Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t| t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}" end -require 'rake/testtask' require 'rake/clean' task :test => ["cucumber"] +desc "Build HTML documentation" task :doc do - `bundle exec yard` -end \ No newline at end of file + sh 'bundle exec yard' +end From d08b825607f81df097414d787e25e94b3a109cfe Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Wed, 30 Nov 2011 20:55:59 -0800 Subject: [PATCH 3/4] Fix typo desination -> destination --- lib/middleman/core_extensions/builder.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/middleman/core_extensions/builder.rb b/lib/middleman/core_extensions/builder.rb index 5f166d91..97076638 100644 --- a/lib/middleman/core_extensions/builder.rb +++ b/lib/middleman/core_extensions/builder.rb @@ -20,11 +20,11 @@ module Middleman::CoreExtensions::Builder self.class.build_reroute(&block) end - def reroute_builder(desination, request_path) - result = [desination, request_path] + def reroute_builder(destination, request_path) + result = [destination, request_path] build_reroute.each do |block| - output = instance_exec(desination, request_path, &block) + output = instance_exec(destination, request_path, &block) if output result = output break @@ -34,4 +34,4 @@ module Middleman::CoreExtensions::Builder result end end -end \ No newline at end of file +end From c92ccbb613aa5dca6de05c1366fa6f2e8153116f Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Wed, 30 Nov 2011 21:35:30 -0800 Subject: [PATCH 4/4] Trim down frontmatter data storage by not storing the source of the template after stripping frontmatter in the local_data hash. --- lib/middleman/core_extensions/front_matter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/middleman/core_extensions/front_matter.rb b/lib/middleman/core_extensions/front_matter.rb index 28c662fe..86f2cfce 100644 --- a/lib/middleman/core_extensions/front_matter.rb +++ b/lib/middleman/core_extensions/front_matter.rb @@ -25,7 +25,7 @@ module Middleman::CoreExtensions::FrontMatter relative_path = path.sub(source_dir, "") data = if frontmatter.has_data?(relative_path) - frontmatter.data(relative_path).first + frontmatter.data(relative_path) else {} end @@ -78,7 +78,7 @@ module Middleman::CoreExtensions::FrontMatter if result file = file.sub(@app.source_dir, "") - @local_data[file] = result + @local_data[file] = result[0] path = File.join(@app.source_dir, file) @app.cache.set([:raw_template, path], result[1]) end