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 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 diff --git a/lib/middleman/core_extensions/front_matter.rb b/lib/middleman/core_extensions/front_matter.rb index 416f686d..86f2cfce 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 @@ -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 @@ -52,7 +52,7 @@ module Middleman::CoreExtensions::FrontMatter class FrontMatter class << self def matcher - %r{^source/.*\.html} + %r{source/.*\.html} end 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 @@ -121,4 +121,4 @@ module Middleman::CoreExtensions::FrontMatter [data, content] end end -end \ No newline at end of file +end