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

item/@item is not available in Nanoc::Filter.define #932

Closed
werthen opened this issue Aug 21, 2016 · 1 comment
Closed

item/@item is not available in Nanoc::Filter.define #932

werthen opened this issue Aug 21, 2016 · 1 comment
Milestone

Comments

@werthen
Copy link
Contributor

werthen commented Aug 21, 2016

Summary

item or @item is not available in new Nanoc::Filter.define syntax

Expected behavior

item and @item should be available using this syntax.

Example

This works currently:

class IcalFilter < Nanoc::Filter
  identifier :ical

  def run(_content, _params = {})
    cal = Icalendar::Calendar.new
    cal.add_event(event_for(item))
    cal.to_ical
  end
end

This should work as well:

Nanoc::Filter.define(:ical) do |_content, _params|
  cal = Icalendar::Calendar.new
  cal.add_event(event_for(item))
  cal.to_ical
end
@denisdefreyne denisdefreyne modified the milestone: 4.3.1 Aug 22, 2016
denisdefreyne added a commit that referenced this issue Aug 22, 2016
Fix assigns in filters defined with Filter.define
@denisdefreyne
Copy link
Member

Fixed in #934.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants