Merge pull request #177 from bhollis/master
Fix previous commit and a few other changes
This commit is contained in:
commit
46e6d37fff
4
Rakefile
4
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'}"
|
t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'rake/testtask'
|
|
||||||
require 'rake/clean'
|
require 'rake/clean'
|
||||||
|
|
||||||
task :test => ["cucumber"]
|
task :test => ["cucumber"]
|
||||||
|
|
||||||
|
desc "Build HTML documentation"
|
||||||
task :doc do
|
task :doc do
|
||||||
`bundle exec yard`
|
sh 'bundle exec yard'
|
||||||
end
|
end
|
|
@ -20,11 +20,11 @@ module Middleman::CoreExtensions::Builder
|
||||||
self.class.build_reroute(&block)
|
self.class.build_reroute(&block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def reroute_builder(desination, request_path)
|
def reroute_builder(destination, request_path)
|
||||||
result = [desination, request_path]
|
result = [destination, request_path]
|
||||||
|
|
||||||
build_reroute.each do |block|
|
build_reroute.each do |block|
|
||||||
output = instance_exec(desination, request_path, &block)
|
output = instance_exec(destination, request_path, &block)
|
||||||
if output
|
if output
|
||||||
result = output
|
result = output
|
||||||
break
|
break
|
||||||
|
|
|
@ -17,7 +17,7 @@ module Middleman::CoreExtensions::FrontMatter
|
||||||
frontmatter.touch_file(file)
|
frontmatter.touch_file(file)
|
||||||
end
|
end
|
||||||
|
|
||||||
file_deleted do |file|
|
file_deleted FrontMatter.matcher do |file|
|
||||||
frontmatter.remove_file(file)
|
frontmatter.remove_file(file)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ module Middleman::CoreExtensions::FrontMatter
|
||||||
relative_path = path.sub(source_dir, "")
|
relative_path = path.sub(source_dir, "")
|
||||||
|
|
||||||
data = if frontmatter.has_data?(relative_path)
|
data = if frontmatter.has_data?(relative_path)
|
||||||
frontmatter.data(relative_path).first
|
frontmatter.data(relative_path)
|
||||||
else
|
else
|
||||||
{}
|
{}
|
||||||
end
|
end
|
||||||
|
@ -52,7 +52,7 @@ module Middleman::CoreExtensions::FrontMatter
|
||||||
class FrontMatter
|
class FrontMatter
|
||||||
class << self
|
class << self
|
||||||
def matcher
|
def matcher
|
||||||
%r{^source/.*\.html}
|
%r{source/.*\.html}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ module Middleman::CoreExtensions::FrontMatter
|
||||||
|
|
||||||
if result
|
if result
|
||||||
file = file.sub(@app.source_dir, "")
|
file = file.sub(@app.source_dir, "")
|
||||||
@local_data[file] = result
|
@local_data[file] = result[0]
|
||||||
path = File.join(@app.source_dir, file)
|
path = File.join(@app.source_dir, file)
|
||||||
@app.cache.set([:raw_template, path], result[1])
|
@app.cache.set([:raw_template, path], result[1])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue