Make LayoutReader#layout_directory public.
Since it's being used in a test, let's go ahead and expose it instead of dealing with using Object#send to send the message along.
This commit is contained in:
parent
1a879a04ab
commit
b68229aa2c
|
|
@ -14,6 +14,10 @@ module Jekyll
|
||||||
@layouts
|
@layouts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def layout_directory
|
||||||
|
@layout_directory ||= (layout_directory_in_cwd || layout_directory_inside_source)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def layout_entries
|
def layout_entries
|
||||||
|
|
@ -33,10 +37,6 @@ module Jekyll
|
||||||
Dir.chdir(directory) { yield }
|
Dir.chdir(directory) { yield }
|
||||||
end
|
end
|
||||||
|
|
||||||
def layout_directory
|
|
||||||
@layout_directory = (layout_directory_in_cwd || layout_directory_inside_source)
|
|
||||||
end
|
|
||||||
|
|
||||||
def layout_directory_inside_source
|
def layout_directory_inside_source
|
||||||
# TODO: Fix for Windows
|
# TODO: Fix for Windows
|
||||||
File.join(site.source, File.expand_path(site.config['layouts'], "/"))
|
File.join(site.source, File.expand_path(site.config['layouts'], "/"))
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class TestLayoutReader < Test::Unit::TestCase
|
||||||
|
|
||||||
context "when no _layouts directory exists in CWD" do
|
context "when no _layouts directory exists in CWD" do
|
||||||
should "know to use the layout directory relative to the site source" do
|
should "know to use the layout directory relative to the site source" do
|
||||||
assert_equal LayoutReader.new(@site).send(:layout_directory), source_dir("_layouts")
|
assert_equal LayoutReader.new(@site).layout_directory, source_dir("_layouts")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ class TestLayoutReader < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "know to use the layout directory relative to CWD" do
|
should "know to use the layout directory relative to CWD" do
|
||||||
assert_equal LayoutReader.new(@site).send(:layout_directory), source_dir("blah/_layouts")
|
assert_equal LayoutReader.new(@site).layout_directory, source_dir("blah/_layouts")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue