Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
rename disabled option to enabled
  • Loading branch information
qwtel committed Sep 2, 2017
1 parent 9eb7f99 commit 539f359
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -57,5 +57,5 @@ Even if the plugin is enabled (e.g., via the `:jekyll_plugins` group in your Gem

```yml
optional_front_matter:
disabled: true
enabled: false
```
4 changes: 2 additions & 2 deletions lib/jekyll-optional-front-matter/generator.rb
Expand Up @@ -6,7 +6,7 @@ class Generator < Jekyll::Generator
priority :normal

CONFIG_KEY = "optional_front_matter".freeze
DISABLED_KEY = "disabled".freeze
ENABLED_KEY = "enabled".freeze
CLEANUP_KEY = "remove_originals".freeze

def initialize(site)
Expand Down Expand Up @@ -74,7 +74,7 @@ def option(key)
end

def disabled?
option(DISABLED_KEY) || site.config["require_front_matter"]
option(ENABLED_KEY) == false || site.config["require_front_matter"]
end

def cleanup?
Expand Down
4 changes: 2 additions & 2 deletions spec/jekyll-optional-front-matter/generator_spec.rb
Expand Up @@ -93,7 +93,7 @@

context "when disabled" do
let(:site) do
fixture_site("site", { "optional_front_matter" => { "disabled" => true } })
fixture_site("site", { "optional_front_matter" => { "enabled" => false } })
end

context "generating" do
Expand All @@ -107,7 +107,7 @@

context "when explicitly enabled" do
let(:site) do
fixture_site("site", { "optional_front_matter" => { "disabled" => false } })
fixture_site("site", { "optional_front_matter" => { "enabled" => true } })
end

context "generating" do
Expand Down

0 comments on commit 539f359

Please sign in to comment.