From 622507309513f5a4102ef96c0959416eba888596 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 25 Apr 2014 19:47:35 -0400 Subject: [PATCH] Use the 'output' key instead of 'write' for writing out collections' document files. --- features/collections.feature | 19 ++++++++++++++++--- lib/jekyll/collection.rb | 2 +- test/test_collections.rb | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/features/collections.feature b/features/collections.feature index 5384a9c7..32e9161c 100644 --- a/features/collections.feature +++ b/features/collections.feature @@ -20,7 +20,7 @@ Feature: Collections """ collections: methods: - write: true + output: true foo: bar """ When I run jekyll build @@ -37,7 +37,7 @@ Feature: Collections """ collections: methods: - write: true + output: true foo: bar """ When I run jekyll build @@ -46,7 +46,7 @@ Feature: Collections And I should see "

Run your generators! default

" in "_site/methods/site/generate.html" And I should see "
Tom Preston-Werner
" in "_site/methods/site/generate.html" - Scenario: Collections directly on the site + Scenario: Collections specified as an array Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}" And I have fixture collections And I have a "_config.yml" file with content: @@ -57,3 +57,16 @@ Feature: Collections When I run jekyll build Then the _site directory should exist And I should see "Collections: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" + + Scenario: Collections specified as an hash + Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}" + And I have fixture collections + And I have a "_config.yml" file with content: + """ + collections: + methods: + baz: bin + """ + When I run jekyll build + Then the _site directory should exist + And I should see "Collections: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index ba8f8d91..e5aead12 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -129,7 +129,7 @@ module Jekyll # # Returns true if the 'write' metadata is true, false otherwise. def write? - !!metadata['write'] + !!metadata['output'] end # Extract options for this collection from the site configuration. diff --git a/test/test_collections.rb b/test/test_collections.rb index dafc2a8f..3171b4fd 100644 --- a/test/test_collections.rb +++ b/test/test_collections.rb @@ -74,9 +74,9 @@ class TestCollections < Test::Unit::TestCase should "know whether it should be written or not" do assert_equal @collection.write?, false - @collection.metadata['write'] = true + @collection.metadata['output'] = true assert_equal @collection.write?, true - @collection.metadata.delete 'write' + @collection.metadata.delete 'output' end end