Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop#[]: only use public_send for keys in the content_methods array #4388

Merged
merged 2 commits into from Jan 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions features/post_data.feature
Expand Up @@ -301,6 +301,18 @@ Feature: Post data
And the _site directory should exist
And I should see "Post author: Darth Vader" in "_site/2009/03/27/star-wars.html"

Scenario: Use a variable which is a reserved keyword in Ruby
Given I have a _posts directory
And I have a _layouts directory
And I have the following post:
| title | date | layout | class | content |
| My post | 2016-01-21 | simple | kewl-post | Luke, I am your father. |
And I have a simple layout that contains "{{page.title}} has class {{page.class}}"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "My post has class kewl-post" in "_site/2016/01/21/my-post.html"

Scenario: Previous and next posts title
Given I have a _posts directory
And I have a _layouts directory
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/drops/drop.rb
Expand Up @@ -46,7 +46,7 @@ def initialize(obj)
def [](key)
if self.class.mutable? && @mutations.key?(key)
@mutations[key]
elsif respond_to? key
elsif self.class.invokable? key
public_send key
else
fallback_data[key]
Expand Down