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

Make content_for raise an exception in case of silently overwriting content #713

Merged
merged 4 commits into from
Nov 1, 2015
Merged

Make content_for raise an exception in case of silently overwriting content #713

merged 4 commits into from
Nov 1, 2015

Conversation

Fjan
Copy link
Contributor

@Fjan Fjan commented Oct 30, 2015

This addresses #704

@denisdefreyne
Copy link
Member

Could you add tests for this, and remove the commented-out code?

@denisdefreyne denisdefreyne modified the milestone: 4.0.1 Nov 1, 2015
@Fjan
Copy link
Contributor Author

Fjan commented Nov 1, 2015

OK, done

io.write 'include Nanoc::Helpers::Capturing'
end
File.open('content/includer.erb', 'w') do |io|
io.write '[<%= content_for(@items.find { |i| i.identifier == \'/includee/\' }, :blah) %>]'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace

@items.find { |i| i.identifier == \'/includee/\' }

with

@items["/includee/"]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I changed that, but note that all other tests in that file use the other style

@denisdefreyne
Copy link
Member

Thanks!

denisdefreyne added a commit that referenced this pull request Nov 1, 2015
Make content_for raise an exception in case of silently overwriting content
@denisdefreyne denisdefreyne merged commit bf13d9c into nanoc:master Nov 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants